]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / dolphinviewcontainer.cpp
index 5a424d17ba00002bc28026f4e26ebb21bfc2c30d..1c962450471cdb639e70957c0acebbf8e20bc436 100644 (file)
@@ -106,7 +106,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl &url, QWidget *parent)
     m_messageWidget->setPosition(KMessageWidget::Header);
     m_messageWidget->hide();
 
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_HAIKU)
     if (getuid() == 0) {
         // We must be logged in as the root user; show a big scary warning
         showMessage(i18n("Running Dolphin as root can be dangerous. Please be careful."), Warning);
@@ -302,6 +302,8 @@ void DolphinViewContainer::connectUrlNavigator(DolphinUrlNavigator *urlNavigator
     connect(m_view, &DolphinView::urlChanged, urlNavigator, &DolphinUrlNavigator::setLocationUrl);
     connect(urlNavigator, &DolphinUrlNavigator::activated, this, &DolphinViewContainer::activate);
 
+    urlNavigator->setReadOnlyBadgeVisible(rootItem().isLocalFile() && !rootItem().isWritable());
+
     m_urlNavigatorConnected = urlNavigator;
 }
 
@@ -651,6 +653,10 @@ void DolphinViewContainer::slotDirectoryLoadingStarted()
         m_statusBar->setProgressText(QString());
         updateDirectoryLoadingProgress(-1);
     }
+
+    if (m_urlNavigatorConnected) {
+        m_urlNavigatorConnected->setReadOnlyBadgeVisible(false);
+    }
 }
 
 void DolphinViewContainer::slotDirectoryLoadingCompleted()
@@ -667,6 +673,10 @@ void DolphinViewContainer::slotDirectoryLoadingCompleted()
     } else {
         updateStatusBar();
     }
+
+    if (m_urlNavigatorConnected) {
+        m_urlNavigatorConnected->setReadOnlyBadgeVisible(rootItem().isLocalFile() && !rootItem().isWritable());
+    }
 }
 
 void DolphinViewContainer::slotDirectoryLoadingCanceled()
@@ -858,7 +868,8 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl &url)
 
 void DolphinViewContainer::slotUrlSelectionRequested(const QUrl &url)
 {
-    m_view->markUrlsAsSelected({url});
+    // We do not want to select any item here because there is no reason to assume that the user wants to edit the folder we are emerging from. BUG: 424723
+
     m_view->markUrlAsCurrent(url); // makes the item scroll into view
 }