Commit 5ec55602 authored by Laurent Montel's avatar Laurent Montel
Browse files

Port away from deprecated KIO code

parent 10cdb127
Pipeline #220958 passed with stage
in 7 minutes and 32 seconds
......@@ -24,7 +24,12 @@
#include <KFilePlacesModel>
#include <KHistoryComboBox>
#include <KIO/ApplicationLauncherJob>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include <KIO/JobUiDelegateFactory>
#else
#include <KIO/JobUiDelegate>
#endif
#include <KLocalizedString>
#include <KMessageBox>
#include <KSharedConfig>
......@@ -290,7 +295,11 @@ void KateFileBrowser::openWithMenuAction(QAction *a)
// If app is null, ApplicationLauncherJob will invoke the open-with dialog
auto *job = new KIO::ApplicationLauncherJob(app);
job->setUrls(list);
#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->start();
}
// END Public Slots
......
......@@ -20,7 +20,12 @@
#include <KIO/ApplicationLauncherJob>
#include <KIO/CopyJob>
#include <KIO/DeleteJob>
#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 <KLocalizedString>
#include <KMessageBox>
......@@ -458,7 +463,11 @@ void KateFileTree::slotOpenWithMenuAction(QAction *a)
// If app is null, ApplicationLauncherJob will invoke the open-with dialog
auto *job = new KIO::ApplicationLauncherJob(app);
job->setUrls(list);
#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->start();
}
......
......@@ -13,7 +13,12 @@
#include <KApplicationTrader>
#include <KIO/ApplicationLauncherJob>
#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 <KLocalizedString>
#include <KMoreTools>
......@@ -145,7 +150,11 @@ void KateProjectTreeViewContextMenu::exec(const QString &filename, const QModelI
// If app is null, ApplicationLauncherJob will invoke the open-with dialog
auto *job = new KIO::ApplicationLauncherJob(app);
job->setUrls({QUrl::fromLocalFile(filename)});
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, parent));
#else
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, parent));
#endif
job->start();
};
......
......@@ -38,7 +38,12 @@
#include <KHelpClient>
#include <KIO/ApplicationLauncherJob>
#include <KIO/Job>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include <KIO/JobUiDelegateFactory>
#else
#include <KIO/JobUiDelegate>
#endif
#include <KLocalizedString>
#include <KMessageBox>
#include <KMultiTabBar>
......@@ -978,7 +983,11 @@ void KateMainWindow::slotOpenWithMenuAction(QAction *a)
// If app is null, ApplicationLauncherJob will invoke the open-with dialog
auto *job = new KIO::ApplicationLauncherJob(app);
job->setUrls(list);
#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->start();
}
......
......@@ -12,7 +12,6 @@
#include "katedocmanager.h"
#include "katemainwindow.h"
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
......
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