]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Make use of the error messages coming from the places model.
[dolphin.git] / src / dolphinmainwindow.cpp
index bb4ff90b7440593d53e2a6a1a0f5c6da3bc2337d..42e80f9324353ee1a293dd5e6617916a2aaadd61 100644 (file)
@@ -98,6 +98,8 @@ DolphinMainWindow::DolphinMainWindow(int id) :
             this, SLOT(slotUndoAvailable(bool)));
     connect(undoManager, SIGNAL(undoTextChanged(const QString&)),
             this, SLOT(slotUndoTextChanged(const QString&)));
+    connect(DolphinSettings::instance().placesModel(), SIGNAL(errorMessage(const QString&)),
+            this, SLOT(slotHandlePlacesError(const QString&)));
 }
 
 DolphinMainWindow::~DolphinMainWindow()
@@ -221,8 +223,9 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
 
 void DolphinMainWindow::changeUrl(const KUrl& url)
 {
-    if (activeViewContainer() != 0) {
-        activeViewContainer()->setUrl(url);
+    DolphinViewContainer* view = activeViewContainer();
+    if (view != 0) {
+        view->setUrl(url);
         updateEditActions();
         updateViewActions();
         updateGoActions();
@@ -479,6 +482,14 @@ void DolphinMainWindow::quit()
     close();
 }
 
+void DolphinMainWindow::slotHandlePlacesError(const QString &message)
+{
+    if (!message.isEmpty()) {
+        DolphinStatusBar* statusBar = m_activeViewContainer->statusBar();
+        statusBar->setMessage(message, DolphinStatusBar::Error);
+    }
+}
+
 void DolphinMainWindow::slotHandleJobError(KJob* job)
 {
     if (job->error() != 0) {
@@ -1026,9 +1037,11 @@ void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* view)
     updateViewActions();
     updateGoActions();
 
-    setCaption(m_activeViewContainer->url().fileName());
+    const KUrl& url = m_activeViewContainer->url();
+    setCaption(url.fileName());
 
     emit activeViewChanged();
+    emit urlChanged(url);
 }
 
 void DolphinMainWindow::setupActions()