Commit a29261bc authored by David Faure's avatar David Faure
Browse files

Port away from kdeinitExec(). This requires upgrading the KF5 min req.

parent 879b2d0b
project(kmplot)
cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
set (QT_MIN_VERSION "5.6.0")
set (KF5_MIN_VERSION "5.32.0")
set (KF5_MIN_VERSION "5.69.0")
find_package (ECM 1.3.0 REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
......
......@@ -32,13 +32,14 @@
#include <KActionCollection>
#include <KConfig>
#include <KConfigGroup>
#include <KDialogJobUiDelegate>
#include <KLocalizedString>
#include <KMessageBox>
#include <KPluginLoader>
#include <KShortcutsDialog>
#include <KStandardAction>
#include <KToggleFullScreenAction>
#include <KToolInvocation>
#include <KIO/CommandLauncherJob>
#include "maindlg.h"
#include <kmplotprogress.h>
......@@ -180,9 +181,11 @@ void KmPlot::fileNew()
// About this function, the style guide
// says that it should open a new window if the document is _not_
// in its initial state. This is what we do here...
if ( !m_part->url().isEmpty() || isModified() )
//KToolInvocation::startServiceByDesktopName("kmplot");
KToolInvocation::kdeinitExec(QStringLiteral("kmplot"));
if ( !m_part->url().isEmpty() || isModified() ) {
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("kmplot"), this);
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->start();
}
}
void KmPlot::applyNewToolbarConfig()
......@@ -226,7 +229,9 @@ void KmPlot::fileOpen(const QUrl &url)
void KmPlot::openFileInNewWindow(const QUrl &url)
{
KToolInvocation::kdeinitExec(QStringLiteral("kmplot"), QStringList() << url.url());
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("kmplot"), {url.url()}, this);
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->start();
}
bool KmPlot::isModified()
......
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