]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Implement the --select option in konqueror again, using Peter's nice work in Dolphin.
authorDavid Faure <faure@kde.org>
Wed, 27 Jan 2010 23:55:55 +0000 (23:55 +0000)
committerDavid Faure <faure@kde.org>
Wed, 27 Jan 2010 23:55:55 +0000 (23:55 +0000)
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
src/dolphinpart.h

index c8db1c1e158f582b3285119d0f660d158663287d..e005ac29c21ff1a8ce95d10d36c2ee62eed212b6 100644 (file)
@@ -625,4 +625,9 @@ void DolphinPart::createDirectory()
     m_newMenu->createDirectory();
 }
 
+void DolphinPart::setFilesToSelect(const KUrl::List& files)
+{
+    m_view->markUrlsAsSelected(files);
+}
+
 #include "dolphinpart.moc"
index 049432cf89458ec14acb8a2dd26314af754d2ce8..2b8129f3d33d99495ce9e70fc6dbb385d3cb85f3 100644 (file)
@@ -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,