summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-02-11 19:23:09 +0200
committerOrgad Shaneh <orgads@gmail.com>2013-02-12 09:39:32 +0100
commitc4f76435adf378033843d596c4f26dda2b1336ef (patch)
treec7f583a3e8e001b61a118e3e633ecc1744a02e5b /src
parent41426ffaeb4d7515a9e82d1a53d7fb96c7daff57 (diff)
downloadqt-creator-c4f76435adf378033843d596c4f26dda2b1336ef.tar.gz
Prevent false positive cases for external file warning
Change-Id: I1ab404b63df4cecf02927b4fe4cf1d9cb8592da1 Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 72cf0573ad..1be7fcfd30 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -1755,7 +1755,7 @@ void ProjectExplorerPlugin::showExternalFileWarning()
if (d->m_currentNode || !d->m_currentProject)
return;
Core::IEditor *editor = Core::EditorManager::currentEditor();
- if (!editor)
+ if (!editor || editor->isTemporary())
return;
Core::IDocument *document = editor->document();
if (!document)
@@ -1765,8 +1765,10 @@ void ProjectExplorerPlugin::showExternalFileWarning()
if (!infoBar->canInfoBeAdded(externalFileId))
return;
Utils::FileName fileName = Utils::FileName::fromString(document->fileName());
+ if (fileName.isEmpty())
+ return;
Utils::FileName projectDir = Utils::FileName::fromString(d->m_currentProject->projectDirectory());
- if (fileName.isChildOf(projectDir))
+ if (projectDir.isEmpty() || fileName.isChildOf(projectDir))
return;
// External file. Test if it under the same VCS
QString topLevel;