diff --git a/plugins/grepview/grepdialog.cpp b/plugins/grepview/grepdialog.cpp --- a/plugins/grepview/grepdialog.cpp +++ b/plugins/grepview/grepdialog.cpp @@ -13,6 +13,8 @@ #include "grepdialog.h" +#include + #include #include #include @@ -240,13 +242,21 @@ } } + QVector otherProjectUrls; foreach(IProject* project, m_plugin->core()->projectController()->projects()) { if (!hadUrls.contains(project->path())) { - addUrlToMenu(ret, project->path().toUrl()); + otherProjectUrls.append(project->path().toUrl()); } } + // sort the remaining project URLs alphabetically + std::sort(otherProjectUrls.begin(), otherProjectUrls.end()); + foreach(const QUrl& url, otherProjectUrls) + { + addUrlToMenu(ret, url); + } + addStringToMenu(ret, allOpenFilesString()); addStringToMenu(ret, allOpenProjectsString()); return ret;