diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp index 5a9e3e03c1f..58a0a76f692 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; diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 552a6281320..aea60998804 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -256,10 +256,11 @@ ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInfor .arg(QFileInfo(path()).fileName()) .arg(QLatin1String("/")); - int p = 80; - if (priority(files)) { - if (context == 0 || context == this) - p = 125; + int p = -1; + if (priority(files)) { // images/* and qml/js mimetypes + p = 110; + if (context == this) + p = 120; else if (projectNode() == context) p = 150; // steal from our project node // The ResourceFolderNode '/' defers to us, as otherwise @@ -267,7 +268,7 @@ ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInfor // Thus also return a high priority for it if (ResourceFolderNode *rfn = qobject_cast(context)) if (rfn->prefix() == QLatin1String("/") && rfn->parentFolderNode() == this) - p = 150; + p = 120; } return AddNewInformation(name, p); @@ -389,9 +390,10 @@ ProjectExplorer::FolderNode::AddNewInformation ResourceFolderNode::addNewInforma .arg(QFileInfo(m_topLevelNode->path()).fileName()) .arg(displayName()); - int p = 80; - if (priority(files)) { - if (context == 0 || context == this) + int p = -1; // never the default + if (priority(files)) { // image/* and qml/js mimetypes + p = 105; // prefer against .pro and .pri files + if (context == this) p = 120; }