Preferences: Sort categories from providers into list of categories

Designer options were always coming last because that uses an options
provider instead of option pages directly.

Change-Id: I2c02ce7d2ff122beb5d563a9c9ac263bdc71f62b
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-08-05 15:50:25 +02:00
parent 8261b98d7e
commit a874dc2305

View File

@@ -33,6 +33,7 @@
#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
#include <utils/fancylineedit.h>
#include <utils/qtcassert.h>
@@ -64,7 +65,6 @@ namespace Internal {
static QPointer<SettingsDialog> m_instance = 0;
// Helpers to sort by category. id
bool optionsPageLessThan(const IOptionsPage *p1, const IOptionsPage *p2)
{
if (p1->category() != p2->category())
@@ -212,6 +212,9 @@ void CategoryModel::setPages(const QList<IOptionsPage*> &pages,
category->providers.append(provider);
}
Utils::sort(m_categories, [](const Category *c1, const Category *c2) {
return c1->id.alphabeticallyBefore(c2->id);
});
endResetModel();
}