diff --git a/plugins/projectmanagerview/projecttreeview.cpp b/plugins/projectmanagerview/projecttreeview.cpp --- a/plugins/projectmanagerview/projecttreeview.cpp +++ b/plugins/projectmanagerview/projecttreeview.cpp @@ -386,9 +386,6 @@ } popupContextMenu_appendActions(menu, projectActions); - if(!itemlist.isEmpty()) - KDevelop::populateParentItemsMenu(itemlist.front(), &menu); - if ( !menu.isEmpty() ) { menu.exec(viewport()->mapToGlobal(pos)); } diff --git a/project/projectutils.h b/project/projectutils.h --- a/project/projectutils.h +++ b/project/projectutils.h @@ -47,12 +47,6 @@ }; /** - * Adds menu entries for all parent folders of the given item, each containing all the project - * items for the folder, at the end of the given menu. - * */ -KDEVPLATFORMPROJECT_EXPORT void populateParentItemsMenu( ProjectBaseItem* item, QMenu* menu ); - -/** * Returns all the files that have @p projectItem as ancestor */ KDEVPLATFORMPROJECT_EXPORT QList allFiles(ProjectBaseItem* projectItem); diff --git a/project/projectutils.cpp b/project/projectutils.cpp --- a/project/projectutils.cpp +++ b/project/projectutils.cpp @@ -21,16 +21,7 @@ #include "projectutils.h" #include #include "path.h" -#include -#include -#include - -#include -#include -#include -#include -#include namespace KDevelop { @@ -51,72 +42,6 @@ return urls; } -class Populator : public QObject -{ - Q_OBJECT -public: - Populator(KDevelop::ProjectBaseItem* item, QAction* action, const QPoint& pos, const QString& text) - : m_item(item) - , m_pos(pos) - , m_text(text) - { - connect(action, &QAction::destroyed, this, &Populator::deleteLater); - connect(action, &QAction::triggered, this, &Populator::populate); - } - -public Q_SLOTS: - void populate() - { - QMenu* menu = new QMenu(m_text); - connect(menu, &QMenu::aboutToHide, menu, &QMenu::deleteLater); - menu->addAction(QIcon::fromTheme(m_item->iconName()), m_text)->setEnabled(false); - ProjectItemContextImpl context({m_item}); - QList extensions = ICore::self()->pluginController()->queryPluginsForContextMenuExtensions( &context ); - ContextMenuExtension::populateMenu(menu, extensions); - menu->popup(m_pos); - } - -private: - KDevelop::ProjectBaseItem* m_item; - QPoint m_pos; - QString m_text; -}; - -void populateParentItemsMenu( ProjectBaseItem* item, QMenu* menu ) -{ - if(!item) - return; - - ProjectBaseItem* parent = item->parent(); - bool hasSeparator = false; - while(parent) - { - if(!parent->path().isValid()) - { - if(!hasSeparator) - { - hasSeparator = true; - menu->addSeparator(); - } - - QString prettyName = ICore::self()->projectController()->prettyFileName(parent->path().toUrl(), IProjectController::FormatPlain); - - QString text; - if(parent->parent()) - text = i18n("Folder %1", prettyName); - else - text = i18n("Project %1", prettyName); - - QAction* action = menu->addAction(text); - action->setIcon(QIcon::fromTheme(parent->iconName())); - // The populator will either spawn a menu when the action is triggered, or it will delete itself - new Populator(parent, action, QCursor::pos(), text); - } - - parent = parent->parent(); - } -} - QList allFiles(ProjectBaseItem* projectItem) { QList files; @@ -148,5 +73,3 @@ } } - -#include "projectutils.moc" diff --git a/shell/textdocument.cpp b/shell/textdocument.cpp --- a/shell/textdocument.cpp +++ b/shell/textdocument.cpp @@ -51,9 +51,6 @@ #include #include -#include -#include - #include "core.h" #include "mainwindow.h" #include "uicontroller.h" @@ -734,14 +731,6 @@ ContextMenuExtension::populateMenu(d->m_addedContextMenu, extensions); - { - QUrl url = v->document()->url(); - QList< ProjectBaseItem* > items = Core::self()->projectController()->projectModel()->itemsForPath( IndexedString(url) ); - if (!items.isEmpty()) { - populateParentItemsMenu( items.front(), d->m_addedContextMenu ); - } - } - foreach ( QAction* action, d->m_addedContextMenu->actions() ) { menu->addAction(action); }