]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Don't use QIcon::Selected state for selected icon
[dolphin.git] / src / dolphinviewcontainer.cpp
index dc9b4538fcd13d56d5d3c4d6818f7f69c3d64e69..f473752dc11af6de163e80cfcb443a20d28fd977 100644 (file)
@@ -90,7 +90,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     KUrlComboBox* editor = m_urlNavigator->editor();
     editor->setCompletionMode(KCompletion::CompletionMode(settings->urlCompletionMode()));
 
-    m_emptyTrashButton = new QPushButton(QIcon::fromTheme(QStringLiteral("user-trash")), "&Empty Trash", this);
+    m_emptyTrashButton = new QPushButton(QIcon::fromTheme(QStringLiteral("user-trash")), i18nc("@action:button", "Empty Trash"), this);
     m_emptyTrashButton->setFlat(true);
     connect(m_emptyTrashButton, &QPushButton::clicked, this, [this]() { Trash::empty(this); });
     connect(&Trash::instance(), &Trash::emptinessChanged, m_emptyTrashButton, &QPushButton::setDisabled);
@@ -108,6 +108,14 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     m_messageWidget->setCloseButtonVisible(true);
     m_messageWidget->hide();
 
+#ifndef Q_OS_WIN
+    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);
+    }
+#endif
+
     m_view = new DolphinView(url, this);
     connect(m_view, &DolphinView::urlChanged,
             m_urlNavigator, &KUrlNavigator::setLocationUrl);
@@ -153,12 +161,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     connect(m_urlNavigator, &KUrlNavigator::returnPressed,
             this, &DolphinViewContainer::slotReturnPressed);
     connect(m_urlNavigator, &KUrlNavigator::urlsDropped, this, [=](const QUrl &destination, QDropEvent *event) {
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 37, 0)
         m_view->dropUrls(destination, event, m_urlNavigator->dropWidget());
-#else
-        // TODO: remove as soon as we can hard-depend of KF5 >= 5.37
-        m_view->dropUrls(destination, event, m_view);
-#endif
     });
 
     connect(m_view, &DolphinView::directoryLoadingCompleted, this, [this]() {