X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/2e588733c759cccd2d86e34a3a394b9a8ab0c800..40cc5f665d:/src/dolphinviewcontainer.cpp?ds=inline diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index d69aa119f..1930226d8 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -24,23 +24,25 @@ #endif #include #include -#include -#include +#include +#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0) +#include +#else #include +#endif +#include #include #include #include #include -#include +#include #include #include #include -#include -#include #include #include -#include +#include // An overview of the widgets contained by this ViewContainer struct LayoutStructure { @@ -379,13 +381,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 +763,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();