summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@digia.com>2014-08-05 16:08:45 +0200
committerEike Ziller <eike.ziller@digia.com>2014-08-15 13:10:27 +0200
commit1c6394b8cd9cf2df010bdbb06245fc8da323db96 (patch)
tree603bfec2598055aaf2ffa88cdcac59aac44a331d /src/plugins/projectexplorer
parentf6dab5c0e3f5589da78f9df72c24d33444ae7e4a (diff)
downloadqt-creator-1c6394b8cd9cf2df010bdbb06245fc8da323db96.tar.gz
New File Dialog: Tweak default node on Projct Page
The case from the bug report is: / --> project.pro --> src --> foo.qrc --> folder --> file added here Since the .qrc file is nearer then the .pro file, it was selected as the default node. This patch makes the priority for the .qrc node -1 if it's a unmatched mime type. That means a .qrc node will only be the default if it's either a image, a .qml or a .js file. Task-number: QTCREATORBUG-12793 Change-Id: I7328fd6359cc2e1959ab0bda831bd77de117baff Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/projectfilewizardextension.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp
index 5a9e3e03c1..58a0a76f69 100644
--- a/src/plugins/projectexplorer/projectfilewizardextension.cpp
+++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp
@@ -136,8 +136,10 @@ void BestNodeSelector::inspect(AddNewTree *tree)
const int projectDirectorySize = projectDirectory.size();
if (!m_commonDirectory.startsWith(projectDirectory))
return;
- bool betterMatch = projectDirectorySize > m_bestMatchLength
- || (projectDirectorySize == m_bestMatchLength && tree->priority() > m_bestMatchPriority);
+ bool betterMatch = tree->priority() > 0
+ && (projectDirectorySize > m_bestMatchLength
+ || (projectDirectorySize == m_bestMatchLength && tree->priority() > m_bestMatchPriority));
+
if (betterMatch) {
m_bestMatchPriority = tree->priority();
m_bestMatchLength = projectDirectorySize;