]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
allow to restrict the search results by the current folder (including all sub folders)
[dolphin.git] / src / dolphinmainwindow.cpp
index 6e2b81390cd5e4f3b13c1dbdfd3c8925abc910a8..5e08a9e2e5d292c922dac15b64ca2fed6d5f8f81 100644 (file)
@@ -1011,8 +1011,8 @@ void DolphinMainWindow::slotTestCanDecode(const QDragMoveEvent* event, bool& can
 void DolphinMainWindow::searchItems()
 {
 #ifdef HAVE_NEPOMUK
-    const KUrl nepomukUrl = m_searchOptionsConfigurator->nepomukUrl();
-    m_activeViewContainer->setUrl(nepomukUrl);
+    const KUrl nepomukSearchUrl = m_searchOptionsConfigurator->nepomukSearchUrl();
+    m_activeViewContainer->setUrl(nepomukSearchUrl);
 #endif
 }
 
@@ -1074,6 +1074,7 @@ void DolphinMainWindow::init()
     m_searchOptionsConfigurator->hide();
     connect(m_searchOptionsConfigurator, SIGNAL(searchOptionsChanged()),
             this, SLOT(searchItems()));
+    connect(this, SIGNAL(urlChanged(KUrl)), m_searchOptionsConfigurator, SLOT(setDirectory(KUrl)));
 #endif
 
     m_tabBar = new KTabBar(this);
@@ -1370,7 +1371,7 @@ void DolphinMainWindow::setupDockWidgets()
     infoDock->setObjectName("infoDock");
     infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
     Panel* infoPanel = new InformationPanel(infoDock);
-    connect(infoPanel, SIGNAL(urlActivated(KUrl)), activeViewContainer(), SLOT(setUrl(KUrl)));
+    connect(infoPanel, SIGNAL(urlActivated(KUrl)), this, SLOT(handleUrl(KUrl)));
     infoDock->setWidget(infoPanel);
 
     QAction* infoAction = infoDock->toggleViewAction();
@@ -1660,6 +1661,16 @@ void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
     setCaption(caption);
 }
 
+void DolphinMainWindow::handleUrl(const KUrl& url)
+{
+    if (KProtocolManager::supportsListing(url)) {
+        activeViewContainer()->setUrl(url);
+    }
+    else {
+        new KRun(url, this);
+    }
+}
+
 QString DolphinMainWindow::squeezedText(const QString& text) const
 {
     const QFontMetrics fm = fontMetrics();