Commit 3afeffb0 authored by Laurent Montel's avatar Laurent Montel
Browse files

Port away from deprecated KIO code

parent 40ef0f8a
Pipeline #220602 passed with stage
in 6 minutes and 41 seconds
......@@ -14,7 +14,11 @@
#include <QStandardPaths>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include <KIO/JobUiDelegateFactory>
#else
#include <KIO/JobUiDelegate>
#endif
#include <KIO/OpenUrlJob>
ListDependencyParamWidget::ListDependencyParamWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent)
......@@ -30,7 +34,11 @@ ListDependencyParamWidget::ListDependencyParamWidget(std::shared_ptr<AssetParame
m_infoMessage->hide();
connect(m_infoMessage, &KMessageWidget::linkActivated, this, [this](const QString &contents) {
auto *job = new KIO::OpenUrlJob(QUrl(contents));
#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
// methods like setRunExecutables, setSuggestedFilename, setEnableExternalBrowser, setFollowRedirections
// exist in both classes
job->start();
......
......@@ -31,7 +31,12 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include <KArchiveDirectory>
#include <KIO/DesktopExecParser>
#include <KIO/FileCopyJob>
#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 <KLineEdit>
#include <KMessageBox>
......@@ -1683,7 +1688,11 @@ void KdenliveSettingsDialog::initSpeechPage()
connect(m_configSpeech.models_url, &QLabel::linkActivated, this, [&](const QString &contents) {
qDebug() << "=== LINK CLICKED: " << contents;
auto *job = new KIO::OpenUrlJob(QUrl(contents));
#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
// methods like setRunExecutables, setSuggestedFilename, setEnableExternalBrowser, setFollowRedirections
// exist in both classes
job->start();
......
......@@ -24,7 +24,12 @@
#include <KColorScheme>
#include <KIO/DesktopExecParser>
#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 <KLocalizedString>
......@@ -1552,7 +1557,11 @@ void RenderWidget::setRenderStatus(const QString &dest, int status, const QStrin
}
if (item->data(1, PlayAfterRole).toBool()) {
auto *job = new KIO::OpenUrlJob(url);
#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();
}
}
......@@ -1960,7 +1969,11 @@ void RenderWidget::slotPlayRendering(QTreeWidgetItem *item, int)
return;
}
auto *job = new KIO::OpenUrlJob(QUrl::fromLocalFile(item->text(1)));
#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();
}
......
......@@ -41,7 +41,12 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include <kio_version.h>
#include <KIO/OpenUrlJob>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include <KIO/JobUiDelegateFactory>
#else
#include <KIO/JobUiDelegate>
#endif
// Recommended MLT version
MyWizardPage::MyWizardPage(QWidget *parent)
......@@ -868,7 +873,11 @@ bool Wizard::isOk() const
void Wizard::slotOpenManual()
{
auto *job = new KIO::OpenUrlJob(QUrl(QStringLiteral("https://docs.kdenlive.org/troubleshooting/installation_troubleshooting.html")));
#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
// methods like setRunExecutables, setSuggestedFilename, setEnableExternalBrowser, setFollowRedirections
// exist in both classes
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