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:
Orgad Shaneh
2017-02-16 11:07:27 +02:00
committed by Orgad Shaneh
parent 0115cc3103
commit cc97609e60

View File

@@ -225,11 +225,17 @@ void ProjectTree::update(Node *node, Project *project)
}
}
if (!node && Core::EditorManager::currentDocument()) {
connect(Core::EditorManager::currentDocument(), &Core::IDocument::changed,
if (Core::IDocument *document = Core::EditorManager::currentDocument()) {
if (node) {
disconnect(document, &Core::IDocument::changed,
this, &ProjectTree::updateExternalFileWarning);
document->infoBar()->removeInfo(EXTERNAL_FILE_WARNING);
} else {
connect(document, &Core::IDocument::changed,
this, &ProjectTree::updateExternalFileWarning,
Qt::UniqueConnection);
}
}
if (changedNode) {
m_currentNode = node;