Commit 1b802ac4 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Use KTerminalLauncherJob as fallback for runCmd

parent 5ef70ab5
Pipeline #241589 passed with stage
in 21 minutes and 44 seconds
......@@ -53,6 +53,7 @@
#include <KPluginFactory>
#include <KXMLGUIFactory>
#include <kterminallauncherjob.h>
#include <ktexteditor_utils.h>
K_PLUGIN_FACTORY_WITH_JSON(KateBuildPluginFactory, "katebuildplugin.json", registerPlugin<KateBuildPlugin>();)
......@@ -1055,7 +1056,7 @@ void KateBuildView::slotRunAfterBuild()
if (!m_previousIndex.isValid()) {
return;
}
auto *projectPluginView = m_win->pluginView(QStringLiteral("kateprojectplugin"));
QObject *projectPluginView = m_win->pluginView(QStringLiteral("kateprojectplugin"));
QModelIndex idx = m_previousIndex;
idx = idx.siblingAtColumn(2);
const QString runCmd = idx.data().toString();
......@@ -1068,6 +1069,11 @@ void KateBuildView::slotRunAfterBuild()
}
if (projectPluginView) {
QMetaObject::invokeMethod(projectPluginView, "runCmdInTerminal", Q_ARG(QString, workDir), Q_ARG(QString, runCmd));
} else {
auto *job = new KTerminalLauncherJob(runCmd, this);
connect(job, &KJob::finished, job, &QObject::deleteLater);
job->setWorkingDirectory(workDir);
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