mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-27 12:34:14 +02:00
Compare commits
9 Commits
26d7c03a76
...
bfe2aa26a0
| Author | SHA1 | Date | |
|---|---|---|---|
| bfe2aa26a0 | |||
| 4bde81937d | |||
| 91116f7044 | |||
| 8246c8aaba | |||
| 8ca62c4a17 | |||
| 0394503c0b | |||
| e5935c75d1 | |||
| 2e49f4588a | |||
| ccf545d30c |
Binary file not shown.
+411
-379
File diff suppressed because it is too large
Load Diff
@@ -378,10 +378,10 @@ QString ElementQueryWidget::queryStr() const
|
||||
where.clear();
|
||||
}
|
||||
|
||||
QString exclude_condition = "(exclude_from_bom IS NULL OR exclude_from_bom != '1')";
|
||||
|
||||
filter_ += " AND " + exclude_condition;
|
||||
// -------------------------------------------------------------
|
||||
// exclude_from_bom is already filtered by element_nomenclature_view
|
||||
// (see createElementNomenclatureView() in projectdatabase.cpp); this
|
||||
// widget's query reads FROM that view, so a flagged element never
|
||||
// reaches this point in the first place.
|
||||
|
||||
if (where.isEmpty() && !filter_.isEmpty()) {
|
||||
filter_.remove(0, 4); //Remove the first " AND" of filter.
|
||||
|
||||
@@ -228,7 +228,7 @@ void convertUriToGoTo(const QString &pdfPath)
|
||||
|
||||
// Find closing ')' of the URI value
|
||||
int uriStart = found + sUri.size();
|
||||
int closeParen = data.indexOf(')', uriStart);
|
||||
int closeParen = data.indexOf(")\n", uriStart);
|
||||
if (closeParen == -1) {
|
||||
// Malformed — copy rest verbatim
|
||||
out.append(data.mid(found));
|
||||
|
||||
@@ -174,6 +174,30 @@ QETProject::~QETProject()
|
||||
delete diagram;
|
||||
m_diagrams_list.removeOne(diagram);
|
||||
}
|
||||
|
||||
//A diagram can be detached from this project (detachDiagram(), used by
|
||||
//both removeDiagram() and RemoveDiagramCommand::redo()) and scheduled
|
||||
//for deferred deletion via deleteLater(), without that deletion having
|
||||
//actually run yet -- deleteLater() only fires on the next event-loop
|
||||
//iteration, and nothing guarantees one runs before this destructor
|
||||
//does. Such a diagram is no longer in m_diagrams_list (so the loop
|
||||
//above never touches it) but is still a QObject child of this project
|
||||
//(Diagram's constructor passes `project` straight to QGraphicsScene's
|
||||
//parent argument). Left alone, it is destroyed later by QObject's own
|
||||
//automatic child cleanup in ~QObject(), which runs AFTER m_data_base
|
||||
//(a plain value member, destroyed by ordinary C++ member teardown)
|
||||
//has already been destroyed -- and Diagram's destructor calls back
|
||||
//into dataBase()->removeElement() for each of its elements, so that
|
||||
//ordering is a use-after-free (confirmed by crash: SIGSEGV in
|
||||
//QSqlResult::exec(), called from Diagram::~Diagram() by way of
|
||||
//Diagram::removeItem(), by way of QObjectPrivate::deleteChildren()).
|
||||
//Delete any such stragglers now, synchronously, while m_data_base is
|
||||
//still alive. The deleteLater() event, if it is ever processed
|
||||
//afterward, is a safe no-op on an already-deleted QObject.
|
||||
const auto orphaned_diagrams = findChildren<Diagram *>(QString(), Qt::FindDirectChildrenOnly);
|
||||
for (Diagram *diagram : orphaned_diagrams) {
|
||||
delete diagram;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user