Commit 1c6a39a9 authored by Laurent Montel's avatar Laurent Montel
Browse files

Port to KIO::createDefaultJobUiDelegate

parent 03d1d742
Pipeline #245932 passed with stage
in 5 minutes and 52 seconds
......@@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <KFileItem>
#include <KFileItemActions>
#include <KFileItemListProperties>
#include <KIO/ApplicationLauncherJob>
#include <KIO/JobUiDelegate>
#include <KIO/OpenFileManagerWindowJob>
#include <KIO/Paste>
......@@ -48,8 +49,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <KUrlMimeData>
#include <KXMLGUIClient>
#include <kio_version.h>
#include <KIO/ApplicationLauncherJob>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include <KIO/JobUiDelegateFactory>
#else
#include <KIO/JobUiDelegate>
#endif
// Local
#include "fileoperations.h"
......@@ -391,7 +395,11 @@ void FileOpsContextManagerItem::openWith(QAction *action)
// If service is null, ApplicationLauncherJob will invoke the open-with dialog
auto job = new KIO::ApplicationLauncherJob(service);
job->setUrls(list);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, mGroup));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, mGroup));
#endif
job->start();
}
......
......@@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include <QStandardPaths>
// KF
#include <KIO/ApplicationLauncherJob>
#include <KIO/DeleteJob>
#include <KLocalizedString>
#include <KMessageBox>
......@@ -35,8 +36,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include <KService>
#include <KStandardGuiItem>
#include <Solid/Device>
#include <KIO/ApplicationLauncherJob>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include <KIO/JobUiDelegateFactory>
#else
#include <KIO/JobUiDelegate>
#endif
// Local
#include "dialogpage.h"
......@@ -153,7 +158,11 @@ public:
} else {
auto job = new KIO::ApplicationLauncherJob(service);
job->setUrls({mThumbnailPage->destinationUrl()});
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
#endif
job->start();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment