diff --git a/dolphin/src/CMakeLists.txt b/dolphin/src/CMakeLists.txt index 717ea6b1..b28996b8 100644 --- a/dolphin/src/CMakeLists.txt +++ b/dolphin/src/CMakeLists.txt @@ -96,35 +96,6 @@ install( DESTINATION ${KDE4_LIB_INSTALL_DIR} ) -########################################## - -set(dolphinpart_SRCS - dolphinpart.cpp - dolphinpart_ext.cpp -) - -kde4_add_plugin(dolphinpart ${dolphinpart_SRCS}) - -target_link_libraries(dolphinpart - KDE4::kparts - KDE4::kfile - dolphinprivate - konq -) - -install( - TARGETS dolphinpart - DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} -) - -install( - FILES dolphinpart.rc - DESTINATION ${KDE4_DATA_INSTALL_DIR}/dolphinpart -) -install( - FILES dolphinpart.desktop - DESTINATION ${KDE4_SERVICES_INSTALL_DIR} -) install( FILES views/versioncontrol/fileviewversioncontrolplugin.desktop DESTINATION ${KDE4_SERVICETYPES_INSTALL_DIR} diff --git a/dolphin/src/dolphinpart.cpp b/dolphin/src/dolphinpart.cpp deleted file mode 100644 index 002dbdb2..00000000 --- a/dolphin/src/dolphinpart.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/* This file is part of the KDE project - Copyright (c) 2007 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "dolphinpart.h" -#include "dolphinremoveaction.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "dolphinpart_ext.h" -#include "dolphinnewfilemenu.h" -#include "views/dolphinview.h" -#include "views/dolphinviewactionhandler.h" -#include "views/dolphinnewfilemenuobserver.h" -#include "views/dolphinremoteencoding.h" -#include "kitemviews/kfileitemmodel.h" -#include "kitemviews/private/kfileitemmodeldirlister.h" - -#include -#include -#include -#include -#include - -K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin();) -K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin")) - -DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args) - : KParts::ReadOnlyPart(parent) - ,m_openTerminalAction(0) - ,m_removeAction(0) -{ - Q_UNUSED(args) - setComponentData(DolphinPartFactory::componentData()); - m_extension = new DolphinPartBrowserExtension(this); - - // make sure that other apps using this part find Dolphin's view-file-columns icons - KIconLoader::global()->addAppDir("dolphin"); - - m_view = new DolphinView(KUrl(), parentWidget); - m_view->setTabsForFilesEnabled(true); - setWidget(m_view); - - connect(&DolphinNewFileMenuObserver::instance(), SIGNAL(errorMessage(QString)), - this, SLOT(slotErrorMessage(QString))); - - connect(m_view, SIGNAL(directoryLoadingCompleted()), this, SIGNAL(completed())); - connect(m_view, SIGNAL(directoryLoadingProgress(int)), this, SLOT(updateProgress(int))); - connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(slotErrorMessage(QString))); - - setXMLFile("dolphinpart.rc"); - - connect(m_view, SIGNAL(infoMessage(QString)), - this, SLOT(slotMessage(QString))); - connect(m_view, SIGNAL(operationCompletedMessage(QString)), - this, SLOT(slotMessage(QString))); - connect(m_view, SIGNAL(errorMessage(QString)), - this, SLOT(slotErrorMessage(QString))); - connect(m_view, SIGNAL(itemActivated(KFileItem)), - this, SLOT(slotItemActivated(KFileItem))); - connect(m_view, SIGNAL(itemsActivated(KFileItemList)), - this, SLOT(slotItemsActivated(KFileItemList))); - connect(m_view, SIGNAL(tabRequested(KUrl)), - this, SLOT(createNewWindow(KUrl))); - connect(m_view, SIGNAL(requestContextMenu(QPoint,KFileItem,KUrl,QList)), - this, SLOT(slotOpenContextMenu(QPoint,KFileItem,KUrl,QList))); - connect(m_view, SIGNAL(selectionChanged(KFileItemList)), - m_extension, SIGNAL(selectionInfo(KFileItemList))); - connect(m_view, SIGNAL(selectionChanged(KFileItemList)), - this, SLOT(slotSelectionChanged(KFileItemList))); - connect(m_view, SIGNAL(requestItemInfo(KFileItem)), - this, SLOT(slotRequestItemInfo(KFileItem))); - connect(m_view, SIGNAL(modeChanged(DolphinView::Mode,DolphinView::Mode)), - this, SIGNAL(viewModeChanged())); // relay signal - connect(m_view, SIGNAL(redirection(KUrl,KUrl)), - this, SLOT(slotDirectoryRedirection(KUrl,KUrl))); - - // Watch for changes that should result in updates to the - // status bar text. - connect(m_view, SIGNAL(itemCountChanged()), this, SLOT(updateStatusBar())); - connect(m_view, SIGNAL(selectionChanged(KFileItemList)), this, SLOT(updateStatusBar())); - - m_actionHandler = new DolphinViewActionHandler(actionCollection(), this); - m_actionHandler->setCurrentView(m_view); - connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory())); - - m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler); - connect(this, SIGNAL(aboutToOpenURL()), - m_remoteEncoding, SLOT(slotAboutToOpenUrl())); - - QClipboard* clipboard = QApplication::clipboard(); - connect(clipboard, SIGNAL(dataChanged()), - this, SLOT(updatePasteAction())); - - createActions(); - m_actionHandler->updateViewActions(); - slotSelectionChanged(KFileItemList()); // initially disable selection-dependent actions - - // Listen to events from the app so we can update the remove key by - // checking for a Shift key press. - qApp->installEventFilter(this); - - // TODO there was a "always open a new window" (when clicking on a directory) setting in konqueror - // (sort of spacial navigation) -} - -DolphinPart::~DolphinPart() -{ -} - -void DolphinPart::createActions() -{ - // Edit menu - - m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this); - m_newFileMenu->setParentWidget(widget()); - connect(m_newFileMenu->menu(), SIGNAL(aboutToShow()), - this, SLOT(updateNewMenu())); - - KAction *editMimeTypeAction = actionCollection()->addAction( "editMimeType" ); - editMimeTypeAction->setText( i18nc("@action:inmenu Edit", "&Edit File Type..." ) ); - connect(editMimeTypeAction, SIGNAL(triggered()), SLOT(slotEditMimeType())); - - KAction* selectItemsMatching = actionCollection()->addAction("select_items_matching"); - selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching...")); - selectItemsMatching->setShortcut(Qt::CTRL | Qt::Key_S); - connect(selectItemsMatching, SIGNAL(triggered()), this, SLOT(slotSelectItemsMatchingPattern())); - - KAction* unselectItemsMatching = actionCollection()->addAction("unselect_items_matching"); - unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching...")); - connect(unselectItemsMatching, SIGNAL(triggered()), this, SLOT(slotUnselectItemsMatchingPattern())); - - actionCollection()->addAction(KStandardAction::SelectAll, "select_all", m_view, SLOT(selectAll())); - - KAction* unselectAll = actionCollection()->addAction("unselect_all"); - unselectAll->setText(i18nc("@action:inmenu Edit", "Unselect All")); - connect(unselectAll, SIGNAL(triggered()), m_view, SLOT(clearSelection())); - - KAction* invertSelection = actionCollection()->addAction("invert_selection"); - invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection")); - invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A); - connect(invertSelection, SIGNAL(triggered()), m_view, SLOT(invertSelection())); - - // View menu: all done by DolphinViewActionHandler - - // Go menu - - QActionGroup* goActionGroup = new QActionGroup(this); - connect(goActionGroup, SIGNAL(triggered(QAction*)), - this, SLOT(slotGoTriggered(QAction*))); - - createGoAction("go_applications", "start-here-kde", - i18nc("@action:inmenu Go", "App&lications"), QString("programs:/"), - goActionGroup); - createGoAction("go_network_folders", "folder-remote", - i18nc("@action:inmenu Go", "&Network Folders"), QString("remote:/"), - goActionGroup); - createGoAction("go_settings", "preferences-system", - i18nc("@action:inmenu Go", "Sett&ings"), QString("settings:/"), - goActionGroup); - createGoAction("go_trash", "user-trash", - i18nc("@action:inmenu Go", "Trash"), QString("trash:/"), - goActionGroup); - - // Tools menu - m_findFileAction = actionCollection()->addAction("find_file"); - m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File...")); - m_findFileAction->setShortcut(Qt::CTRL | Qt::Key_F); - m_findFileAction->setIcon(KIcon("edit-find")); - connect(m_findFileAction, SIGNAL(triggered()), this, SLOT(slotFindFile())); - - m_openTerminalAction = actionCollection()->addAction("open_terminal"); - m_openTerminalAction->setIcon(KIcon("utilities-terminal")); - m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal")); - connect(m_openTerminalAction, SIGNAL(triggered()), SLOT(slotOpenTerminal())); - m_openTerminalAction->setShortcut(Qt::Key_F4); -} - -void DolphinPart::createGoAction(const char* name, const char* iconName, - const QString& text, const QString& url, - QActionGroup* actionGroup) -{ - KAction* action = actionCollection()->addAction(name); - action->setIcon(KIcon(iconName)); - action->setText(text); - action->setData(url); - action->setActionGroup(actionGroup); -} - -void DolphinPart::slotGoTriggered(QAction* action) -{ - const QString url = action->data().toString(); - emit m_extension->openUrlRequest(KUrl(url)); -} - -void DolphinPart::slotSelectionChanged(const KFileItemList& selection) -{ - const bool hasSelection = !selection.isEmpty(); - - QAction* renameAction = actionCollection()->action("rename"); - QAction* moveToTrashAction = actionCollection()->action("move_to_trash"); - QAction* deleteAction = actionCollection()->action("delete"); - QAction* editMimeTypeAction = actionCollection()->action("editMimeType"); - QAction* propertiesAction = actionCollection()->action("properties"); - QAction* deleteWithTrashShortcut = actionCollection()->action("delete_shortcut"); // see DolphinViewActionHandler - - if (!hasSelection) { - stateChanged("has_no_selection"); - - emit m_extension->enableAction("cut", false); - emit m_extension->enableAction("copy", false); - deleteWithTrashShortcut->setEnabled(false); - editMimeTypeAction->setEnabled(false); - } else { - stateChanged("has_selection"); - - // TODO share this code with DolphinMainWindow::updateEditActions (and the desktop code) - // in libkonq - KFileItemListProperties capabilities(selection); - const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving(); - - renameAction->setEnabled(capabilities.supportsMoving()); - moveToTrashAction->setEnabled(enableMoveToTrash); - deleteAction->setEnabled(capabilities.supportsDeleting()); - deleteWithTrashShortcut->setEnabled(capabilities.supportsDeleting() && !enableMoveToTrash); - editMimeTypeAction->setEnabled(true); - propertiesAction->setEnabled(true); - emit m_extension->enableAction("cut", capabilities.supportsMoving()); - emit m_extension->enableAction("copy", true); - } -} - -void DolphinPart::updatePasteAction() -{ - QPair pasteInfo = m_view->pasteInfo(); - emit m_extension->enableAction( "paste", pasteInfo.first ); - emit m_extension->setActionText( "paste", pasteInfo.second ); -} - -KAboutData* DolphinPart::createAboutData() -{ - return new KAboutData("dolphinpart", "dolphin", ki18nc("@title", "Dolphin Part"), "0.1"); -} - -bool DolphinPart::openUrl(const KUrl& url) -{ - bool reload = arguments().reload(); - // A bit of a workaround so that changing the namefilter works: force reload. - // Otherwise DolphinView wouldn't relist the URL, so nothing would happen. - if (m_nameFilter != m_view->nameFilter()) - reload = true; - if (m_view->url() == url && !reload) { // DolphinView won't do anything in that case, so don't emit started - return true; - } - setUrl(url); // remember it at the KParts level - KUrl visibleUrl(url); - if (!m_nameFilter.isEmpty()) { - visibleUrl.addPath(m_nameFilter); - } - QString prettyUrl = visibleUrl.pathOrUrl(); - emit setWindowCaption(prettyUrl); - emit m_extension->setLocationBarUrl(prettyUrl); - emit started(0); // get the wheel to spin - m_view->setNameFilter(m_nameFilter); - m_view->setUrl(url); - updatePasteAction(); - emit aboutToOpenURL(); - if (reload) - m_view->reload(); - // Disable "Find File" and "Open Terminal" actions for non-file URLs, - // e.g. ftp, smb, etc. #279283 - const bool isLocalUrl = url.isLocalFile(); - m_findFileAction->setEnabled(isLocalUrl); - if (m_openTerminalAction) { - m_openTerminalAction->setEnabled(isLocalUrl); - } - return true; -} - -void DolphinPart::slotMessage(const QString& msg) -{ - emit setStatusBarText(msg); -} - -void DolphinPart::slotErrorMessage(const QString& msg) -{ - kDebug() << msg; - emit canceled(msg); - //KMessageBox::error(m_view, msg); -} - -void DolphinPart::slotRequestItemInfo(const KFileItem& item) -{ - emit m_extension->mouseOverInfo(item); - if (item.isNull()) { - updateStatusBar(); - } else { - const QString escapedText = Qt::convertFromPlainText(item.getStatusBarInfo()); - ReadOnlyPart::setStatusBarText(QString("%1").arg(escapedText)); - } -} - -void DolphinPart::slotItemActivated(const KFileItem& item) -{ - KParts::OpenUrlArguments args; - // Forget about the known mimetype if a target URL is used. - // Testcase: network:/ with a item (mimetype "inode/some-foo-service") pointing to a http URL (html) - if (item.targetUrl() == item.url()) { - args.setMimeType(item.mimetype()); - } - - // Ideally, konqueror should be changed to not require trustedSource for directory views, - // since the idea was not to need BrowserArguments for non-browser stuff... - KParts::BrowserArguments browserArgs; - browserArgs.trustedSource = true; - emit m_extension->openUrlRequest(item.targetUrl(), args, browserArgs); -} - -void DolphinPart::slotItemsActivated(const KFileItemList& items) -{ - foreach (const KFileItem& item, items) { - slotItemActivated(item); - } -} - -void DolphinPart::createNewWindow(const KUrl& url) -{ - // TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code - // should be moved into DolphinPart::slotItemActivated() - emit m_extension->createNewWindow(url); -} - -void DolphinPart::slotOpenContextMenu(const QPoint& pos, - const KFileItem& _item, - const KUrl&, - const QList& customActions) -{ - KParts::BrowserExtension::PopupFlags popupFlags = KParts::BrowserExtension::DefaultPopupItems - | KParts::BrowserExtension::ShowProperties - | KParts::BrowserExtension::ShowUrlOperations; - - KFileItem item(_item); - - if (item.isNull()) { // viewport context menu - popupFlags |= KParts::BrowserExtension::ShowNavigationItems | KParts::BrowserExtension::ShowUp; - item = m_view->rootItem(); - if (item.isNull()) - item = KFileItem( S_IFDIR, (mode_t)-1, url() ); - else - item.setUrl(url()); // ensure we use the view url, not the canonical path (#213799) - } - - // TODO: We should change the signature of the slots (and signals) for being able - // to tell for which items we want a popup. - KFileItemList items; - if (m_view->selectedItems().isEmpty()) { - items.append(item); - } else { - items = m_view->selectedItems(); - } - - KFileItemListProperties capabilities(items); - - KParts::BrowserExtension::ActionGroupMap actionGroups; - QList editActions; - editActions += m_view->versionControlActions(m_view->selectedItems()); - editActions += customActions; - - if (!_item.isNull()) { // only for context menu on one or more items - const bool supportsMoving = capabilities.supportsMoving(); - - if (capabilities.supportsDeleting()) { - const bool showDeleteAction = (KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false) || - !item.isLocalFile()); - const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving; - - if (showDeleteAction && showMoveToTrashAction) { - delete m_removeAction; - m_removeAction = 0; - editActions.append(actionCollection()->action("move_to_trash")); - editActions.append(actionCollection()->action("delete")); - } else if (showDeleteAction && !showMoveToTrashAction) { - editActions.append(actionCollection()->action("delete")); - } else { - if (!m_removeAction) - m_removeAction = new DolphinRemoveAction(this, actionCollection()); - editActions.append(m_removeAction); - m_removeAction->update(); - } - } else { - popupFlags |= KParts::BrowserExtension::NoDeletion; - } - - if (supportsMoving) { - editActions.append(actionCollection()->action("rename")); - } - - // Normally KonqPopupMenu only shows the "Create new" submenu in the current view - // since otherwise the created file would not be visible. - // But in treeview mode we should allow it. - if (m_view->itemsExpandable()) - popupFlags |= KParts::BrowserExtension::ShowCreateDirectory; - - } - - actionGroups.insert("editactions", editActions); - - emit m_extension->popupMenu(pos, - items, - KParts::OpenUrlArguments(), - KParts::BrowserArguments(), - popupFlags, - actionGroups); -} - -void DolphinPart::slotDirectoryRedirection(const KUrl& oldUrl, const KUrl& newUrl) -{ - //kDebug() << oldUrl << newUrl << "currentUrl=" << url(); - if (oldUrl.equals(url(), KUrl::RemoveTrailingSlash /* #207572 */)) { - KParts::ReadOnlyPart::setUrl(newUrl); - const QString prettyUrl = newUrl.pathOrUrl(); - emit m_extension->setLocationBarUrl(prettyUrl); - } -} - - -void DolphinPart::slotEditMimeType() -{ - const KFileItemList items = m_view->selectedItems(); - if (!items.isEmpty()) { - KonqOperations::editMimeType(items.first().mimetype(), m_view); - } -} - -void DolphinPart::slotSelectItemsMatchingPattern() -{ - openSelectionDialog(i18nc("@title:window", "Select"), - i18n("Select all items matching this pattern:"), - true); -} - -void DolphinPart::slotUnselectItemsMatchingPattern() -{ - openSelectionDialog(i18nc("@title:window", "Unselect"), - i18n("Unselect all items matching this pattern:"), - false); -} - -void DolphinPart::openSelectionDialog(const QString& title, const QString& text, bool selectItems) -{ - bool okClicked; - QString pattern = KInputDialog::getText(title, text, "*", &okClicked, m_view); - - if (okClicked && !pattern.isEmpty()) { - QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard); - m_view->selectItems(patternRegExp, selectItems); - } -} - -void DolphinPart::setCurrentViewMode(const QString& viewModeName) -{ - QAction* action = actionCollection()->action(viewModeName); - Q_ASSERT(action); - action->trigger(); -} - -QString DolphinPart::currentViewMode() const -{ - return m_actionHandler->currentViewModeActionName(); -} - -void DolphinPart::setNameFilter(const QString& nameFilter) -{ - // This is the "/home/dfaure/*.diff" kind of name filter (KDirLister::setNameFilter) - // which is unrelated to DolphinView::setNameFilter which is substring filtering in a proxy. - m_nameFilter = nameFilter; - // TODO save/restore name filter in saveState/restoreState like KonqDirPart did in kde3? -} - -void DolphinPart::slotOpenTerminal() -{ - QString dir(QDir::homePath()); - - KUrl u(url()); - - // If the given directory is not local, it can still be the URL of an - // ioslave using UDS_LOCAL_PATH which to be converted first. - u = KIO::NetAccess::mostLocalUrl(u, widget()); - - //If the URL is local after the above conversion, set the directory. - if (u.isLocalFile()) { - dir = u.toLocalFile(); - } - - KToolInvocation::invokeTerminal(QString(), dir); -} - -void DolphinPart::slotFindFile() -{ - KRun::run("kfind", url(), widget()); -} - -void DolphinPart::updateNewMenu() -{ - // As requested by KNewFileMenu : - m_newFileMenu->checkUpToDate(); - m_newFileMenu->setViewShowsHiddenFiles(m_view->hiddenFilesShown()); - // And set the files that the menu apply on : - m_newFileMenu->setPopupFiles(url()); -} - -void DolphinPart::updateStatusBar() -{ - const QString escapedText = Qt::convertFromPlainText(m_view->statusBarText()); - emit ReadOnlyPart::setStatusBarText(QString("%1").arg(escapedText)); -} - -void DolphinPart::updateProgress(int percent) -{ - m_extension->loadingProgress(percent); -} - -void DolphinPart::createDirectory() -{ - m_newFileMenu->setViewShowsHiddenFiles(m_view->hiddenFilesShown()); - m_newFileMenu->setPopupFiles(url()); - m_newFileMenu->createDirectory(); -} - -void DolphinPart::setFilesToSelect(const KUrl::List& files) -{ - if (files.isEmpty()) { - return; - } - - m_view->markUrlsAsSelected(files); - m_view->markUrlAsCurrent(files.at(0)); -} - -bool DolphinPart::eventFilter(QObject* obj, QEvent* event) -{ - const int type = event->type(); - - if ((type == QEvent::KeyPress || type == QEvent::KeyRelease) && m_removeAction) { - QMenu* menu = qobject_cast(obj); - if (menu && menu->parent() == m_view) { - QKeyEvent* ev = static_cast(event); - if (ev->key() == Qt::Key_Shift) { - m_removeAction->update(); - } - } - } - - return KParts::ReadOnlyPart::eventFilter(obj, event); -} - -#include "moc_dolphinpart.cpp" diff --git a/dolphin/src/dolphinpart.desktop b/dolphin/src/dolphinpart.desktop deleted file mode 100644 index a1b0372f..00000000 --- a/dolphin/src/dolphinpart.desktop +++ /dev/null @@ -1,338 +0,0 @@ -[Desktop Entry] -Type=Service -Name=Dolphin View -Name[af]=Dolphin Deel -Name[ar]=عرض دولفين -Name[as]=Dolphin প্ৰদৰ্শন -Name[ast]=Vista de Dolphin -Name[be@latin]=Vyhlad „Dolphin” -Name[bg]=Преглед в Dolphin -Name[bn]=ডলফিন ভিউ -Name[bn_IN]=Dolphin প্রদর্শন -Name[bs]=Delfinov prikaz -Name[ca]=Vista del Dolphin -Name[ca@valencia]=Vista del Dolphin -Name[cs]=Pohled Dolphin -Name[csb]=Wëzdrzatk Dolphina -Name[da]=Dolphin-visning -Name[de]=Dolphin-Ansicht -Name[el]=Προβολή του Dolphin -Name[en_GB]=Dolphin View -Name[eo]=Dolphin-rigardo -Name[es]=Vista de Dolphin -Name[et]=Dolphini vaade -Name[eu]=Dolphin ikuspegia -Name[fi]=Dolphin-näkymä -Name[fr]=Vue de Dolphin -Name[fy]=Dolfyn werjefte -Name[ga]=Amharc Dolphin -Name[gl]=Vista de Dolphin -Name[gu]=ડોલ્ફિન દેખાવ -Name[he]=הגדרות תצוגה ב־Dolphin -Name[hi]=डॉल्फ़िन दृश्य -Name[hne]=डाल्फिन दृस्य -Name[hr]=Dolphinov prikaz -Name[hsb]=Napohlad w Dolphinje -Name[hu]=Dolphin-nézet -Name[ia]=Vista de Dolphin -Name[id]=Tampilan Dolphin -Name[is]=Dolphin sýn -Name[it]=Vista di Dolphin -Name[ja]=Dolphin ビュー -Name[kk]=Dolphin көрінісі -Name[km]=ទិដ្ឋភាព Dolphin -Name[kn]=ಡಾಲ್ಫಿನ್ ನೋಟ -Name[ko]=Dolphin 보기 -Name[ku]=Bergehê Dolphin -Name[lt]=Dolphin žiūryklė -Name[lv]=Dolphin skats -Name[mai]=डाल्फिन दृश्य -Name[mk]=Преглед со Делфин -Name[ml]=ഡോള്‍ഫിന്‍ അവതരണരീതി -Name[mr]=डॉल्फिन दृश्य -Name[ms]=Lihat Dolphin -Name[nb]=Dolphin visning -Name[nds]=Dolphin-Ansicht -Name[nl]=Dolphin-weergave -Name[nn]=Dolphin-vising -Name[or]=ଡଲଫିନ ଦୃଶ୍ୟ -Name[pa]=ਡਾਲਫਿਨ ਝਲਕ -Name[pl]=Widok Dolphina -Name[pt]=Área do Dolphin -Name[pt_BR]=Visualização do Dolphin -Name[ro]=Vizualizare Dolphin -Name[ru]=Представление Dolphin -Name[se]=Dolphinčájeheapmi -Name[si]=ඩොල්ෆින් දසුන -Name[sk]=Dolphin pohľad -Name[sl]=Dolphin - pogled -Name[sr]=Делфинов приказ -Name[sr@ijekavian]=Делфинов приказ -Name[sr@ijekavianlatin]=Dolphinov prikaz -Name[sr@latin]=Dolphinov prikaz -Name[sv]=Vy i Dolphin -Name[ta]=டால்பின் காட்சி -Name[te]=డాల్ఫిన్ వీక్షణం -Name[tg]=Намоиши Dolphin -Name[th]=มุมมองของดอลฟิน -Name[tr]=Dolphin Görünümü -Name[ug]=Dolphin كۆرۈنۈش -Name[uk]=Перегляд Dolphin -Name[wa]=Vuwe di Dolphin -Name[x-test]=xxDolphin Viewxx -Name[zh_CN]=Dolphin 视图 -Name[zh_TW]=Dolphin 檢視 -MimeType=inode/directory; -X-KDE-ServiceTypes=KParts/ReadOnlyPart -X-KDE-Library=dolphinpart -Icon=view-icon -InitialPreference=7 - -# Provide info about the view modes using the Actions mechanism so that KService parses it. -# Konqueror then queries KService to get hold of the translated texts for the view modes -Actions=icons;details;compact; - -[Desktop Action icons] -Name=Icons -Name[af]=Ikone -Name[ar]=أيقونات -Name[as]=আইকন -Name[ast]=Iconos -Name[be]=Значкі -Name[be@latin]=Ikony -Name[bg]=Икони -Name[bn]=আইকন -Name[bn_IN]=আইকন -Name[br]=Arlunioù -Name[bs]=Ikone -Name[ca]=Icones -Name[ca@valencia]=Icones -Name[cs]=Ikony -Name[csb]=Ikònë -Name[cy]=Eicon -Name[da]=Ikoner -Name[de]=Symbole -Name[el]=Εικονίδια -Name[en_GB]=Icons -Name[eo]=Piktogramoj -Name[es]=Iconos -Name[et]=Ikoonid -Name[eu]=Ikonoak -Name[fa]=شمایلها -Name[fi]=Kuvakkeet -Name[fr]=Icônes -Name[fy]=Byldkaikes -Name[ga]=Deilbhíní -Name[gl]=Iconas -Name[gu]=ચિહ્નો -Name[he]=סמלים -Name[hi]=प्रतीक -Name[hne]=चिनहा -Name[hr]=Ikone -Name[hsb]=Piktogramy -Name[hu]=Ikonok -Name[ia]=Icones -Name[id]=Ikon -Name[is]=Táknmyndir -Name[it]=Icone -Name[ja]=アイコン -Name[ka]=ხატულები -Name[kk]=Таңбашалар -Name[km]=រូប​តំណាង -Name[kn]=ಚಿಹ್ನೆಗಳು -Name[ko]=아이콘 -Name[ku]=Îkon -Name[lt]=Ženkliukai -Name[lv]=Ikonas -Name[mai]=प्रतीक -Name[mk]=Икони -Name[ml]=ചിഹ്നങ്ങള്‍ -Name[mr]=चिन्ह -Name[ms]=Ikon -Name[nb]=Ikoner -Name[nds]=Lüttbiller -Name[ne]=प्रतिमा -Name[nl]=Pictogrammen -Name[nn]=Ikon -Name[oc]=Icònas -Name[or]=ଚିତ୍ର ସଂକେତଗୁଡ଼ିକ -Name[pa]=ਆਈਕਾਨ -Name[pl]=Ikony -Name[pt]=Ícones -Name[pt_BR]=Ícones -Name[ro]=Pictograme -Name[ru]=Значки -Name[se]=Govažat -Name[si]=අයිකන -Name[sk]=Ikony -Name[sl]=Ikone -Name[sr]=Иконе -Name[sr@ijekavian]=Иконе -Name[sr@ijekavianlatin]=Ikone -Name[sr@latin]=Ikone -Name[sv]=Ikoner -Name[ta]=சின்னங்கள் -Name[te]=ప్రతిమలు -Name[tg]=Нишонаҳо -Name[th]=ไอคอน -Name[tr]=Simgeler -Name[ug]=سىنبەلگىلەر -Name[uk]=Піктограми -Name[uz]=Nishonchalar -Name[uz@cyrillic]=Нишончалар -Name[vi]=Biểu tượng -Name[wa]=Imådjetes -Name[xh]=Imphawu zemmifanekiso -Name[x-test]=xxIconsxx -Name[zh_CN]=图标 -Name[zh_TW]=圖示 -Icon=view-list-icons -# Dummy -Exec=dolphin - -[Desktop Action compact] -Name=Compact -Name[ar]=مُتضامّ -Name[bg]=Компактно -Name[bs]=Sabij -Name[ca]=Compacte -Name[ca@valencia]=Compacte -Name[cs]=Kompaktní -Name[da]=Kompakt -Name[de]=Kompakt -Name[el]=Σύμπτυξη -Name[en_GB]=Compact -Name[es]=Compacta -Name[et]=Kompaktne -Name[fi]=Tiivis -Name[fr]=Concis -Name[ga]=Dlúth -Name[gl]=Compacto -Name[he]=מרוכז -Name[hu]=Kompakt -Name[ia]=Compacte -Name[id]=Kompak -Name[is]=Þjappað -Name[it]=Compatta -Name[kk]=Ықшамды -Name[km]=តូច​ល្មម -Name[ko]=축소됨 -Name[lt]=Kompaktiškas -Name[lv]=Kompakts -Name[mr]=संक्षिप्त -Name[nb]=Kompakt -Name[nds]=Drang -Name[nl]=Compact -Name[pa]=ਸੰਖੇਪ -Name[pl]=Kompaktowo -Name[pt]=Compacto -Name[pt_BR]=Compacto -Name[ro]=Compact -Name[ru]=Столбцы -Name[sk]=Kompaktný -Name[sl]=Strnjeno -Name[sr]=Сажето -Name[sr@ijekavian]=Сажето -Name[sr@ijekavianlatin]=Sažeto -Name[sr@latin]=Sažeto -Name[sv]=Kompakt -Name[tr]=Sıkışık -Name[ug]=ئىخچام -Name[uk]=Компактний -Name[wa]=Rastrindou -Name[x-test]=xxCompactxx -Name[zh_CN]=简洁视图 -Name[zh_TW]=簡潔模式 -Icon=view-list-details -# Dummy -Exec=dolphin - -[Desktop Action details] -Name=Details -Name[af]=Besonderhede -Name[ar]=تفاصيل -Name[as]=বিৱৰণ -Name[ast]=Detalles -Name[be@latin]=Detali -Name[bg]=Подробности -Name[bn]=বিস্তারিত -Name[bn_IN]=বিবরণ -Name[bs]=Detalji -Name[ca]=Detalls -Name[ca@valencia]=Detalls -Name[cs]=Podrobnosti -Name[csb]=Detale -Name[da]=Detaljer -Name[de]=Details -Name[el]=Λεπτομέρειες -Name[en_GB]=Details -Name[eo]=Detaloj -Name[es]=Detalles -Name[et]=Üksikasjad -Name[eu]=Xehetasunak -Name[fi]=Yksityiskohdat -Name[fr]=Détails -Name[fy]=Details -Name[ga]=Mionsonraí -Name[gl]=Detalles -Name[gu]=વિગતો -Name[he]=פרטים -Name[hi]=विवरण -Name[hne]=विवरन -Name[hr]=Detalji -Name[hsb]=Nadrobnosće -Name[hu]=Részletek -Name[ia]=Detalios -Name[id]=Detail -Name[is]=Smáatriði -Name[it]=Dettagli -Name[ja]=詳細 -Name[ka]=დეტალები -Name[kk]=Егжей-тегжейі -Name[km]=សេចក្ដី​លម្អិត -Name[kn]=ವಿವರಗಳು -Name[ko]=자세히 -Name[ku]=Kitekit -Name[lt]=Detalės -Name[lv]=Detaļas -Name[mai]=विवरण -Name[mk]=Детали -Name[ml]=വിശദവിവരങ്ങള്‍ -Name[mr]=तपशील -Name[ms]=Perincian -Name[nb]=Detaljer -Name[nds]=Enkelheiten -Name[nl]=Details -Name[nn]=Detaljar -Name[oc]=Detalhs -Name[or]=ବିସ୍ତୃତ ବିବରଣୀ -Name[pa]=ਵੇਰਵਾ -Name[pl]=Szczegóły -Name[pt]=Detalhes -Name[pt_BR]=Detalhes -Name[ro]=Detalii -Name[ru]=Таблица -Name[si]=විස්තර -Name[sk]=Podrobnosti -Name[sl]=Podrobnosti -Name[sr]=Детаљи -Name[sr@ijekavian]=Детаљи -Name[sr@ijekavianlatin]=Detalji -Name[sr@latin]=Detalji -Name[sv]=Detaljinformation -Name[ta]=விவரங்கள் -Name[te]=వివరాలు -Name[tg]=Тафсилотҳо -Name[th]=รายละเอียด -Name[tr]=Ayrıntılar -Name[ug]=تەپسىلاتلار -Name[uk]=Подробиці -Name[uz]=Tafsilotlar -Name[uz@cyrillic]=Тафсилотлар -Name[wa]=Detays -Name[x-test]=xxDetailsxx -Name[zh_CN]=细节 -Name[zh_TW]=詳細模式 -Icon=view-list-tree -# Dummy -Exec=dolphin diff --git a/dolphin/src/dolphinpart.h b/dolphin/src/dolphinpart.h deleted file mode 100644 index c5a9fa0a..00000000 --- a/dolphin/src/dolphinpart.h +++ /dev/null @@ -1,253 +0,0 @@ -/* This file is part of the KDE project - Copyright (c) 2007 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef DOLPHINPART_H -#define DOLPHINPART_H - -#include - -#include - -class DolphinNewFileMenu; -class DolphinViewActionHandler; -#include -class KAction; -class KFileItemList; -class KFileItem; -class DolphinPartBrowserExtension; -class DolphinSortFilterProxyModel; -class DolphinRemoteEncoding; -class DolphinModel; -class KDirLister; -class DolphinView; -class KAboutData; -class DolphinRemoveAction; - -class DolphinPart : public KParts::ReadOnlyPart -{ - Q_OBJECT - // Used by konqueror. Technically it means "we want undo enabled if - // there are things in the undo history and the current part is a dolphin part". - // Even though it's konqueror doing the undo... - Q_PROPERTY( bool supportsUndo READ supportsUndo ) - - Q_PROPERTY( QString currentViewMode READ currentViewMode WRITE setCurrentViewMode ) - - // Used by konqueror when typing something like /home/dfaure/*.diff in the location bar - Q_PROPERTY( QString nameFilter READ nameFilter WRITE setNameFilter ) - - // Used by konqueror to implement the --select command-line option - Q_PROPERTY( KUrl::List filesToSelect READ filesToSelect WRITE setFilesToSelect ) - -public: - explicit DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args); - ~DolphinPart(); - - static KAboutData* createAboutData(); - - /** - * Standard KParts::ReadOnlyPart openUrl method. - * Called by Konqueror to view a directory in DolphinPart. - */ - virtual bool openUrl(const KUrl& url); - - /// see the supportsUndo property - bool supportsUndo() const { return true; } - - /** - * Used by konqueror for setting the view mode - * @param viewModeName internal name for the view mode, like "icons" - * Those names come from the Actions line in dolphinpart.desktop, - * and have to match the name of the KActions. - */ - void setCurrentViewMode(const QString& viewModeName); - - /** - * Used by konqueror for displaying the current view mode. - * @see setCurrentViewMode - */ - QString currentViewMode() const; - - /// Returns the view owned by this part; used by DolphinPartBrowserExtension - DolphinView* view() { return m_view; } - - /** - * Sets a name filter, like *.diff - */ - void setNameFilter(const QString& nameFilter); - - /** - * Returns the current name filter. Used by konqueror to show it in the URL. - */ - QString nameFilter() const { return m_nameFilter; } - -protected: - /** - * We reimplement openUrl so no need to implement openFile. - */ - virtual bool openFile() { return true; } - -Q_SIGNALS: - /** - * Emitted when the view mode changes. Used by konqueror. - */ - void viewModeChanged(); - - - /** - * Emitted whenever the current URL is about to be changed. - */ - void aboutToOpenURL(); - -private Q_SLOTS: - void slotMessage(const QString& msg); - void slotErrorMessage(const QString& msg); - /** - * Shows the information for the item \a item inside the statusbar. If the - * item is null, the default statusbar information is shown. - */ - void slotRequestItemInfo(const KFileItem& item); - /** - * Handles clicking on an item - */ - void slotItemActivated(const KFileItem& item); - /** - * Handles activation of multiple items - */ - void slotItemsActivated(const KFileItemList& items); - /** - * Creates a new window showing the content of \a url. - */ - void createNewWindow(const KUrl& url); - /** - * Opens the context menu on the current mouse position. - * @pos Position in screen coordinates. - * @item File item context. If item is null, the context menu - * should be applied to \a url. - * @url URL which contains \a item. - * @customActions Actions that should be added to the context menu, - * if the file item is null. - */ - void slotOpenContextMenu(const QPoint& pos, - const KFileItem& item, - const KUrl& url, - const QList& customActions); - - /** - * Informs the host that we are opening \a url (e.g. after a redirection - * coming from KDirLister). - * Testcase 1: fish://localhost - * Testcase 2: showing a directory that is being renamed by another window (#180156) - */ - void slotDirectoryRedirection(const KUrl& oldUrl, const KUrl& newUrl); - - /** - * Updates the state of the 'Edit' menu actions and emits - * the signal selectionChanged(). - */ - void slotSelectionChanged(const KFileItemList& selection); - - /** - * Updates the text of the paste action dependent from - * the number of items which are in the clipboard. - */ - void updatePasteAction(); - - /** - * Connected to all "Go" menu actions provided by DolphinPart - */ - void slotGoTriggered(QAction* action); - - /** - * Connected to the "editMimeType" action - */ - void slotEditMimeType(); - - /** - * Connected to the "select_items_matching" action. - * Opens a dialog which permits to select all items matching a pattern like "*.jpg". - */ - void slotSelectItemsMatchingPattern(); - - /** - * Connected to the "unselect_items_matching" action. - * Opens a dialog which permits to unselect all items matching a pattern like "*.jpg". - */ - void slotUnselectItemsMatchingPattern(); - - /** - * Open a terminal window, starting with the current directory. - */ - void slotOpenTerminal(); - - /** - * Open KFind with the current path. - */ - void slotFindFile(); - - /** - * Updates the 'Create New...' sub menu, just before it's shown. - */ - void updateNewMenu(); - - /** - * Updates the number of items (= number of files + number of - * directories) in the statusbar. If files are selected, the number - * of selected files and the sum of the filesize is shown. - */ - void updateStatusBar(); - - /** - * Notify container of folder loading progress. - */ - void updateProgress(int percent); - - void createDirectory(); - - /** - * Called by konqueror --select - */ - void setFilesToSelect(const KUrl::List& files); - KUrl::List filesToSelect() const { return KUrl::List(); } // silence moc - - virtual bool eventFilter(QObject*, QEvent*); - -private: - void createActions(); - void createGoAction(const char* name, const char* iconName, - const QString& text, const QString& url, - QActionGroup* actionGroup); - - void openSelectionDialog(const QString& title, const QString& text, - bool selectItems); - -private: - DolphinView* m_view; - DolphinViewActionHandler* m_actionHandler; - DolphinRemoteEncoding* m_remoteEncoding; - DolphinPartBrowserExtension* m_extension; - DolphinNewFileMenu* m_newFileMenu; - KAction* m_findFileAction; - KAction* m_openTerminalAction; - QString m_nameFilter; - DolphinRemoveAction* m_removeAction; - Q_DISABLE_COPY(DolphinPart) -}; - -#endif /* DOLPHINPART_H */ diff --git a/dolphin/src/dolphinpart.rc b/dolphin/src/dolphinpart.rc deleted file mode 100644 index d24c7405..00000000 --- a/dolphin/src/dolphinpart.rc +++ /dev/null @@ -1,65 +0,0 @@ - - - - &Edit - - - - - - - - - - Selection - - - - - - - - - &View - - - - - - - - - &Go - - - - - - - - Tools - - - - - - -Dolphin Toolbar - - - - - - - - - - - - - - - - - - diff --git a/dolphin/src/dolphinpart_ext.cpp b/dolphin/src/dolphinpart_ext.cpp deleted file mode 100644 index 45e4c03b..00000000 --- a/dolphin/src/dolphinpart_ext.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE project - * Copyright (c) 2012 Dawit Alemayehu - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "dolphinpart_ext.h" - -#include "dolphinpart.h" -#include "views/dolphinview.h" - -#include - -#include - - -DolphinPartBrowserExtension::DolphinPartBrowserExtension(DolphinPart* part) - :KParts::BrowserExtension( part ) - ,m_part(part) -{ - -} - -void DolphinPartBrowserExtension::restoreState(QDataStream &stream) -{ - KParts::BrowserExtension::restoreState(stream); - m_part->view()->restoreState(stream); -} - -void DolphinPartBrowserExtension::saveState(QDataStream &stream) -{ - KParts::BrowserExtension::saveState(stream); - m_part->view()->saveState(stream); -} - -void DolphinPartBrowserExtension::cut() -{ - m_part->view()->cutSelectedItems(); -} - -void DolphinPartBrowserExtension::copy() -{ - m_part->view()->copySelectedItems(); -} - -void DolphinPartBrowserExtension::paste() -{ - m_part->view()->paste(); -} - -void DolphinPartBrowserExtension::pasteTo(const KUrl&) -{ - m_part->view()->pasteIntoFolder(); -} - -void DolphinPartBrowserExtension::reparseConfiguration() -{ - m_part->view()->readSettings(); -} - -#include "moc_dolphinpart_ext.cpp" diff --git a/dolphin/src/dolphinpart_ext.h b/dolphin/src/dolphinpart_ext.h deleted file mode 100644 index 0074ee5f..00000000 --- a/dolphin/src/dolphinpart_ext.h +++ /dev/null @@ -1,46 +0,0 @@ -/* This file is part of the KDE project - * Copyright (c) 2012 Dawit Alemayehu - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef DOLPHINPART_EXT_H -#define DOLPHINPART_EXT_H - -#include - -class DolphinPart; - -class DolphinPartBrowserExtension : public KParts::BrowserExtension -{ - Q_OBJECT -public: - DolphinPartBrowserExtension( DolphinPart* part ); - virtual void restoreState(QDataStream &stream); - virtual void saveState(QDataStream &stream); - -public Q_SLOTS: - void cut(); - void copy(); - void paste(); - void pasteTo(const KUrl&); - void reparseConfiguration(); - -private: - DolphinPart* m_part; -}; - -#endif diff --git a/dolphin/src/views/dolphinview.h b/dolphin/src/views/dolphinview.h index 592af8ce..eed3d08e 100644 --- a/dolphin/src/views/dolphinview.h +++ b/dolphin/src/views/dolphinview.h @@ -23,7 +23,6 @@ #include "dolphinprivate_export.h" -#include #include #include #include @@ -773,7 +772,6 @@ private: // For unit tests friend class TestBase; friend class DolphinDetailsViewTest; - friend class DolphinPart; // Accesses m_model }; /// Allow using DolphinView::Mode in QVariant diff --git a/dolphin/src/views/dolphinviewactionhandler.cpp b/dolphin/src/views/dolphinviewactionhandler.cpp index bc2727fe..93da4848 100644 --- a/dolphin/src/views/dolphinviewactionhandler.cpp +++ b/dolphin/src/views/dolphinviewactionhandler.cpp @@ -25,6 +25,7 @@ #include "views/zoomlevelinfo.h" #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include #include - #include diff --git a/kate/part/CMakeLists.txt b/kate/part/CMakeLists.txt index 26331ebf..7f1e5b7a 100644 --- a/kate/part/CMakeLists.txt +++ b/kate/part/CMakeLists.txt @@ -61,7 +61,6 @@ set(katepart_PART_SRCS # document (THE document, buffer, lines/cursors/..., CORE STUFF) document/katedocument.cpp - document/katedocumenthelpers.cpp document/katebuffer.cpp # undo diff --git a/kate/part/document/katedocument.cpp b/kate/part/document/katedocument.cpp index 4d75ba01..cbab29d3 100644 --- a/kate/part/document/katedocument.cpp +++ b/kate/part/document/katedocument.cpp @@ -32,7 +32,6 @@ #include "kateview.h" #include "kateautoindent.h" #include "katetextline.h" -#include "katedocumenthelpers.h" #include "katehighlighthelpers.h" #include "kateprinter.h" #include "katerenderer.h" @@ -105,17 +104,16 @@ inline bool isBracket ( const QChar& c ) { return isStartBracket( c ) || isE // KateDocument Constructor // KateDocument::KateDocument ( QWidget *parentWidget, QObject *parent, const QVariantList &args) -: KateDocument (true, false, true, parentWidget, parent) +: KateDocument (true, true, parentWidget, parent) { Q_UNUSED(args); } -KateDocument::KateDocument ( bool bSingleViewMode, bool bBrowserView, +KateDocument::KateDocument ( bool bSingleViewMode, bool bReadOnly, QWidget *parentWidget, QObject *parent) : KTextEditor::Document (parent), m_bSingleViewMode(bSingleViewMode), - m_bBrowserView(bBrowserView), m_bReadOnly(bReadOnly), m_activeView(0), editSessionNumber(0), @@ -167,8 +165,6 @@ KateDocument::KateDocument ( bool bSingleViewMode, bool bBrowserView, // swap file m_swapfile = new Kate::SwapFile(this); - new KateBrowserExtension( this ); // deleted by QObject memory management - // important, fill in the config into the indenter we use... m_indenter->updateConfig (); diff --git a/kate/part/document/katedocument.h b/kate/part/document/katedocument.h index 54438286..a872c40b 100644 --- a/kate/part/document/katedocument.h +++ b/kate/part/document/katedocument.h @@ -104,8 +104,8 @@ class KATEPARTINTERFACES_EXPORT KateDocument : public KTextEditor::Document, public: explicit KateDocument (QWidget *parentWidget, QObject *, const QVariantList &args); - explicit KateDocument (bool bSingleViewMode=false, bool bBrowserView=false, bool bReadOnly=false, - QWidget *parentWidget = 0, QObject * = 0); + explicit KateDocument (bool bSingleViewMode=false, bool bReadOnly=false, + QWidget *parentWidget = 0, QObject * = 0); ~KateDocument (); using ReadWritePart::closeUrl; @@ -129,21 +129,17 @@ class KATEPARTINTERFACES_EXPORT KateDocument : public KTextEditor::Document, virtual QWidget *widget(); Q_SIGNALS: -// TODO for KDE5: move to KTE::Document + // TODO for KDE5: move to KTE::Document void readWriteChanged (KTextEditor::Document *document); - - public: bool readOnly () const { return m_bReadOnly; } - bool browserView () const { return m_bBrowserView; } bool singleViewMode () const { return m_bSingleViewMode; } static bool simpleMode (); private: // only to make part work, don't change it ! const bool m_bSingleViewMode; - const bool m_bBrowserView; const bool m_bReadOnly; // diff --git a/kate/part/document/katedocumenthelpers.cpp b/kate/part/document/katedocumenthelpers.cpp deleted file mode 100644 index f13b5385..00000000 --- a/kate/part/document/katedocumenthelpers.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* This file is part of the KDE libraries and the Kate part. - * - * Copyright (C) 2001-2010 Christoph Cullmann - * Copyright (C) 2001 Joseph Wenninger - * Copyright (C) 1999 Jochen Wilhelmy - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "katedocumenthelpers.h" -#include "moc_katedocumenthelpers.cpp" - -#include "katedocument.h" -#include "kateview.h" - -#include -#include - -namespace KTextEditor { class View; } - -KateBrowserExtension::KateBrowserExtension( KateDocument* doc ) -: KParts::BrowserExtension( doc ), - m_doc (doc) -{ - setObjectName( "katepartbrowserextension" ); - emit enableAction( "print", true ); -} - -void KateBrowserExtension::print() -{ - m_doc->printDialog(); -} - -// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kate/part/document/katedocumenthelpers.h b/kate/part/document/katedocumenthelpers.h deleted file mode 100644 index b0311319..00000000 --- a/kate/part/document/katedocumenthelpers.h +++ /dev/null @@ -1,61 +0,0 @@ -/* This file is part of the KDE libraries and the Kate part. - * - * Copyright (C) 2001-2010 Christoph Cullmann - * Copyright (C) 2001 Joseph Wenninger - * Copyright (C) 1999 Jochen Wilhelmy - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __KATE_DOCUMENT_HELPERS__ -#define __KATE_DOCUMENT_HELPERS__ - -#include - -#include -#include - -class KateDocument; - -/** - * Interface for embedding KateDocument into a browser - */ -class KateBrowserExtension : public KParts::BrowserExtension -{ - Q_OBJECT - - public: - /** - * Constructor - * @param doc parent document - */ - explicit KateBrowserExtension( KateDocument* doc ); - - public Q_SLOTS: - /** - * print the current file - */ - void print(); - - private: - /** - * parent document - */ - KateDocument* m_doc; -}; - -#endif - diff --git a/kate/part/syntax/data/css-php.xml b/kate/part/syntax/data/css-php.xml deleted file mode 100644 index 6a8bf4d7..00000000 --- a/kate/part/syntax/data/css-php.xml +++ /dev/null @@ -1,955 +0,0 @@ - - - - -]> - - - - - - - - - - - - - diff --git a/kate/part/syntax/data/html-php.xml b/kate/part/syntax/data/html-php.xml deleted file mode 100644 index 01029741..00000000 --- a/kate/part/syntax/data/html-php.xml +++ /dev/null @@ -1,265 +0,0 @@ - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kate/part/syntax/data/javascript-php.xml b/kate/part/syntax/data/javascript-php.xml deleted file mode 100644 index cd20480e..00000000 --- a/kate/part/syntax/data/javascript-php.xml +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/kate/part/utils/katefactory.cpp b/kate/part/utils/katefactory.cpp index 089f391c..2c19ea52 100644 --- a/kate/part/utils/katefactory.cpp +++ b/kate/part/utils/katefactory.cpp @@ -65,18 +65,15 @@ class KateFactory : public KTextEditor::Factory QByteArray classname( _classname ); // default to the kparts::* behavior of having one single widget() if the user don't requested a pure document - bool bWantSingleView = ( classname != "KTextEditor::Document" ); + bool bWantSingleView = (classname != "KTextEditor::Document"); - // does user want browserview? not konqueror - bool bWantBrowserView = false; - - // should we be readonly? - bool bWantReadOnly = (bWantBrowserView || ( classname == "KParts::ReadOnlyPart" )); + // should be readonly? + bool bWantReadOnly = (classname == "KParts::ReadOnlyPart"); // set simple mode on for read-only part per default KateGlobal::self ()->setSimpleMode (bWantReadOnly); - KParts::ReadWritePart *part = new KateDocument (bWantSingleView, bWantBrowserView, bWantReadOnly, parentWidget, parent); + KParts::ReadWritePart *part = new KateDocument (bWantSingleView, bWantReadOnly, parentWidget, parent); part->setReadWrite( !bWantReadOnly ); return part; diff --git a/kate/part/utils/kateglobal.cpp b/kate/part/utils/kateglobal.cpp index 8384562c..0287c4a8 100644 --- a/kate/part/utils/kateglobal.cpp +++ b/kate/part/utils/kateglobal.cpp @@ -221,7 +221,7 @@ KateGlobal::~KateGlobal() KTextEditor::Document *KateGlobal::createDocument ( QObject *parent ) { - KateDocument *doc = new KateDocument (false, false, false, 0, parent); + KateDocument *doc = new KateDocument (false, false, 0, parent); emit documentCreated (this, doc); diff --git a/kate/part/view/kateview.cpp b/kate/part/view/kateview.cpp index e88da2ca..96fe5ccf 100644 --- a/kate/part/view/kateview.cpp +++ b/kate/part/view/kateview.cpp @@ -31,7 +31,6 @@ #include "katerenderer.h" #include "katedocument.h" #include "kateundomanager.h" -#include "katedocumenthelpers.h" #include "kateglobal.h" #include "katehighlight.h" #include "katehighlightmenu.h" @@ -330,12 +329,6 @@ void KateView::setupConnections() connect( m_doc, SIGNAL(annotationModelChanged(KTextEditor::AnnotationModel*,KTextEditor::AnnotationModel*)), m_viewInternal->m_leftBorder, SLOT(annotationModelChanged(KTextEditor::AnnotationModel*,KTextEditor::AnnotationModel*)) ); - - if ( m_doc->browserView() ) - { - connect( this, SIGNAL(dropEventPass(QDropEvent*)), - this, SLOT(slotDropEventPass(QDropEvent*)) ); - } } void KateView::setupActions() @@ -902,7 +895,7 @@ void KateView::setupEditActions() m_editActions << a; - // anders: shortcuts doing any changes should not be created in browserextension + // anders: shortcuts doing any changes should not be created in part if ( !m_doc->readOnly() ) { a = ac->addAction("transpose_char"); @@ -1194,26 +1187,6 @@ void KateView::slotUpdateUndo() m_editRedo->setEnabled(m_doc->isReadWrite() && m_doc->redoCount() > 0); } -void KateView::slotDropEventPass( QDropEvent * ev ) -{ - const KUrl::List lstDragURLs=KUrl::List::fromMimeData(ev->mimeData()); - bool ok = !lstDragURLs.isEmpty(); - - KParts::BrowserExtension * ext = KParts::BrowserExtension::childObject( doc() ); - if ( ok && ext ) - emit ext->openUrlRequest( lstDragURLs.first() ); -} - -void KateView::contextMenuEvent( QContextMenuEvent *ev ) -{ - if ( !m_doc || !m_doc->browserExtension() ) - return; - KParts::OpenUrlArguments args; - args.setMimeType( QLatin1String("text/plain") ); - emit m_doc->browserExtension()->popupMenu( ev->globalPos(), m_doc->url(), S_IFREG, args ); - ev->accept(); -} - bool KateView::setCursorPositionInternal( const KTextEditor::Cursor& position, uint tabwidth, bool calledExternally ) { Kate::TextLine l = m_doc->kateTextLine( position.line() ); diff --git a/kate/part/view/kateview.h b/kate/part/view/kateview.h index aecc5c99..de525c3c 100644 --- a/kate/part/view/kateview.h +++ b/kate/part/view/kateview.h @@ -567,13 +567,9 @@ class KATEPARTINTERFACES_EXPORT KateView : public KTextEditor::View, public: void slotTextInserted ( KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text); - protected: - void contextMenuEvent( QContextMenuEvent* ); - private Q_SLOTS: void slotGotFocus(); void slotLostFocus(); - void slotDropEventPass( QDropEvent* ev ); void slotSaveCanceled( const QString& error ); void slotConfigDialog (); diff --git a/kate/part/view/kateviewinternal.cpp b/kate/part/view/kateviewinternal.cpp index 88bcb908..bec983a9 100644 --- a/kate/part/view/kateviewinternal.cpp +++ b/kate/part/view/kateviewinternal.cpp @@ -2423,12 +2423,6 @@ void KateViewInternal::contextMenuEvent ( QContextMenuEvent * e ) QPoint p = e->pos(); - if ( doc()->browserView() ) - { - m_view->contextMenuEvent( e ); - return; - } - if ( e->reason() == QContextMenuEvent::Keyboard ) { makeVisible( m_displayCursor, 0 ); diff --git a/keditbookmarks/faviconupdater.cpp b/keditbookmarks/faviconupdater.cpp index 04017ce5..7559e0f3 100644 --- a/keditbookmarks/faviconupdater.cpp +++ b/keditbookmarks/faviconupdater.cpp @@ -31,7 +31,6 @@ #include #include -#include #include FavIconUpdater::FavIconUpdater(QObject *parent) diff --git a/kfind/kfindtreeview.cpp b/kfind/kfindtreeview.cpp index f5ac1bb3..0ea21f3d 100644 --- a/kfind/kfindtreeview.cpp +++ b/kfind/kfindtreeview.cpp @@ -577,7 +577,7 @@ void KFindTreeView::contextMenuRequested( const QPoint & p) } } - KParts::BrowserExtension::PopupFlags flags = KParts::BrowserExtension::ShowProperties; // | KParts::BrowserExtension::ShowUrlOperations; + KonqPopupMenu::PopupFlags flags = KonqPopupMenu::ShowProperties; // | KonqPopupMenu::ShowUrlOperations; QList editActions; editActions.append(m_actionCollection->action("file_open")); @@ -586,7 +586,7 @@ void KFindTreeView::contextMenuRequested( const QPoint & p) editActions.append(m_actionCollection->action("del")); editActions.append(m_actionCollection->action("trash")); - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("editactions", editActions); if( m_contextMenu ) @@ -595,7 +595,7 @@ void KFindTreeView::contextMenuRequested( const QPoint & p) delete m_contextMenu; m_contextMenu = 0; } - m_contextMenu = new KonqPopupMenu( fileList, KUrl(), *m_actionCollection, new KNewFileMenu( m_actionCollection, "new_menu", this), 0, flags, this, 0, actionGroups); + m_contextMenu = new KonqPopupMenu( fileList, KUrl(), *m_actionCollection, new KNewFileMenu( m_actionCollection, "new_menu", this), flags, this, 0, actionGroups); m_contextMenu->exec( this->mapToGlobal( p ) ); } diff --git a/libs/konq/konq_popupmenu.cpp b/libs/konq/konq_popupmenu.cpp index 710bc642..eada1034 100644 --- a/libs/konq/konq_popupmenu.cpp +++ b/libs/konq/konq_popupmenu.cpp @@ -75,10 +75,10 @@ public: KonqPopupMenuPrivate(KonqPopupMenu* qq, KActionCollection & actions, QWidget* parentWidget) : q(qq), m_parentWidget(parentWidget), - m_itemFlags(KParts::BrowserExtension::DefaultPopupItems), - m_pMenuNew(0), + m_itemFlags(KonqPopupMenu::DefaultPopupItems), + m_pMenuNew(0), m_copyToMenu(parentWidget), - m_bookmarkManager(0), + m_bookmarkManager(0), m_actions(actions), m_ownActionCollection(static_cast(0)) { @@ -92,7 +92,7 @@ public: void addNamedAction(const QString& name); void addGroup(const QString& name); void addPlugins(); - void init(KonqPopupMenu::Flags kpf, KParts::BrowserExtension::PopupFlags itemFlags); + void init(KonqPopupMenu::PopupFlags flags); void slotPopupNewDir(); void slotPopupNewView(); @@ -108,7 +108,7 @@ public: KonqPopupMenu* q; QWidget* m_parentWidget; QString m_urlTitle; - KParts::BrowserExtension::PopupFlags m_itemFlags; + KonqPopupMenu::PopupFlags m_itemFlags; KNewFileMenu *m_pMenuNew; KUrl m_sViewURL; KFileItemListProperties m_popupItemProperties; @@ -118,20 +118,19 @@ public: KActionCollection &m_actions; KActionCollection m_ownActionCollection; // only used by plugins; KDE5: pass m_ownActions instead QList m_ownActions; - KParts::BrowserExtension::ActionGroupMap m_actionGroups; + KonqPopupMenu::ActionGroupMap m_actionGroups; }; ////////////////// KonqPopupMenu::KonqPopupMenu(const KFileItemList &items, const KUrl& viewURL, - KActionCollection & actions, - KNewFileMenu * newMenu, - Flags kpf, - KParts::BrowserExtension::PopupFlags flags, - QWidget * parentWidget, + KActionCollection &actions, + KNewFileMenu *newMenu, + KonqPopupMenu::PopupFlags flags, + QWidget *parentWidget, KBookmarkManager *mgr, - const KParts::BrowserExtension::ActionGroupMap& actionGroups) + const KonqPopupMenu::ActionGroupMap &actionGroups) : KMenu(parentWidget), d(new KonqPopupMenuPrivate(this, actions, parentWidget)) { @@ -141,7 +140,7 @@ KonqPopupMenu::KonqPopupMenu(const KFileItemList &items, d->m_bookmarkManager = mgr; d->m_popupItemProperties.setItems(items); d->m_menuActions.setParentWidget(parentWidget); - d->init(kpf, flags); + d->init(flags); KAcceleratorManager::manage(this); } @@ -153,7 +152,7 @@ void KonqPopupMenuPrivate::addNamedAction(const QString& name) q->addAction(act); } -void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtension::PopupFlags flags) +void KonqPopupMenuPrivate::init(KonqPopupMenu::PopupFlags flags) { m_itemFlags = flags; q->setFont(KGlobalSettings::menuFont()); @@ -176,7 +175,7 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi const bool isDirectory = m_popupItemProperties.isDirectory(); const bool sReading = m_popupItemProperties.supportsReading(); - bool sDeleting = (m_itemFlags & KParts::BrowserExtension::NoDeletion) == 0 + bool sDeleting = (m_itemFlags & KonqPopupMenu::NoDeletion) == 0 && m_popupItemProperties.supportsDeleting(); const bool sWriting = m_popupItemProperties.supportsWriting(); const bool sMoving = sDeleting && m_popupItemProperties.supportsMoving(); @@ -221,7 +220,7 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi const bool isIntoTrash = (url.protocol() == "trash") && !isCurrentTrash; // trashed file, not trash:/ itself - const bool bIsLink = (m_itemFlags & KParts::BrowserExtension::IsLink); + const bool bIsLink = (m_itemFlags & KonqPopupMenu::IsLink); //kDebug() << "isLocal=" << isLocal << " url=" << url << " isCurrentTrash=" << isCurrentTrash << " isIntoTrash=" << isIntoTrash << " bTrashIncluded=" << bTrashIncluded; @@ -236,7 +235,7 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi // Either 'newview' is in the actions we're given (probably in the tabhandling group) // or we need to insert it ourselves (e.g. for the desktop). // In the first case, actNewWindow must remain 0. - if ( ((kpf & KonqPopupMenu::ShowNewWindow) != 0) && sReading ) + if ( (m_itemFlags & KonqPopupMenu::ShowNewWindow) && sReading ) { const QString openStr = i18n("&Open"); actNewWindow = new KAction(m_parentWidget /*for status tips*/); @@ -248,7 +247,7 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi if ( isDirectory && sWriting && !isCurrentTrash ) // A dir, and we can create things into it { - const bool mkdirRequested = m_itemFlags & KParts::BrowserExtension::ShowCreateDirectory; + const bool mkdirRequested = m_itemFlags & KonqPopupMenu::ShowCreateDirectory; if ( (currentDir || mkdirRequested) && m_pMenuNew ) // Current dir -> add the "new" menu { // As requested by KNewFileMenu : @@ -278,13 +277,13 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi q->addAction(act); } - if (m_itemFlags & KParts::BrowserExtension::ShowNavigationItems) + if (m_itemFlags & KonqPopupMenu::ShowNavigationItems) { - if (m_itemFlags & KParts::BrowserExtension::ShowUp) + if (m_itemFlags & KonqPopupMenu::ShowUp) addNamedAction( "go_up" ); addNamedAction( "go_back" ); addNamedAction( "go_forward" ); - if (m_itemFlags & KParts::BrowserExtension::ShowReload) + if (m_itemFlags & KonqPopupMenu::ShowReload) addNamedAction( "reload" ); q->addSeparator(); } @@ -306,7 +305,7 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi } addGroup( "tabhandling" ); // includes a separator at the end - if (m_itemFlags & KParts::BrowserExtension::ShowUrlOperations) { + if (m_itemFlags & KonqPopupMenu::ShowUrlOperations) { if ( !currentDir && sReading ) { if ( sDeleting ) { addNamedAction( "cut" ); @@ -346,7 +345,7 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi // and by DolphinPart (rename, trash, delete) addGroup( "editactions" ); - if (m_itemFlags & KParts::BrowserExtension::ShowTextSelectionItems) { + if (m_itemFlags & KonqPopupMenu::ShowTextSelectionItems) { // OK, we have to stop here. // Anything else that is provided by the part @@ -354,7 +353,7 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi return; } - if ( !isCurrentTrash && !isIntoTrash && (m_itemFlags & KParts::BrowserExtension::ShowBookmark)) + if ( !isCurrentTrash && !isIntoTrash && (m_itemFlags & KonqPopupMenu::ShowBookmark)) { QString caption; if (currentDir) @@ -414,7 +413,7 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi KSharedConfig::Ptr dolphin = KSharedConfig::openConfig("dolphinrc"); // CopyTo/MoveTo menus - if (m_itemFlags & KParts::BrowserExtension::ShowUrlOperations && + if (m_itemFlags & KonqPopupMenu::ShowUrlOperations && KConfigGroup(dolphin, "General").readEntry("ShowCopyMoveMenu", false)) { m_copyToMenu.setItems(lstItems); @@ -424,11 +423,11 @@ void KonqPopupMenuPrivate::init(KonqPopupMenu::Flags kpf, KParts::BrowserExtensi } if (!isCurrentTrash && !isIntoTrash && sReading && - (kpf & KonqPopupMenu::NoPlugins) == 0) { + !(m_itemFlags & KonqPopupMenu::NoPlugins)) { addPlugins(); // now it's time to add plugins } - if ( (m_itemFlags & KParts::BrowserExtension::ShowProperties) && KPropertiesDialog::canDisplay( lstItems ) ) { + if ( (m_itemFlags & KonqPopupMenu::ShowProperties) && KPropertiesDialog::canDisplay( lstItems ) ) { act = new KAction(m_parentWidget); m_ownActions.append(act); act->setObjectName( QLatin1String("properties" )); // for unittest diff --git a/libs/konq/konq_popupmenu.h b/libs/konq/konq_popupmenu.h index 8d4ed84e..8480d507 100644 --- a/libs/konq/konq_popupmenu.h +++ b/libs/konq/konq_popupmenu.h @@ -21,22 +21,17 @@ #ifndef KONQPOPUPMENU_H #define KONQPOPUPMENU_H -#include +#include -#include - -#include +#include +#include #include #include #include -#include #include -#include - class KNewFileMenu; class KFileItemActions; - class KBookmarkManager; class KonqPopupMenuPrivate; @@ -51,73 +46,89 @@ class KONQ_EXPORT KonqPopupMenu : public KMenu { Q_OBJECT public: + /** + * Flags set by the calling application + */ + enum PopupFlag { + DefaultPopupItems = 0x0000, /**< default value, no additional menu item */ + ShowNavigationItems = 0x0001, /**< show "back" and "forward" (usually done when clicking the background of the view, but not an item) */ + ShowUp = 0x0002, /**< show "up" (same thing, but not over e.g. HTTP). Requires ShowNavigationItems. */ + ShowReload = 0x0004, /**< show "reload" (usually done when clicking the background of the view, but not an item) */ + ShowBookmark = 0x0008, /**< show "add to bookmarks" (usually not done on the local filesystem) */ + ShowCreateDirectory = 0x0010, /**< show "create directory" (usually only done on the background of the view, or + * in hierarchical views like directory trees, where the new dir would be visible) */ + ShowTextSelectionItems=0x0020, /**< set when selecting text, for a popup that only contains text-related items. */ + NoDeletion=0x0040, /**< deletion, trashing and renaming not allowed (e.g. parent dir not writeable). + * (this is only needed if the protocol itself supports deletion, unlike e.g. HTTP) */ + IsLink = 0x0080, /**< show "Bookmark This Link" and other link-related actions (linkactions merging group) */ + ShowUrlOperations = 0x0100, /**< show copy, paste, as well as cut if NoDeletion is not set. */ + ShowProperties = 0x200, /**< show "Properties" action (usually done by directory views) */ + ShowNewWindow = 0x400, + NoPlugins = 0x800 /**< for the unittest*/ + }; + Q_DECLARE_FLAGS(PopupFlags, PopupFlag) - /** - * Flags set by the calling application (e.g. konqueror), unlike - * KParts::BrowserExtension::PopupFlags, which are set by the calling part - */ - typedef uint Flags; - enum { NoFlags = 0, - ShowNewWindow = 1, - NoPlugins = 2 /*for the unittest*/ }; - // WARNING: bitfield. Next item is 4 + /** + * Associates a list of actions with a predefined name known by the host's popupmenu: + * "editactions" for actions related text editing, + * "linkactions" for actions related to hyperlinks, + * "partactions" for any other actions provided by the part + */ + typedef QMap> ActionGroupMap; - /** - * Constructor - * @param manager the bookmark manager for the "add to bookmark" action - * Only used if KParts::BrowserExtension::ShowBookmark is set - * @param items the list of file items the popupmenu should be shown for - * @param viewURL the URL shown in the view, to test for RMB click on view background - * @param actions list of actions the caller wants to see in the menu - * @param newMenu "New" menu, shared with the File menu, in konqueror - * @param parentWidget the widget we're showing this popup for. Helps destroying - * the popup if the widget is destroyed before the popup. - * @param appFlags flags from the KonqPopupMenu::Flags enum, set by the calling application - * @param partFlags flags from the BrowserExtension enum, set by the calling part - * - * The actions to pass in include : - * showmenubar, go_back, go_forward, go_up, cut, copy, paste, pasteto - * The others items are automatically inserted. - * - * @todo that list is probably not be up-to-date - */ - KonqPopupMenu( const KFileItemList &items, - const KUrl& viewURL, - KActionCollection & actions, - KNewFileMenu * newMenu, - Flags appFlags, - KParts::BrowserExtension::PopupFlags partFlags /*= KParts::BrowserExtension::DefaultPopupItems*/, - QWidget * parentWidget, - KBookmarkManager *manager = 0, - const KParts::BrowserExtension::ActionGroupMap& actionGroups = KParts::BrowserExtension::ActionGroupMap() - ); + /** + * Constructor + * @param manager the bookmark manager for the "add to bookmark" action + * Only used if KonqPopupMenu::ShowBookmark is set + * @param items the list of file items the popupmenu should be shown for + * @param viewURL the URL shown in the view, to test for RMB click on view background + * @param actions list of actions the caller wants to see in the menu + * @param newMenu "New" menu, shared with the File menu, in konqueror + * @param parentWidget the widget we're showing this popup for. Helps destroying + * the popup if the widget is destroyed before the popup. + * @param popupFlags flags from the KonqPopupMenu::PopupFlags enum, set by the calling application + * + * The actions to pass in include : + * showmenubar, go_back, go_forward, go_up, cut, copy, paste, pasteto + * The others items are automatically inserted. + * + * @todo that list is probably not be up-to-date + */ + KonqPopupMenu(const KFileItemList &items, + const KUrl& viewURL, + KActionCollection & actions, + KNewFileMenu * newMenu, + PopupFlags popupFlags /*= NoFlags*/, + QWidget *parentWidget, + KBookmarkManager *manager = 0, + const ActionGroupMap& actionGroups = ActionGroupMap()); - /** - * Don't forget to destroy the object - */ - ~KonqPopupMenu(); + /** + * Don't forget to destroy the object + */ + ~KonqPopupMenu(); - /** - * Set the title of the URL, when the popupmenu is opened for a single URL. - * This is used if the user chooses to add a bookmark for this URL. - */ - void setURLTitle( const QString& urlTitle ); - KFileItemActions* fileItemActions() const; + /** + * Set the title of the URL, when the popupmenu is opened for a single URL. + * This is used if the user chooses to add a bookmark for this URL. + */ + void setURLTitle(const QString &urlTitle); + KFileItemActions* fileItemActions() const; private: - Q_PRIVATE_SLOT(d, void slotPopupNewDir()) - Q_PRIVATE_SLOT(d, void slotPopupNewView()) - Q_PRIVATE_SLOT(d, void slotPopupEmptyTrashBin()) - Q_PRIVATE_SLOT(d, void slotConfigTrashBin()) - Q_PRIVATE_SLOT(d, void slotPopupRestoreTrashedItems()) - Q_PRIVATE_SLOT(d, void slotPopupAddToBookmark()) - Q_PRIVATE_SLOT(d, void slotPopupMimeType()) - Q_PRIVATE_SLOT(d, void slotPopupProperties()) - Q_PRIVATE_SLOT(d, void slotOpenShareFileDialog()) - Q_PRIVATE_SLOT(d, void slotShowOriginalFile()) + Q_PRIVATE_SLOT(d, void slotPopupNewDir()) + Q_PRIVATE_SLOT(d, void slotPopupNewView()) + Q_PRIVATE_SLOT(d, void slotPopupEmptyTrashBin()) + Q_PRIVATE_SLOT(d, void slotConfigTrashBin()) + Q_PRIVATE_SLOT(d, void slotPopupRestoreTrashedItems()) + Q_PRIVATE_SLOT(d, void slotPopupAddToBookmark()) + Q_PRIVATE_SLOT(d, void slotPopupMimeType()) + Q_PRIVATE_SLOT(d, void slotPopupProperties()) + Q_PRIVATE_SLOT(d, void slotOpenShareFileDialog()) + Q_PRIVATE_SLOT(d, void slotShowOriginalFile()) private: - KonqPopupMenuPrivate *d; + KonqPopupMenuPrivate *d; }; #endif diff --git a/libs/konq/konq_popupmenuplugin.h b/libs/konq/konq_popupmenuplugin.h index e4a882d8..4a1509eb 100644 --- a/libs/konq/konq_popupmenuplugin.h +++ b/libs/konq/konq_popupmenuplugin.h @@ -22,9 +22,10 @@ #define KONQ_POPUPMENUPLUGIN_H #include "konq_export.h" -#include +#include #include + class KActionCollection; class KonqPopupMenuInformation; diff --git a/libs/konq/konqmimedata.h b/libs/konq/konqmimedata.h index 9a60cc57..d62f2b49 100644 --- a/libs/konq/konqmimedata.h +++ b/libs/konq/konqmimedata.h @@ -21,8 +21,9 @@ #define KONQMIMEDATA_H #include -#include + #include +#include /** * This class provides functions for creating and decoding clipboard/drag-n-drop data diff --git a/libs/konq/tests/konqpopupmenutest.cpp b/libs/konq/tests/konqpopupmenutest.cpp index ee6f267c..d882d518 100644 --- a/libs/konq/tests/konqpopupmenutest.cpp +++ b/libs/konq/tests/konqpopupmenutest.cpp @@ -24,7 +24,6 @@ #include #include "qtest_kde.h" #include -#include #include #include #include @@ -34,7 +33,6 @@ QTEST_KDEMAIN(KonqPopupMenuTest, GUI) KonqPopupMenuTest::KonqPopupMenuTest() : m_actionCollection(this) { - m_appFlags = KonqPopupMenu::NoPlugins; } static QStringList extractActionNames(const QMenu& menu) @@ -161,15 +159,17 @@ void KonqPopupMenuTest::testFile() KFileItemList itemList; itemList << m_fileItem; KUrl viewUrl = QDir::currentPath(); - KParts::BrowserExtension::PopupFlags beflags = KParts::BrowserExtension::ShowProperties - | KParts::BrowserExtension::ShowReload - | KParts::BrowserExtension::ShowUrlOperations; - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::PopupFlags beflags = KonqPopupMenu::NoPlugins; + beflags |= KonqPopupMenu::ShowProperties; + beflags |= KonqPopupMenu::ShowReload; + beflags |= KonqPopupMenu::ShowUrlOperations; + + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("tabhandling", m_tabHandlingActions->actions()); actionGroups.insert("editactions", m_fileEditActions->actions()); actionGroups.insert("preview", QList() << m_preview1); - KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, m_appFlags, beflags, + KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, beflags, 0 /*parent*/, 0 /*bookmark manager*/, actionGroups); QStringList actions = extractActionNames(popup); @@ -205,17 +205,19 @@ void KonqPopupMenuTest::testFileInReadOnlyDirectory() QVERIFY(!capabilities.supportsMoving()); KUrl viewUrl("/etc"); - KParts::BrowserExtension::PopupFlags beflags = KParts::BrowserExtension::ShowProperties - | KParts::BrowserExtension::ShowReload - | KParts::BrowserExtension::ShowUrlOperations; - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::PopupFlags beflags = KonqPopupMenu::NoPlugins; + beflags |= KonqPopupMenu::ShowProperties; + beflags |= KonqPopupMenu::ShowReload; + beflags |= KonqPopupMenu::ShowUrlOperations; + + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("tabhandling", m_tabHandlingActions->actions()); // DolphinPart doesn't add rename/trash when supportsMoving is false // Maybe we should test dolphinpart directly :) //actionGroups.insert("editactions", m_fileEditActions->actions()); actionGroups.insert("preview", QList() << m_preview1); - KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, m_appFlags, beflags, + KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, beflags, 0 /*parent*/, 0 /*bookmark manager*/, actionGroups); QStringList actions = extractActionNames(popup); @@ -239,15 +241,17 @@ void KonqPopupMenuTest::testFilePreviewSubMenu() KFileItemList itemList; itemList << m_fileItem; KUrl viewUrl = QDir::currentPath(); - KParts::BrowserExtension::PopupFlags beflags = KParts::BrowserExtension::ShowProperties - | KParts::BrowserExtension::ShowReload - | KParts::BrowserExtension::ShowUrlOperations; - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::PopupFlags beflags = KonqPopupMenu::NoPlugins; + beflags |= KonqPopupMenu::ShowProperties; + beflags |= KonqPopupMenu::ShowReload; + beflags |= KonqPopupMenu::ShowUrlOperations; + + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("tabhandling", m_tabHandlingActions->actions()); actionGroups.insert("editactions", m_fileEditActions->actions()); actionGroups.insert("preview", m_previewActions->actions()); - KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, m_appFlags, beflags, + KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, beflags, 0 /*parent*/, 0 /*bookmark manager*/, actionGroups); QStringList actions = extractActionNames(popup); @@ -271,14 +275,16 @@ void KonqPopupMenuTest::testSubDirectory() KFileItemList itemList; itemList << m_subDirItem; KUrl viewUrl = QDir::currentPath(); - KParts::BrowserExtension::PopupFlags beflags = KParts::BrowserExtension::ShowProperties - | KParts::BrowserExtension::ShowUrlOperations; - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::PopupFlags beflags = KonqPopupMenu::NoPlugins; + beflags |= KonqPopupMenu::ShowProperties; + beflags |= KonqPopupMenu::ShowUrlOperations; + + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("tabhandling", m_tabHandlingActions->actions()); actionGroups.insert("editactions", m_fileEditActions->actions()); actionGroups.insert("preview", m_previewActions->actions()); - KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, m_appFlags, beflags, + KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, beflags, 0 /*parent*/, 0 /*bookmark manager*/, actionGroups); QStringList actions = extractActionNames(popup); actions.removeAll("services_submenu"); @@ -301,17 +307,19 @@ void KonqPopupMenuTest::testViewDirectory() KFileItemList itemList; itemList << m_thisDirectoryItem; KUrl viewUrl = m_thisDirectoryItem.url(); - KParts::BrowserExtension::PopupFlags beflags = - KParts::BrowserExtension::ShowNavigationItems | - KParts::BrowserExtension::ShowUp | - KParts::BrowserExtension::ShowCreateDirectory | - KParts::BrowserExtension::ShowUrlOperations | - KParts::BrowserExtension::ShowProperties; + + KonqPopupMenu::PopupFlags beflags = KonqPopupMenu::NoPlugins; + beflags |= KonqPopupMenu::ShowNavigationItems; + beflags |= KonqPopupMenu::ShowUp; + beflags |= KonqPopupMenu::ShowCreateDirectory; + beflags |= KonqPopupMenu::ShowUrlOperations; + beflags |= KonqPopupMenu::ShowProperties; + // KonqMainWindow says: doTabHandling = !openedForViewURL && ... So we don't add tabhandling here - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("preview", m_previewActions->actions()); - KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, m_appFlags, beflags, + KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, beflags, 0 /*parent*/, 0 /*bookmark manager*/, actionGroups); QStringList actions = extractActionNames(popup); @@ -343,17 +351,19 @@ void KonqPopupMenuTest::testViewReadOnlyDirectory() KFileItemList itemList; itemList << rootItem; KUrl viewUrl = rootItem.url(); - KParts::BrowserExtension::PopupFlags beflags = - KParts::BrowserExtension::ShowNavigationItems | - KParts::BrowserExtension::ShowUp | - KParts::BrowserExtension::ShowCreateDirectory | - KParts::BrowserExtension::ShowUrlOperations | - KParts::BrowserExtension::ShowProperties; + + KonqPopupMenu::PopupFlags beflags = KonqPopupMenu::NoPlugins; + beflags |= KonqPopupMenu::ShowNavigationItems; + beflags |= KonqPopupMenu::ShowUp; + beflags |= KonqPopupMenu::ShowCreateDirectory; + beflags |= KonqPopupMenu::ShowUrlOperations; + beflags |= KonqPopupMenu::ShowProperties; + // KonqMainWindow says: doTabHandling = !openedForViewURL && ... So we don't add tabhandling here - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("preview", m_previewActions->actions()); - KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, m_appFlags, beflags, + KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, beflags, 0 /*parent*/, 0 /*bookmark manager*/, actionGroups); QStringList actions = extractActionNames(popup); @@ -378,17 +388,20 @@ void KonqPopupMenuTest::testHtmlLink() itemList << m_linkItem; //KUrl viewUrl = m_fileItem.url(); KUrl viewUrl("http://www.kde.org"); - KParts::BrowserExtension::PopupFlags beflags = KParts::BrowserExtension::ShowBookmark - | KParts::BrowserExtension::ShowReload - | KParts::BrowserExtension::IsLink; - KParts::BrowserExtension::ActionGroupMap actionGroups; + + KonqPopupMenu::PopupFlags beflags = KonqPopupMenu::NoPlugins; + beflags |= KonqPopupMenu::ShowBookmark; + beflags |= KonqPopupMenu::ShowReload; + beflags |= KonqPopupMenu::IsLink; + + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("tabhandling", m_tabHandlingActions->actions()); actionGroups.insert("preview", m_previewActions->actions()); actionGroups.insert("editactions", m_htmlEditActions->actions()); actionGroups.insert("linkactions", m_linkActions->actions()); actionGroups.insert("partactions", m_partActions->actions()); - KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, m_appFlags, beflags, + KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, beflags, 0 /*parent*/, KBookmarkManager::userBookmarksManager(), actionGroups); QStringList actions = extractActionNames(popup); @@ -410,10 +423,13 @@ void KonqPopupMenuTest::testHtmlPage() KFileItemList itemList; itemList << m_linkItem; KUrl viewUrl = m_linkItem.url(); - KParts::BrowserExtension::PopupFlags beflags = KParts::BrowserExtension::ShowBookmark - | KParts::BrowserExtension::ShowReload - | KParts::BrowserExtension::ShowNavigationItems; - KParts::BrowserExtension::ActionGroupMap actionGroups; + + KonqPopupMenu::PopupFlags beflags = KonqPopupMenu::NoPlugins; + beflags |= KonqPopupMenu::ShowBookmark; + beflags |= KonqPopupMenu::ShowReload; + beflags |= KonqPopupMenu::ShowNavigationItems; + + KonqPopupMenu::ActionGroupMap actionGroups; // KonqMainWindow says: doTabHandling = !openedForViewURL && ... So we don't add tabhandling here // TODO we could just move that logic to KonqPopupMenu... //actionGroups.insert("tabhandling", m_tabHandlingActions->actions()); @@ -426,7 +442,7 @@ void KonqPopupMenuTest::testHtmlPage() m_actionCollection.addAction("setEncoding", setEncoding); actionGroups.insert("partactions", m_partActions->actions()); - KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, m_appFlags, beflags, + KonqPopupMenu popup(itemList, viewUrl, m_actionCollection, m_newMenu, beflags, 0 /*parent*/, KBookmarkManager::userBookmarksManager(), actionGroups); QStringList actions = extractActionNames(popup); diff --git a/libs/konq/tests/konqpopupmenutest.h b/libs/konq/tests/konqpopupmenutest.h index d01868eb..9cf458bf 100644 --- a/libs/konq/tests/konqpopupmenutest.h +++ b/libs/konq/tests/konqpopupmenutest.h @@ -45,8 +45,6 @@ private slots: void testHtmlPage(); private: - KonqPopupMenu::Flags m_appFlags; - KFileItem m_fileItem; KFileItem m_linkItem; KFileItem m_subDirItem; diff --git a/plasma/applets/folderview/folderview.cpp b/plasma/applets/folderview/folderview.cpp index 024ab381..6a48a7b1 100644 --- a/plasma/applets/folderview/folderview.cpp +++ b/plasma/applets/folderview/folderview.cpp @@ -2159,15 +2159,16 @@ void FolderView::showContextMenu(QWidget *widget, const QPoint &pos, const QMode editActions.append(m_actionCollection.action("del")); } - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("editactions", editActions); - KParts::BrowserExtension::PopupFlags flags = KParts::BrowserExtension::ShowProperties; - flags |= KParts::BrowserExtension::ShowUrlOperations; + KonqPopupMenu::PopupFlags flags = KonqPopupMenu::ShowNewWindow; + flags |= KonqPopupMenu::ShowProperties; + flags |= KonqPopupMenu::ShowUrlOperations; // m_newMenu can be NULL here but KonqPopupMenu does handle this. KonqPopupMenu *contextMenu = new KonqPopupMenu(items, m_url, m_actionCollection, m_newMenu, - KonqPopupMenu::ShowNewWindow, flags, widget, + flags, widget, KBookmarkManager::userBookmarksManager(), actionGroups); diff --git a/plasma/applets/folderview/popupview.cpp b/plasma/applets/folderview/popupview.cpp index 065d3dd3..5265001c 100644 --- a/plasma/applets/folderview/popupview.cpp +++ b/plasma/applets/folderview/popupview.cpp @@ -367,15 +367,16 @@ void PopupView::showContextMenu(QWidget *widget, const QPoint &screenPos, const editActions.append(m_actionCollection.action("del")); } - KParts::BrowserExtension::ActionGroupMap actionGroups; + KonqPopupMenu::ActionGroupMap actionGroups; actionGroups.insert("editactions", editActions); - KParts::BrowserExtension::PopupFlags flags = KParts::BrowserExtension::ShowProperties; - flags |= KParts::BrowserExtension::ShowUrlOperations; + KonqPopupMenu::PopupFlags flags = KonqPopupMenu::ShowProperties; + flags |= KonqPopupMenu::ShowNewWindow; + flags |= KonqPopupMenu::ShowUrlOperations; // m_newMenu can be NULL here but KonqPopupMenu does handle this. KonqPopupMenu *contextMenu = new KonqPopupMenu(items, m_url, m_actionCollection, m_newMenu, - KonqPopupMenu::ShowNewWindow, flags, + flags, QApplication::desktop(), KBookmarkManager::userBookmarksManager(), actionGroups); diff --git a/plasma/applets/kickoff/ui/contextmenufactory.cpp b/plasma/applets/kickoff/ui/contextmenufactory.cpp index 9126ecba..04e06d51 100644 --- a/plasma/applets/kickoff/ui/contextmenufactory.cpp +++ b/plasma/applets/kickoff/ui/contextmenufactory.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -59,37 +58,7 @@ class ContextMenuFactory::Private { public: Private() - : applet(0) { - } - - QAction *advancedActionsMenu(const QString& url) const { - KUrl kUrl(url); - KActionCollection actionCollection((QObject*)0); - KFileItemList items; - const QString mimeType = KMimeType::findByUrl(kUrl, 0, false, true)->name(); - items << KFileItem(url, mimeType, KFileItem::Unknown); - KParts::BrowserExtension::PopupFlags browserFlags = KParts::BrowserExtension::DefaultPopupItems; - if (items.first().isLocalFile()) { - browserFlags |= KParts::BrowserExtension::ShowProperties; - } - KParts::BrowserExtension::ActionGroupMap actionGroupMap; - return 0; - // ### TODO: remove kdebase-apps dependency -#if 0 - KonqPopupMenu *menu = new KonqPopupMenu(items, kUrl, actionCollection, - 0, 0, browserFlags, - 0, KBookmarkManager::userBookmarksManager(), actionGroupMap); - - if (!menu->isEmpty()) { - QAction *action = menu->menuAction(); - action->setText(i18n("Advanced")); - action->setIcon(KIcon("list-add")); - return action; - } else { - delete menu; - return 0; - } -#endif + : applet(0) { } QMap > viewActions; @@ -214,11 +183,6 @@ void ContextMenuFactory::showContextMenu(QAbstractItemView *view, actions << advancedSeparator; } - QAction *advanced = d->advancedActionsMenu(url); - if (advanced) { - actions << advanced; - } - // device actions const QString udi = index.data(DeviceUdiRole).toString(); Solid::Device device(udi);