]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Reload the view if a previously unmounted device is mounted again
[dolphin.git] / src / dolphinviewcontainer.cpp
index 1e9e79ae7a8d800e980baeb8afee3db3bae2c151..c8fc757ba700252a9fc141a0e14ef7235132a0af 100644 (file)
@@ -98,6 +98,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
 
     m_searchBox = new DolphinSearchBox(this);
     m_searchBox->hide();
+    connect(m_searchBox, SIGNAL(activated()), this, SLOT(activate()));
     connect(m_searchBox, SIGNAL(closeRequest()), this, SLOT(closeSearchBox()));
     connect(m_searchBox, SIGNAL(searchRequest()), this, SLOT(startSearching()));
     connect(m_searchBox, SIGNAL(returnPressed(QString)), this, SLOT(requestFocus()));
@@ -195,6 +196,7 @@ KUrl DolphinViewContainer::url() const
 
 void DolphinViewContainer::setActive(bool active)
 {
+    m_searchBox->setActive(active);
     m_urlNavigator->setActive(active);
     m_view->setActive(active);
 
@@ -370,6 +372,10 @@ void DolphinViewContainer::setUrl(const KUrl& newUrl)
 {
     if (newUrl != m_urlNavigator->locationUrl()) {
         m_urlNavigator->setLocationUrl(newUrl);
+    } else if (m_view->itemsCount() == 0) {
+        // Maybe a previously unmounted device has been mounted again.
+        // Let's reload the view to be safe (see https://bugs.kde.org/show_bug.cgi?id=161385).
+        m_view->reload();
     }
 
     #ifdef KActivities_FOUND