Commit e8b3ee4a authored by Gleb Popov's avatar Gleb Popov 💬

Output config subpages alphabetically, instead of order in which corresponding plugins were loaded.

Original patch by @antonanikin.

Differential Revision: https://phabricator.kde.org/D14391
parent 44fcd808
......@@ -505,6 +505,10 @@ void UiController::showSettingsDialog()
new ProjectPreferences(&cfgDlg),
new EnvironmentPreferences(QString(), &cfgDlg),
templateConfig,
documentationPreferences,
analyzersPreferences,
runtimesPreferences,
languageConfigPage,
editorConfigPage
};
......@@ -512,6 +516,8 @@ void UiController::showSettingsDialog()
cfgDlg.appendConfigPage(page);
}
cfgDlg.appendSubConfigPage(languageConfigPage, new BGPreferences(&cfgDlg));
auto addPluginPages = [&](IPlugin* plugin) {
for (int i = 0, numPages = plugin->configPages(); i < numPages; ++i) {
auto page = plugin->configPage(i, &cfgDlg);
......@@ -532,14 +538,10 @@ void UiController::showSettingsDialog()
}
};
cfgDlg.insertConfigPage(templateConfig, documentationPreferences);
cfgDlg.insertConfigPage(documentationPreferences, analyzersPreferences);
cfgDlg.insertConfigPage(analyzersPreferences, runtimesPreferences);
cfgDlg.insertConfigPage(runtimesPreferences, languageConfigPage);
cfgDlg.appendSubConfigPage(languageConfigPage, new BGPreferences(&cfgDlg));
auto plugins = ICore::self()->pluginController()->loadedPlugins();
std::sort(plugins.begin(), plugins.end());
foreach (IPlugin* plugin, ICore::self()->pluginController()->loadedPlugins()) {
foreach (IPlugin* plugin, plugins) {
addPluginPages(plugin);
}
......
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