mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
port to KIO::createDefaultJobUiDelegate
This commit is contained in:
parent
d3617c06d4
commit
40cc5f665d
|
@ -42,7 +42,12 @@
|
|||
#include <KDualAction>
|
||||
#include <KFileItemListProperties>
|
||||
#include <KIO/CommandLauncherJob>
|
||||
#include <kio_version.h>
|
||||
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
|
||||
#include <KIO/JobUiDelegateFactory>
|
||||
#else
|
||||
#include <KIO/JobUiDelegate>
|
||||
#endif
|
||||
#include <KIO/OpenFileManagerWindowJob>
|
||||
#include <KIO/OpenUrlJob>
|
||||
#include <KJobWidgets>
|
||||
|
@ -1241,7 +1246,11 @@ void DolphinMainWindow::handleUrl(const QUrl& url)
|
|||
activeViewContainer()->setUrl(url);
|
||||
} else {
|
||||
m_lastHandleUrlOpenJob = new KIO::OpenUrlJob(url);
|
||||
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
|
||||
m_lastHandleUrlOpenJob->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
|
||||
#else
|
||||
m_lastHandleUrlOpenJob->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
|
||||
#endif
|
||||
m_lastHandleUrlOpenJob->setShowOpenOrExecuteDialog(true);
|
||||
|
||||
connect(m_lastHandleUrlOpenJob, &KIO::OpenUrlJob::mimeTypeFound, this,
|
||||
|
|
|
@ -24,7 +24,12 @@
|
|||
#endif
|
||||
#include <KFileItemActions>
|
||||
#include <KFilePlacesModel>
|
||||
#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>
|
||||
|
@ -758,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();
|
||||
|
|
Loading…
Reference in a new issue