]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Change the full row highlight checkbox to radiobuttons
[dolphin.git] / src / dolphinviewcontainer.cpp
index d69aa119f49727728c7425449adad69492f96a41..0d2dcdafe53feac583c98dc9d620a583901816ce 100644 (file)
@@ -14,8 +14,6 @@
 #include "search/dolphinsearchbox.h"
 #include "selectionmode/topbar.h"
 #include "statusbar/dolphinstatusbar.h"
-#include "views/viewmodecontroller.h"
-#include "views/viewproperties.h"
 #include "dolphin_detailsmodesettings.h"
 
 #include <KActionCollection>
 #endif
 #include <KFileItemActions>
 #include <KFilePlacesModel>
-#include <KIO/PreviewJob>
-#include <KIO/OpenUrlJob>
+#include <kio_version.h>
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
+#include <KIO/JobUiDelegateFactory>
+#else
 #include <KIO/JobUiDelegate>
+#endif
+#include <KIO/OpenUrlJob>
 #include <KLocalizedString>
 #include <KMessageWidget>
 #include <KProtocolManager>
 #include <KShell>
-#include <KUrlComboBox>
 
+#include <QDesktopServices>
 #include <QDropEvent>
 #include <QGridLayout>
 #include <QGuiApplication>
-#include <QLoggingCategory>
-#include <QMimeData>
 #include <QTimer>
 #include <QUrl>
-#include <QDesktopServices>
+#include <QRegularExpression>
 
 // An overview of the widgets contained by this ViewContainer
 struct LayoutStructure {
@@ -379,13 +379,14 @@ void DolphinViewContainer::setSelectionModeEnabled(bool enabled, KActionCollecti
     m_view->setSelectionModeEnabled(enabled);
 
     if (!enabled) {
+        if (!wasEnabled) {
+            return; // nothing to do here
+        }
         Q_CHECK_PTR(m_selectionModeTopBar); // there is no point in disabling selectionMode when it wasn't even enabled once.
         Q_CHECK_PTR(m_selectionModeBottomBar);
         m_selectionModeTopBar->setVisible(false, WithAnimation);
         m_selectionModeBottomBar->setVisible(false, WithAnimation);
-        if (wasEnabled) {
-            Q_EMIT selectionModeChanged(false);
-        }
+        Q_EMIT selectionModeChanged(false);
         return;
     }
 
@@ -760,7 +761,11 @@ void DolphinViewContainer::slotItemActivated(const KFileItem &item)
     }
 
     KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl(), item.mimetype());
-    job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoWarningHandlingEnabled, this));
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
+    job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
+#else
+    job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
+#endif
     job->setShowOpenOrExecuteDialog(true);
     connect(job, &KIO::OpenUrlJob::finished, this, &DolphinViewContainer::slotOpenUrlFinished);
     job->start();