forked from qt-creator/qt-creator
ProjectTree: Remove "external file" warning when node is found
If a new file is added, it is connected to the updateExternalFileWarning slot before the project tree is refreshed, and is not disconnected until closing and re-opening it. Task-number: QTCREATORBUG-17743 Change-Id: Icc7e3fe547a698d6f63116ca148cf1f4f8b60777 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
0115cc3103
commit
cc97609e60
@@ -225,10 +225,16 @@ void ProjectTree::update(Node *node, Project *project)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!node && Core::EditorManager::currentDocument()) {
|
if (Core::IDocument *document = Core::EditorManager::currentDocument()) {
|
||||||
connect(Core::EditorManager::currentDocument(), &Core::IDocument::changed,
|
if (node) {
|
||||||
this, &ProjectTree::updateExternalFileWarning,
|
disconnect(document, &Core::IDocument::changed,
|
||||||
Qt::UniqueConnection);
|
this, &ProjectTree::updateExternalFileWarning);
|
||||||
|
document->infoBar()->removeInfo(EXTERNAL_FILE_WARNING);
|
||||||
|
} else {
|
||||||
|
connect(document, &Core::IDocument::changed,
|
||||||
|
this, &ProjectTree::updateExternalFileWarning,
|
||||||
|
Qt::UniqueConnection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changedNode) {
|
if (changedNode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user