Changeset View
Changeset View
Standalone View
Standalone View
shell/plugincontroller.cpp
Show First 20 Lines • Show All 677 Lines • ▼ Show 20 Line(s) | 677 | { | |||
---|---|---|---|---|---|
678 | QStringList names; | 678 | QStringList names; | ||
679 | Q_FOREACH( const KPluginMetaData& info , d->plugins ) | 679 | Q_FOREACH( const KPluginMetaData& info , d->plugins ) | ||
680 | { | 680 | { | ||
681 | names << info.pluginId(); | 681 | names << info.pluginId(); | ||
682 | } | 682 | } | ||
683 | return names; | 683 | return names; | ||
684 | } | 684 | } | ||
685 | 685 | | |||
686 | QList<ContextMenuExtension> PluginController::queryPluginsForContextMenuExtensions(KDevelop::Context* context) const | 686 | QList<ContextMenuExtension> PluginController::queryPluginsForContextMenuExtensions(KDevelop::Context* context, QWidget* parent) const | ||
687 | { | 687 | { | ||
688 | // This fixes random order of extension menu items between different runs of KDevelop. | 688 | // This fixes random order of extension menu items between different runs of KDevelop. | ||
689 | // Without sorting we have random reordering of "Analyze With" submenu for example: | 689 | // Without sorting we have random reordering of "Analyze With" submenu for example: | ||
690 | // 1) "Cppcheck" actions, "Vera++" actions - first run | 690 | // 1) "Cppcheck" actions, "Vera++" actions - first run | ||
691 | // 2) "Vera++" actions, "Cppcheck" actions - some other run. | 691 | // 2) "Vera++" actions, "Cppcheck" actions - some other run. | ||
692 | QMultiMap<QString, IPlugin*> sortedPlugins; | 692 | QMultiMap<QString, IPlugin*> sortedPlugins; | ||
693 | for (auto it = d->loadedPlugins.constBegin(); it != d->loadedPlugins.constEnd(); ++it) { | 693 | for (auto it = d->loadedPlugins.constBegin(); it != d->loadedPlugins.constEnd(); ++it) { | ||
694 | sortedPlugins.insert(it.key().name(), it.value()); | 694 | sortedPlugins.insert(it.key().name(), it.value()); | ||
695 | } | 695 | } | ||
696 | 696 | | |||
697 | QList<ContextMenuExtension> exts; | 697 | QList<ContextMenuExtension> exts; | ||
698 | foreach (IPlugin* plugin, sortedPlugins) { | 698 | foreach (IPlugin* plugin, sortedPlugins) { | ||
699 | exts << plugin->contextMenuExtension(context); | 699 | exts << plugin->contextMenuExtension(context, parent); | ||
700 | } | 700 | } | ||
701 | 701 | | |||
702 | exts << Core::self()->debugControllerInternal()->contextMenuExtension(context); | 702 | exts << Core::self()->debugControllerInternal()->contextMenuExtension(context, parent); | ||
703 | exts << Core::self()->documentationControllerInternal()->contextMenuExtension(context); | 703 | exts << Core::self()->documentationControllerInternal()->contextMenuExtension(context, parent); | ||
704 | exts << Core::self()->sourceFormatterControllerInternal()->contextMenuExtension(context); | 704 | exts << Core::self()->sourceFormatterControllerInternal()->contextMenuExtension(context, parent); | ||
705 | exts << Core::self()->runControllerInternal()->contextMenuExtension(context); | 705 | exts << Core::self()->runControllerInternal()->contextMenuExtension(context, parent); | ||
706 | exts << Core::self()->projectControllerInternal()->contextMenuExtension(context); | 706 | exts << Core::self()->projectControllerInternal()->contextMenuExtension(context, parent); | ||
707 | 707 | | |||
708 | return exts; | 708 | return exts; | ||
709 | } | 709 | } | ||
710 | 710 | | |||
711 | QStringList PluginController::projectPlugins() | 711 | QStringList PluginController::projectPlugins() | ||
712 | { | 712 | { | ||
713 | QStringList names; | 713 | QStringList names; | ||
714 | foreach (const KPluginMetaData& info, d->plugins) { | 714 | foreach (const KPluginMetaData& info, d->plugins) { | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |