Commit 4acb086d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without deprecated kf5.71 method

parent efc498d0
Pipeline #21441 passed with stage
in 19 minutes and 32 seconds
......@@ -91,7 +91,7 @@ add_definitions(-DTRANSLATION_DOMAIN=\"pimdataexporter\")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054700)
endif()
......
......@@ -34,7 +34,13 @@
#include <QPushButton>
#include <QVBoxLayout>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#else
#include <KRun>
#endif
#include <QFileDialog>
#include <QTemporaryDir>
#include <KTreeWidgetSearchLine>
......@@ -119,8 +125,15 @@ void ShowArchiveStructureDialog::slotOpenFile()
qCWarning(PIMDATAEXPORTERGUI_LOG) << "Impossible to copy file: " << currentItem->text(0);
return;
}
#if KIO_VERSION >= QT_VERSION_CHECK(5, 71, 0)
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(QUrl::fromLocalFile(fileName));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->setRunExecutables(false);
job->start();
#else
KRun *runner = new KRun(QUrl::fromLocalFile(fileName), this); // will delete itself
runner->setRunExecutables(false);
#endif
}
}
}
......
Markdown is supported
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