]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinpart.cpp
Treeview fixes (backport):
[dolphin.git] / src / dolphinpart.cpp
index 12ba14a9fc1e5f36c70e47720a28ef4730196c99..d26f14061fd00722fd383fd8cba7ace4f0de0e5b 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <kactioncollection.h>
 #include <kdirlister.h>
+#include <kiconloader.h>
 #include <kmessagebox.h>
 #include <kparts/genericfactory.h>
 #include <ktoggleaction.h>
@@ -47,6 +48,9 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QStringLi
     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_dirLister = new KDirLister;
     m_dirLister->setAutoUpdate(true);
     m_dirLister->setMainWindow(parentWidget->topLevelWidget());
@@ -154,10 +158,10 @@ void DolphinPart::createActions()
     connect(goActionGroup, SIGNAL(triggered(QAction*)),
             this, SLOT(slotGoTriggered(QAction*)));
 
-    createGoAction("go_applications", "start-here",
+    createGoAction("go_applications", "start-here-kde",
                    i18nc("@action:inmenu Go", "App&lications"), QString("programs:/"),
                    goActionGroup);
-    createGoAction("go_network_folders", "drive-remote",
+    createGoAction("go_network_folders", "folder-remote",
                    i18nc("@action:inmenu Go", "&Network Folders"), QString("remote:/"),
                    goActionGroup);
     createGoAction("go_settings", "preferences-system",
@@ -277,6 +281,14 @@ void DolphinPart::slotRequestItemInfo(const KFileItem& item)
 
 void DolphinPart::slotItemTriggered(const KFileItem& item)
 {
+    KParts::OpenUrlArguments args;
+    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;
+
     // MMB click support.
     // TODO: this doesn't work, mouseButtons() is always 0.
     // Issue N176832 for the missing QAIV signal; task 177399
@@ -284,9 +296,7 @@ void DolphinPart::slotItemTriggered(const KFileItem& item)
     if (QApplication::mouseButtons() & Qt::MidButton) {
         kDebug() << "MMB!!" << item.mimetype();
         if (item.mimeTypePtr()->is("inode/directory")) {
-            KParts::OpenUrlArguments args;
-            args.setMimeType( item.mimetype() );
-            emit m_extension->createNewWindow( item.url(), args );
+            emit m_extension->createNewWindow(item.url(), args);
         } else {
             kDebug() << "run()";
             item.run();
@@ -294,7 +304,7 @@ void DolphinPart::slotItemTriggered(const KFileItem& item)
     } else {
         // Left button. [Right button goes to slotOpenContextMenu before triggered can be emitted]
         kDebug() << "LMB";
-        emit m_extension->openUrlRequest(item.url());
+        emit m_extension->openUrlRequest(item.url(), args, browserArgs);
     }
 }