summaryrefslogtreecommitdiffstats
path: root/source/kde/kde/patch/ktexteditor/c80f935c.patch
blob: 8cccfe3a95b0c406acb366cc9b8576b07fced2d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From c80f935c345de2e2fb10635202800839ca9697bf Mon Sep 17 00:00:00 2001
From: Christoph Cullmann <cullmann@kde.org>
Date: Thu, 20 Jan 2022 10:30:20 +0100
Subject: [PATCH] only execute diff in path

---
 src/dialogs/katedialogs.cpp | 5 +++--
 src/dialogs/katedialogs.h   | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/dialogs/katedialogs.cpp b/src/dialogs/katedialogs.cpp
index 5b949f36..63a58aee 100644
--- a/src/dialogs/katedialogs.cpp
+++ b/src/dialogs/katedialogs.cpp
@@ -1317,6 +1317,7 @@ KateModOnHdPrompt::KateModOnHdPrompt(KTextEditor::DocumentPrivate *doc, KTextEdi
     : QObject(doc)
     , m_doc(doc)
     , m_modtype(modtype)
+    , m_fullDiffPath(QStandardPaths::findExecutable(QStringLiteral("diff")))
     , m_proc(nullptr)
     , m_diffFile(nullptr)
     , m_diffAction(nullptr)
@@ -1334,7 +1335,7 @@ KateModOnHdPrompt::KateModOnHdPrompt(KTextEditor::DocumentPrivate *doc, KTextEdi
         m_message->addAction(aAutoReload, false);
         connect(aAutoReload, &QAction::triggered, this, &KateModOnHdPrompt::autoReloadTriggered);
 
-        if (!QStandardPaths::findExecutable(QStringLiteral("diff")).isEmpty()) {
+        if (!m_fullDiffPath.isEmpty()) {
             m_diffAction = new QAction(i18n("View &Difference"), this);
             m_diffAction->setIcon(QIcon::fromTheme(QStringLiteral("document-multiple")));
             m_diffAction->setToolTip(i18n("Shows a diff of the changes"));
@@ -1394,7 +1395,7 @@ void KateModOnHdPrompt::slotDiff()
     // Start a KProcess that creates a diff
     m_proc = new KProcess(this);
     m_proc->setOutputChannelMode(KProcess::MergedChannels);
-    *m_proc << QStringLiteral("diff") << QStringLiteral("-u") << QStringLiteral("-") << m_doc->url().toLocalFile();
+    *m_proc << m_fullDiffPath << QStringLiteral("-u") << QStringLiteral("-") << m_doc->url().toLocalFile();
     connect(m_proc, &KProcess::readyRead, this, &KateModOnHdPrompt::slotDataAvailable);
     connect(m_proc, &KProcess::finished, this, &KateModOnHdPrompt::slotPDone);
 
diff --git a/src/dialogs/katedialogs.h b/src/dialogs/katedialogs.h
index 80b611d9..e5574023 100644
--- a/src/dialogs/katedialogs.h
+++ b/src/dialogs/katedialogs.h
@@ -376,6 +376,7 @@ private:
     KTextEditor::DocumentPrivate *m_doc;
     QPointer<KTextEditor::Message> m_message;
     KTextEditor::ModificationInterface::ModifiedOnDiskReason m_modtype;
+    QString m_fullDiffPath;
     KProcess *m_proc;
     QTemporaryFile *m_diffFile;
     QAction *m_diffAction;
-- 
GitLab