Commit 4b76d828 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

CommandLocator: Sort filter by priority and id, fix hg filter enabling.

parent 2a633870
......@@ -66,7 +66,11 @@ using namespace Locator::Internal;
namespace {
static bool filterLessThan(const ILocatorFilter *first, const ILocatorFilter *second)
{
return first->priority() < second->priority();
if (first->priority() < second->priority())
return true;
if (first->id().compare(second->id(), Qt::CaseInsensitive) < 0)
return true;
return false;
}
}
......
......@@ -708,11 +708,13 @@ void MercurialPlugin::createSeparator(const QList<int> &context, const QString &
void MercurialPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
{
if (!enableMenuAction(as, m_menuAction))
if (!enableMenuAction(as, m_menuAction)) {
m_commandLocator->setEnabled(false);
return;
}
const QString filename = currentState().currentFileName();
const bool repoEnabled = currentState().hasTopLevel();
m_commandLocator->setEnabled(repoEnabled);
annotateFile->setParameter(filename);
diffFile->setParameter(filename);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment