Commit f72c3036 authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Port away from KRun

parent 0bf959d6
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "pulldialog.h" #include "pulldialog.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <KRun>
#include <KShell> #include <KShell>
#include <KPluginFactory> #include <KPluginFactory>
...@@ -438,7 +437,7 @@ void FileViewGitPlugin::showLocalChanges() ...@@ -438,7 +437,7 @@ void FileViewGitPlugin::showLocalChanges()
{ {
Q_ASSERT(!m_contextDir.isEmpty()); Q_ASSERT(!m_contextDir.isEmpty());
KRun::runCommand(QLatin1String("git difftool --dir-diff ."), nullptr, m_contextDir); runCommand(QLatin1String("git difftool --dir-diff ."));
} }
void FileViewGitPlugin::showDiff(const QUrl &link) void FileViewGitPlugin::showDiff(const QUrl &link)
...@@ -446,7 +445,7 @@ void FileViewGitPlugin::showDiff(const QUrl &link) ...@@ -446,7 +445,7 @@ void FileViewGitPlugin::showDiff(const QUrl &link)
if (link.scheme() != QLatin1String("rev")) { if (link.scheme() != QLatin1String("rev")) {
return; return;
} }
KRun::runCommand(QStringLiteral("git difftool --dir-diff %1^ %1").arg(link.path()), nullptr, m_contextDir); runCommand(QStringLiteral("git difftool --dir-diff %1^ %1").arg(link.path()));
} }
void FileViewGitPlugin::log() void FileViewGitPlugin::log()
...@@ -522,7 +521,7 @@ void FileViewGitPlugin::merge() ...@@ -522,7 +521,7 @@ void FileViewGitPlugin::merge()
{ {
Q_ASSERT(!m_contextDir.isEmpty()); Q_ASSERT(!m_contextDir.isEmpty());
KRun::runCommand(QStringLiteral("git mergetool"), nullptr, m_contextDir); runCommand(QStringLiteral("git mergetool"));
} }
void FileViewGitPlugin::checkout() void FileViewGitPlugin::checkout()
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#define FILEVIEWGITPLUGIN_H #define FILEVIEWGITPLUGIN_H
#include <Dolphin/KVersionControlPlugin> #include <Dolphin/KVersionControlPlugin>
#include <KIO/CommandLauncherJob>
#include <KJobUiDelegate>
#include <KDialogJobUiDelegate>
#include <KFileItem> #include <KFileItem>
...@@ -129,6 +132,15 @@ private: ...@@ -129,6 +132,15 @@ private:
//Current targets. m_contextItems is used if and only if m_contextDir is empty. //Current targets. m_contextItems is used if and only if m_contextDir is empty.
mutable QString m_contextDir; mutable QString m_contextDir;
mutable KFileItemList m_contextItems; mutable KFileItemList m_contextItems;
// Utility method, because the method call is the same except for the command
void runCommand(const QString &command)
{
auto *job = new KIO::CommandLauncherJob(command);
job->setWorkingDirectory(m_currentDir);
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->start();
}
}; };
#endif // FILEVIEWGITPLUGIN_H #endif // FILEVIEWGITPLUGIN_H
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "fileviewsvnpluginsettings.h" #include "fileviewsvnpluginsettings.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <KRun>
#include <KShell> #include <KShell>
#include <KPluginFactory> #include <KPluginFactory>
......
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