| 780 | } |
| 781 | |
| 782 | QList<ContextMenuExtension> PluginController::queryPluginsForContextMenuExtensions(KDevelop::Context* context, QWidget* parent) const |
| 783 | { |
| 784 | Q_D(const PluginController); |
| 785 | |
| 786 | // This fixes random order of extension menu items between different runs of KDevelop. |
| 787 | // Without sorting we have random reordering of "Analyze With" submenu for example: |
| 788 | // 1) "Cppcheck" actions, "Vera++" actions - first run |
| 789 | // 2) "Vera++" actions, "Cppcheck" actions - some other run. |
| 790 | QMultiMap<QString, IPlugin*> sortedPlugins; |
| 791 | for (auto it = d->loadedPlugins.constBegin(); it != d->loadedPlugins.constEnd(); ++it) { |
| 792 | sortedPlugins.insert(it.key().name(), it.value()); |
| 793 | } |
| 794 | |
| 795 | QList<ContextMenuExtension> exts; |
| 796 | exts.reserve(sortedPlugins.size()); |
| 797 | for (IPlugin* plugin : std::as_const(sortedPlugins)) { |
| 798 | exts << plugin->contextMenuExtension(context, parent); |
| 799 | } |
| 800 | |
| 801 | exts << Core::self()->debugControllerInternal()->contextMenuExtension(context, parent); |
| 802 | exts << Core::self()->documentationControllerInternal()->contextMenuExtension(context, parent); |
| 803 | exts << Core::self()->sourceFormatterControllerInternal()->contextMenuExtension(context, parent); |
| 804 | exts << Core::self()->runControllerInternal()->contextMenuExtension(context, parent); |
| 805 | exts << Core::self()->projectControllerInternal()->contextMenuExtension(context, parent); |
| 806 | |
| 807 | return exts; |
| 808 | } |
| 809 | |
| 810 | QStringList PluginController::projectPlugins() const |
| 811 | { |
no test coverage detected