]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Get rid of obsolete DolphinPlacesModel
[dolphin.git] / src / dolphinviewcontainer.cpp
index 5f8b8f3b4504cfeddc50cddbd057a3f499a30923..7c7d7d309173055888e527ed54d0af983e394b3b 100644 (file)
@@ -48,7 +48,6 @@
 #include "filterbar/filterbar.h"
 #include "search/dolphinsearchbox.h"
 #include "statusbar/dolphinstatusbar.h"
-#include "views/dolphinplacesmodel.h"
 #include "views/draganddrophelper.h"
 #include "views/viewmodecontroller.h"
 #include "views/viewproperties.h"
@@ -72,7 +71,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
     m_topLayout->setSpacing(0);
     m_topLayout->setMargin(0);
 
-    m_urlNavigator = new KUrlNavigator(DolphinPlacesModel::instance(), url, this);
+    m_urlNavigator = new KUrlNavigator(new KFilePlacesModel(this), url, this);
     connect(m_urlNavigator, SIGNAL(urlsDropped(KUrl,QDropEvent*)),
             this, SLOT(dropUrls(KUrl,QDropEvent*)));
     connect(m_urlNavigator, SIGNAL(activated()),
@@ -90,7 +89,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
     m_searchBox = new DolphinSearchBox(this);
     m_searchBox->hide();
     connect(m_searchBox, SIGNAL(closeRequest()), this, SLOT(closeSearchBox()));
-    connect(m_searchBox, SIGNAL(search(QString)), this, SLOT(startSearching(QString)));
+    connect(m_searchBox, SIGNAL(searchRequest()), this, SLOT(startSearching()));
     connect(m_searchBox, SIGNAL(returnPressed(QString)), this, SLOT(requestFocus()));
 
     m_messageWidget = new KMessageWidget(this);
@@ -297,6 +296,8 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled)
             m_searchBox->setSearchPath(url);
         }
     } else {
+        m_view->setViewPropertiesContext(QString());
+
         // Restore the URL for the URL navigator. If Dolphin has been
         // started with a search-URL, the home URL is used as fallback.
         const KUrl url = m_searchBox->searchPath();
@@ -585,11 +586,11 @@ void DolphinViewContainer::slotHistoryChanged()
     }
 }
 
-void DolphinViewContainer::startSearching(const QString &text)
+void DolphinViewContainer::startSearching()
 {
-    Q_UNUSED(text);
     const KUrl url = m_searchBox->urlForSearching();
     if (url.isValid() && !url.isEmpty()) {
+        m_view->setViewPropertiesContext("search");
         m_urlNavigator->setLocationUrl(url);
     }
 }