diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 8355267925a..5c3d8f3a261 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -3399,7 +3399,13 @@ void ProjectExplorerPluginPrivate::updateLocationSubMenus() if (!isVisible) return; + unsigned int lastPriority = 0; for (const FolderNode::LocationInfo &li : locations) { + if (li.priority != lastPriority) { + projectMenu->addSeparator(); + folderMenu->addSeparator(); + lastPriority = li.priority; + } const int line = li.line; const Utils::FilePath path = li.path; auto *action = new QAction(li.displayName, nullptr); diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index 452d3939a23..97be0e39ee7 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -673,6 +673,7 @@ void FolderNode::setIcon(const QIcon &icon) void FolderNode::setLocationInfo(const QList &info) { m_locations = info; + Utils::sort(m_locations, &LocationInfo::priority); } const QList FolderNode::locationInfo() const diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index 2d1968affec..760fe92e2e0 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -246,13 +246,22 @@ public: void setDisplayName(const QString &name); void setIcon(const QIcon &icon); - class LocationInfo { + class LocationInfo + { public: - LocationInfo(const QString &dn, const Utils::FilePath &p, const int l = -1) : - path(p), line(l), displayName(dn) { } + LocationInfo(const QString &dn, + const Utils::FilePath &p, + const int l = 0, + const unsigned int prio = 0) + : path(p) + , line(l) + , priority(prio) + , displayName(dn) + {} Utils::FilePath path; int line = -1; + unsigned int priority = 0; QString displayName; }; void setLocationInfo(const QList &info);