D14391: Fix random order of plugin's config pages

Milian Wolff noreply at phabricator.kde.org
Thu Jan 24 16:25:39 GMT 2019


mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  so, I believe we need to change some things here...

INLINE COMMENTS

> projectcontroller.cpp:157
>  
>          std::sort(configPages.begin(), configPages.end(),
>                    [](const ConfigPage* a, const ConfigPage* b) {

hmm looking at this again. this old code here sorts already, so in principle it should be fine already?

> uicontroller.cpp:511
>  
>      for (auto page : configPages) {
> +        cfgDlg.addConfigPage(page);

the list above is "sorted" already based on the sort order we impose, so this is fine and non-random too

> uicontroller.cpp:535
>  
> -    cfgDlg.insertConfigPage(templateConfig, documentationPreferences);
> -    cfgDlg.insertConfigPage(documentationPreferences, analyzersPreferences);
> -    cfgDlg.insertConfigPage(analyzersPreferences, runtimesPreferences);
> +    cfgDlg.addConfigPage(documentationPreferences);
> +    cfgDlg.addConfigPage(analyzersPreferences);

these lines should all be moved into the array on top I believe

> uicontroller.cpp:542
>  
>      foreach (IPlugin* plugin, ICore::self()->pluginController()->loadedPlugins()) {
>          addPluginPages(plugin);

so the source of randomness can only come from here, where we iterate over the loaded plugins. fixing that would be simple, too: just collect the pages here, then sort them, then add them. that should fix the randomness without changing the whole API and changing the order of the basic config pages

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D14391

To: arrowd, #kdevelop, antonanikin, mwolff
Cc: mwolff, arrowd, apol, kossebau, kdevelop-devel, glebaccon, hase, antismap, iodelay, geetamc, Pilzschaf, akshaydeo, surgenight
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190124/1b6a4e10/attachment-0001.html>


More information about the KDevelop-devel mailing list