From c3584e31018b102f75a8a87a34ccba186f291a04 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 27 Jan 2010 23:55:55 +0000 Subject: [PATCH] Implement the --select option in konqueror again, using Peter's nice work in Dolphin. While at it, I reworked the handling of command-line options in main completely, to factorize code and make --select do the right thing even in case of multiple args (wasn't supported in kde3). svn path=/trunk/KDE/kdebase/apps/; revision=1081246 --- src/dolphinpart.cpp | 5 +++++ src/dolphinpart.h | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index c8db1c1e1..e005ac29c 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -625,4 +625,9 @@ void DolphinPart::createDirectory() m_newMenu->createDirectory(); } +void DolphinPart::setFilesToSelect(const KUrl::List& files) +{ + m_view->markUrlsAsSelected(files); +} + #include "dolphinpart.moc" diff --git a/src/dolphinpart.h b/src/dolphinpart.h index 049432cf8..2b8129f3d 100644 --- a/src/dolphinpart.h +++ b/src/dolphinpart.h @@ -52,6 +52,9 @@ class DolphinPart : public KParts::ReadOnlyPart // 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(); @@ -214,6 +217,12 @@ private Q_SLOTS: void createDirectory(); + /** + * Called by konqueror --select + */ + void setFilesToSelect(const KUrl::List& files); + KUrl::List filesToSelect() const { return KUrl::List(); } // silence moc + private: void createActions(); void createGoAction(const char* name, const char* iconName, -- 2.47.3