1 /* This file is part of the KDE project
2 Copyright (c) 2007 David Faure <faure@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #include "dolphinpart.h"
22 #include <KFileItemListProperties>
23 #include <konq_operations.h>
26 #include <KActionCollection>
27 #include <KConfigGroup>
29 #include <KGlobalSettings>
30 #include <KIconLoader>
32 #include <KMessageBox>
33 #include <KPluginFactory>
35 #include <KToggleAction>
36 #include <KIO/NetAccess>
37 #include <KToolInvocation>
38 #include <kauthorized.h>
39 #include <KNewFileMenu>
41 #include <KInputDialog>
42 #include <KProtocolInfo>
43 #include <kdeversion.h>
45 #if KDE_IS_VERSION(4, 9, 2)
46 #include "dolphinpart_ext.h"
49 #include "views/dolphinview.h"
50 #include "views/dolphinviewactionhandler.h"
51 #include "views/dolphinnewfilemenuobserver.h"
52 #include "views/dolphinremoteencoding.h"
53 #include "kitemviews/kfileitemmodel.h"
54 #include "kitemviews/private/kfileitemmodeldirlister.h"
56 #include <QActionGroup>
57 #include <QApplication>
61 K_PLUGIN_FACTORY(DolphinPartFactory
, registerPlugin
<DolphinPart
>();)
62 K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin"))
64 DolphinPart::DolphinPart(QWidget
* parentWidget
, QObject
* parent
, const QVariantList
& args
)
65 : KParts::ReadOnlyPart(parent
)
66 ,m_openTerminalAction(0)
69 setComponentData(DolphinPartFactory::componentData(), false);
70 m_extension
= new DolphinPartBrowserExtension(this);
72 // make sure that other apps using this part find Dolphin's view-file-columns icons
73 KIconLoader::global()->addAppDir("dolphin");
75 m_view
= new DolphinView(KUrl(), parentWidget
);
76 m_view
->setTabsForFilesEnabled(true);
79 connect(m_view
, SIGNAL(directoryLoadingCompleted()), this, SIGNAL(completed()));
80 connect(m_view
, SIGNAL(directoryLoadingProgress(int)), this, SLOT(updateProgress(int)));
81 connect(m_view
, SIGNAL(errorMessage(QString
)), this, SLOT(slotErrorMessage(QString
)));
83 setXMLFile("dolphinpart.rc");
85 connect(m_view
, SIGNAL(infoMessage(QString
)),
86 this, SLOT(slotMessage(QString
)));
87 connect(m_view
, SIGNAL(operationCompletedMessage(QString
)),
88 this, SLOT(slotMessage(QString
)));
89 connect(m_view
, SIGNAL(errorMessage(QString
)),
90 this, SLOT(slotErrorMessage(QString
)));
91 connect(m_view
, SIGNAL(itemActivated(KFileItem
)),
92 this, SLOT(slotItemActivated(KFileItem
)));
93 connect(m_view
, SIGNAL(tabRequested(KUrl
)),
94 this, SLOT(createNewWindow(KUrl
)));
95 connect(m_view
, SIGNAL(requestContextMenu(QPoint
,KFileItem
,KUrl
,QList
<QAction
*>)),
96 this, SLOT(slotOpenContextMenu(QPoint
,KFileItem
,KUrl
,QList
<QAction
*>)));
97 connect(m_view
, SIGNAL(selectionChanged(KFileItemList
)),
98 m_extension
, SIGNAL(selectionInfo(KFileItemList
)));
99 connect(m_view
, SIGNAL(selectionChanged(KFileItemList
)),
100 this, SLOT(slotSelectionChanged(KFileItemList
)));
101 connect(m_view
, SIGNAL(requestItemInfo(KFileItem
)),
102 this, SLOT(slotRequestItemInfo(KFileItem
)));
103 connect(m_view
, SIGNAL(modeChanged(DolphinView::Mode
,DolphinView::Mode
)),
104 this, SIGNAL(viewModeChanged())); // relay signal
105 connect(m_view
, SIGNAL(redirection(KUrl
,KUrl
)),
106 this, SLOT(slotDirectoryRedirection(KUrl
,KUrl
)));
108 // Watch for changes that should result in updates to the
110 connect(m_view
, SIGNAL(itemCountChanged()), this, SLOT(updateStatusBar()));
111 connect(m_view
, SIGNAL(selectionChanged(KFileItemList
)), this, SLOT(updateStatusBar()));
113 m_actionHandler
= new DolphinViewActionHandler(actionCollection(), this);
114 m_actionHandler
->setCurrentView(m_view
);
115 connect(m_actionHandler
, SIGNAL(createDirectory()), SLOT(createDirectory()));
117 m_remoteEncoding
= new DolphinRemoteEncoding(this, m_actionHandler
);
118 connect(this, SIGNAL(aboutToOpenURL()),
119 m_remoteEncoding
, SLOT(slotAboutToOpenUrl()));
121 QClipboard
* clipboard
= QApplication::clipboard();
122 connect(clipboard
, SIGNAL(dataChanged()),
123 this, SLOT(updatePasteAction()));
125 // Create file info and listing filter extensions.
126 // NOTE: Listing filter needs to be instantiated after the creation of the view.
127 new DolphinPartFileInfoExtension(this);
129 #if KDE_IS_VERSION(4, 9, 2)
130 new DolphinPartListingFilterExtension(this);
132 KDirLister
* lister
= m_view
->m_model
->m_dirLister
;
134 DolphinPartListingNotificationExtension
* notifyExt
= new DolphinPartListingNotificationExtension(this);
135 connect(lister
, SIGNAL(newItems(KFileItemList
)), notifyExt
, SLOT(slotNewItems(KFileItemList
)));
136 connect(lister
, SIGNAL(itemsDeleted(KFileItemList
)), notifyExt
, SLOT(slotItemsDeleted(KFileItemList
)));
138 kWarning() << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
143 m_actionHandler
->updateViewActions();
144 slotSelectionChanged(KFileItemList()); // initially disable selection-dependent actions
146 // TODO there was a "always open a new window" (when clicking on a directory) setting in konqueror
147 // (sort of spacial navigation)
149 loadPlugins(this, this, componentData());
152 DolphinPart::~DolphinPart()
154 DolphinNewFileMenuObserver::instance().detach(m_newFileMenu
);
157 void DolphinPart::createActions()
161 m_newFileMenu
= new KNewFileMenu(actionCollection(), "new_menu", this);
162 m_newFileMenu
->setParentWidget(widget());
163 DolphinNewFileMenuObserver::instance().attach(m_newFileMenu
);
164 connect(m_newFileMenu
->menu(), SIGNAL(aboutToShow()),
165 this, SLOT(updateNewMenu()));
167 KAction
*editMimeTypeAction
= actionCollection()->addAction( "editMimeType" );
168 editMimeTypeAction
->setText( i18nc("@action:inmenu Edit", "&Edit File Type..." ) );
169 connect(editMimeTypeAction
, SIGNAL(triggered()), SLOT(slotEditMimeType()));
171 KAction
* selectItemsMatching
= actionCollection()->addAction("select_items_matching");
172 selectItemsMatching
->setText(i18nc("@action:inmenu Edit", "Select Items Matching..."));
173 selectItemsMatching
->setShortcut(Qt::CTRL
| Qt::Key_S
);
174 connect(selectItemsMatching
, SIGNAL(triggered()), this, SLOT(slotSelectItemsMatchingPattern()));
176 KAction
* unselectItemsMatching
= actionCollection()->addAction("unselect_items_matching");
177 unselectItemsMatching
->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching..."));
178 connect(unselectItemsMatching
, SIGNAL(triggered()), this, SLOT(slotUnselectItemsMatchingPattern()));
180 actionCollection()->addAction(KStandardAction::SelectAll
, "select_all", m_view
, SLOT(selectAll()));
182 KAction
* unselectAll
= actionCollection()->addAction("unselect_all");
183 unselectAll
->setText(i18nc("@action:inmenu Edit", "Unselect All"));
184 connect(unselectAll
, SIGNAL(triggered()), m_view
, SLOT(clearSelection()));
186 KAction
* invertSelection
= actionCollection()->addAction("invert_selection");
187 invertSelection
->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
188 invertSelection
->setShortcut(Qt::CTRL
| Qt::SHIFT
| Qt::Key_A
);
189 connect(invertSelection
, SIGNAL(triggered()), m_view
, SLOT(invertSelection()));
191 // View menu: all done by DolphinViewActionHandler
195 QActionGroup
* goActionGroup
= new QActionGroup(this);
196 connect(goActionGroup
, SIGNAL(triggered(QAction
*)),
197 this, SLOT(slotGoTriggered(QAction
*)));
199 createGoAction("go_applications", "start-here-kde",
200 i18nc("@action:inmenu Go", "App&lications"), QString("programs:/"),
202 createGoAction("go_network_folders", "folder-remote",
203 i18nc("@action:inmenu Go", "&Network Folders"), QString("remote:/"),
205 createGoAction("go_settings", "preferences-system",
206 i18nc("@action:inmenu Go", "Sett&ings"), QString("settings:/"),
208 createGoAction("go_trash", "user-trash",
209 i18nc("@action:inmenu Go", "Trash"), QString("trash:/"),
211 createGoAction("go_autostart", "",
212 i18nc("@action:inmenu Go", "Autostart"), KGlobalSettings::autostartPath(),
216 m_findFileAction
= actionCollection()->addAction("find_file");
217 m_findFileAction
->setText(i18nc("@action:inmenu Tools", "Find File..."));
218 m_findFileAction
->setShortcut(Qt::CTRL
| Qt::Key_F
);
219 m_findFileAction
->setIcon(KIcon("edit-find"));
220 connect(m_findFileAction
, SIGNAL(triggered()), this, SLOT(slotFindFile()));
222 if (KAuthorized::authorizeKAction("shell_access")) {
223 m_openTerminalAction
= actionCollection()->addAction("open_terminal");
224 m_openTerminalAction
->setIcon(KIcon("utilities-terminal"));
225 m_openTerminalAction
->setText(i18nc("@action:inmenu Tools", "Open &Terminal"));
226 connect(m_openTerminalAction
, SIGNAL(triggered()), SLOT(slotOpenTerminal()));
227 m_openTerminalAction
->setShortcut(Qt::Key_F4
);
231 void DolphinPart::createGoAction(const char* name
, const char* iconName
,
232 const QString
& text
, const QString
& url
,
233 QActionGroup
* actionGroup
)
235 KAction
* action
= actionCollection()->addAction(name
);
236 action
->setIcon(KIcon(iconName
));
237 action
->setText(text
);
238 action
->setData(url
);
239 action
->setActionGroup(actionGroup
);
242 void DolphinPart::slotGoTriggered(QAction
* action
)
244 const QString url
= action
->data().toString();
245 emit m_extension
->openUrlRequest(KUrl(url
));
248 void DolphinPart::slotSelectionChanged(const KFileItemList
& selection
)
250 const bool hasSelection
= !selection
.isEmpty();
252 QAction
* renameAction
= actionCollection()->action("rename");
253 QAction
* moveToTrashAction
= actionCollection()->action("move_to_trash");
254 QAction
* deleteAction
= actionCollection()->action("delete");
255 QAction
* editMimeTypeAction
= actionCollection()->action("editMimeType");
256 QAction
* propertiesAction
= actionCollection()->action("properties");
257 QAction
* deleteWithTrashShortcut
= actionCollection()->action("delete_shortcut"); // see DolphinViewActionHandler
260 stateChanged("has_no_selection");
262 emit m_extension
->enableAction("cut", false);
263 emit m_extension
->enableAction("copy", false);
264 deleteWithTrashShortcut
->setEnabled(false);
265 editMimeTypeAction
->setEnabled(false);
267 stateChanged("has_selection");
269 // TODO share this code with DolphinMainWindow::updateEditActions (and the desktop code)
271 KFileItemListProperties
capabilities(selection
);
272 const bool enableMoveToTrash
= capabilities
.isLocal() && capabilities
.supportsMoving();
274 renameAction
->setEnabled(capabilities
.supportsMoving());
275 moveToTrashAction
->setEnabled(enableMoveToTrash
);
276 deleteAction
->setEnabled(capabilities
.supportsDeleting());
277 deleteWithTrashShortcut
->setEnabled(capabilities
.supportsDeleting() && !enableMoveToTrash
);
278 editMimeTypeAction
->setEnabled(true);
279 propertiesAction
->setEnabled(true);
280 emit m_extension
->enableAction("cut", capabilities
.supportsMoving());
281 emit m_extension
->enableAction("copy", true);
285 void DolphinPart::updatePasteAction()
287 QPair
<bool, QString
> pasteInfo
= m_view
->pasteInfo();
288 emit m_extension
->enableAction( "paste", pasteInfo
.first
);
289 emit m_extension
->setActionText( "paste", pasteInfo
.second
);
292 KAboutData
* DolphinPart::createAboutData()
294 return new KAboutData("dolphinpart", "dolphin", ki18nc("@title", "Dolphin Part"), "0.1");
297 bool DolphinPart::openUrl(const KUrl
& url
)
299 bool reload
= arguments().reload();
300 // A bit of a workaround so that changing the namefilter works: force reload.
301 // Otherwise DolphinView wouldn't relist the URL, so nothing would happen.
302 if (m_nameFilter
!= m_view
->nameFilter())
304 if (m_view
->url() == url
&& !reload
) { // DolphinView won't do anything in that case, so don't emit started
307 setUrl(url
); // remember it at the KParts level
308 KUrl
visibleUrl(url
);
309 if (!m_nameFilter
.isEmpty()) {
310 visibleUrl
.addPath(m_nameFilter
);
312 QString prettyUrl
= visibleUrl
.pathOrUrl();
313 emit
setWindowCaption(prettyUrl
);
314 emit m_extension
->setLocationBarUrl(prettyUrl
);
315 emit
started(0); // get the wheel to spin
316 m_view
->setNameFilter(m_nameFilter
);
319 emit
aboutToOpenURL();
322 // Disable "Find File" and "Open Terminal" actions for non-file URLs,
323 // e.g. ftp, smb, etc. #279283
324 const bool isLocalUrl
= url
.isLocalFile();
325 m_findFileAction
->setEnabled(isLocalUrl
);
326 if (m_openTerminalAction
) {
327 m_openTerminalAction
->setEnabled(isLocalUrl
);
332 void DolphinPart::slotMessage(const QString
& msg
)
334 emit
setStatusBarText(msg
);
337 void DolphinPart::slotErrorMessage(const QString
& msg
)
341 //KMessageBox::error(m_view, msg);
344 void DolphinPart::slotRequestItemInfo(const KFileItem
& item
)
346 emit m_extension
->mouseOverInfo(item
);
350 ReadOnlyPart::setStatusBarText(item
.getStatusBarInfo());
354 void DolphinPart::slotItemActivated(const KFileItem
& item
)
356 KParts::OpenUrlArguments args
;
357 // Forget about the known mimetype if a target URL is used.
358 // Testcase: network:/ with a item (mimetype "inode/some-foo-service") pointing to a http URL (html)
359 if (item
.targetUrl() == item
.url()) {
360 args
.setMimeType(item
.mimetype());
363 // Ideally, konqueror should be changed to not require trustedSource for directory views,
364 // since the idea was not to need BrowserArguments for non-browser stuff...
365 KParts::BrowserArguments browserArgs
;
366 browserArgs
.trustedSource
= true;
367 emit m_extension
->openUrlRequest(item
.targetUrl(), args
, browserArgs
);
370 void DolphinPart::createNewWindow(const KUrl
& url
)
372 // TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code
373 // should be moved into DolphinPart::slotItemActivated()
374 emit m_extension
->createNewWindow(url
);
377 void DolphinPart::slotOpenContextMenu(const QPoint
& pos
,
378 const KFileItem
& _item
,
380 const QList
<QAction
*>& customActions
)
382 KParts::BrowserExtension::PopupFlags popupFlags
= KParts::BrowserExtension::DefaultPopupItems
383 | KParts::BrowserExtension::ShowProperties
384 | KParts::BrowserExtension::ShowUrlOperations
;
386 KFileItem
item(_item
);
388 if (item
.isNull()) { // viewport context menu
389 popupFlags
|= KParts::BrowserExtension::ShowNavigationItems
| KParts::BrowserExtension::ShowUp
;
390 item
= m_view
->rootItem();
392 item
= KFileItem( S_IFDIR
, (mode_t
)-1, url() );
394 item
.setUrl(url()); // ensure we use the view url, not the canonical path (#213799)
397 // TODO: We should change the signature of the slots (and signals) for being able
398 // to tell for which items we want a popup.
400 if (m_view
->selectedItems().isEmpty()) {
403 items
= m_view
->selectedItems();
406 KFileItemListProperties
capabilities(items
);
408 KParts::BrowserExtension::ActionGroupMap actionGroups
;
409 QList
<QAction
*> editActions
;
410 editActions
+= m_view
->versionControlActions(m_view
->selectedItems());
411 editActions
+= customActions
;
413 if (!_item
.isNull()) { // only for context menu on one or more items
414 bool supportsDeleting
= capabilities
.supportsDeleting();
415 bool supportsMoving
= capabilities
.supportsMoving();
417 if (!supportsDeleting
) {
418 popupFlags
|= KParts::BrowserExtension::NoDeletion
;
421 if (supportsMoving
) {
422 editActions
.append(actionCollection()->action("rename"));
425 bool addTrash
= capabilities
.isLocal() && supportsMoving
;
427 if (supportsDeleting
) {
428 if ( !item
.isLocalFile() )
430 else if (QApplication::keyboardModifiers() & Qt::ShiftModifier
) {
435 KSharedConfig::Ptr globalConfig
= KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals
);
436 KConfigGroup
configGroup(globalConfig
, "KDE");
437 addDel
= configGroup
.readEntry("ShowDeleteCommand", false);
442 editActions
.append(actionCollection()->action("move_to_trash"));
444 editActions
.append(actionCollection()->action("delete"));
446 // Normally KonqPopupMenu only shows the "Create new" submenu in the current view
447 // since otherwise the created file would not be visible.
448 // But in treeview mode we should allow it.
449 if (m_view
->itemsExpandable())
450 popupFlags
|= KParts::BrowserExtension::ShowCreateDirectory
;
454 actionGroups
.insert("editactions", editActions
);
456 emit m_extension
->popupMenu(pos
,
458 KParts::OpenUrlArguments(),
459 KParts::BrowserArguments(),
464 void DolphinPart::slotDirectoryRedirection(const KUrl
& oldUrl
, const KUrl
& newUrl
)
466 //kDebug() << oldUrl << newUrl << "currentUrl=" << url();
467 if (oldUrl
.equals(url(), KUrl::CompareWithoutTrailingSlash
/* #207572 */)) {
468 KParts::ReadOnlyPart::setUrl(newUrl
);
469 const QString prettyUrl
= newUrl
.pathOrUrl();
470 emit m_extension
->setLocationBarUrl(prettyUrl
);
475 void DolphinPart::slotEditMimeType()
477 const KFileItemList items
= m_view
->selectedItems();
478 if (!items
.isEmpty()) {
479 KonqOperations::editMimeType(items
.first().mimetype(), m_view
);
483 void DolphinPart::slotSelectItemsMatchingPattern()
485 openSelectionDialog(i18nc("@title:window", "Select"),
486 i18n("Select all items matching this pattern:"),
490 void DolphinPart::slotUnselectItemsMatchingPattern()
492 openSelectionDialog(i18nc("@title:window", "Unselect"),
493 i18n("Unselect all items matching this pattern:"),
497 void DolphinPart::openSelectionDialog(const QString
& title
, const QString
& text
, bool selectItems
)
500 QString pattern
= KInputDialog::getText(title
, text
, "*", &okClicked
, m_view
);
502 if (okClicked
&& !pattern
.isEmpty()) {
503 QRegExp
patternRegExp(pattern
, Qt::CaseSensitive
, QRegExp::Wildcard
);
504 m_view
->selectItems(patternRegExp
, selectItems
);
508 void DolphinPart::setCurrentViewMode(const QString
& viewModeName
)
510 QAction
* action
= actionCollection()->action(viewModeName
);
515 QString
DolphinPart::currentViewMode() const
517 return m_actionHandler
->currentViewModeActionName();
520 void DolphinPart::setNameFilter(const QString
& nameFilter
)
522 // This is the "/home/dfaure/*.diff" kind of name filter (KDirLister::setNameFilter)
523 // which is unrelated to DolphinView::setNameFilter which is substring filtering in a proxy.
524 m_nameFilter
= nameFilter
;
525 // TODO save/restore name filter in saveState/restoreState like KonqDirPart did in kde3?
528 void DolphinPart::slotOpenTerminal()
530 QString
dir(QDir::homePath());
534 // If the given directory is not local, it can still be the URL of an
535 // ioslave using UDS_LOCAL_PATH which to be converted first.
536 u
= KIO::NetAccess::mostLocalUrl(u
, widget());
538 //If the URL is local after the above conversion, set the directory.
539 if (u
.isLocalFile()) {
540 dir
= u
.toLocalFile();
543 KToolInvocation::invokeTerminal(QString(), dir
);
546 void DolphinPart::slotFindFile()
548 KRun::run("kfind", url(), widget());
551 void DolphinPart::updateNewMenu()
553 // As requested by KNewFileMenu :
554 m_newFileMenu
->checkUpToDate();
555 m_newFileMenu
->setViewShowsHiddenFiles(m_view
->hiddenFilesShown());
556 // And set the files that the menu apply on :
557 m_newFileMenu
->setPopupFiles(url());
560 void DolphinPart::updateStatusBar()
562 emit
ReadOnlyPart::setStatusBarText(m_view
->statusBarText());
565 void DolphinPart::updateProgress(int percent
)
567 m_extension
->loadingProgress(percent
);
570 void DolphinPart::createDirectory()
572 m_newFileMenu
->setViewShowsHiddenFiles(m_view
->hiddenFilesShown());
573 m_newFileMenu
->setPopupFiles(url());
574 m_newFileMenu
->createDirectory();
577 void DolphinPart::setFilesToSelect(const KUrl::List
& files
)
579 if (files
.isEmpty()) {
583 m_view
->markUrlsAsSelected(files
);
584 m_view
->markUrlAsCurrent(files
.at(0));
589 void DolphinPartBrowserExtension::restoreState(QDataStream
&stream
)
591 KParts::BrowserExtension::restoreState(stream
);
592 m_part
->view()->restoreState(stream
);
595 void DolphinPartBrowserExtension::saveState(QDataStream
&stream
)
597 KParts::BrowserExtension::saveState(stream
);
598 m_part
->view()->saveState(stream
);
601 void DolphinPartBrowserExtension::cut()
603 m_part
->view()->cutSelectedItems();
606 void DolphinPartBrowserExtension::copy()
608 m_part
->view()->copySelectedItems();
611 void DolphinPartBrowserExtension::paste()
613 m_part
->view()->paste();
616 void DolphinPartBrowserExtension::pasteTo(const KUrl
&)
618 m_part
->view()->pasteIntoFolder();
621 void DolphinPartBrowserExtension::reparseConfiguration()
623 m_part
->view()->readSettings();
628 DolphinPartFileInfoExtension::DolphinPartFileInfoExtension(DolphinPart
* part
)
629 : KParts::FileInfoExtension(part
)
633 DolphinPart
* DolphinPartFileInfoExtension::part() const
635 return static_cast<DolphinPart
*>(parent());
638 bool DolphinPartFileInfoExtension::hasSelection() const
640 return part()->view()->selectedItemsCount() > 0;
643 KParts::FileInfoExtension::QueryModes
DolphinPartFileInfoExtension::supportedQueryModes() const
645 return (KParts::FileInfoExtension::AllItems
| KParts::FileInfoExtension::SelectedItems
);
648 KFileItemList
DolphinPartFileInfoExtension::queryFor(KParts::FileInfoExtension::QueryMode mode
) const
652 if (mode
== KParts::FileInfoExtension::None
)
655 if (!(supportedQueryModes() & mode
))
659 case KParts::FileInfoExtension::SelectedItems
:
661 return part()->view()->selectedItems();
663 case KParts::FileInfoExtension::AllItems
:
664 return part()->view()->items();
672 #include "dolphinpart.moc"