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
56
57
58
59
60
|
--- dolphin-26.04.1.orig/src/dolphinmainwindow.cpp 2026-05-08 16:03:03.575457241 -0400
+++ dolphin-26.04.1/src/dolphinmainwindow.cpp 2026-05-08 16:03:18.663015521 -0400
@@ -444,7 +444,7 @@
const int selectedUrlsCount = m_tabWidget->currentTabPage()->selectedItemsCount();
QAction *compareFilesAction = actionCollection()->action(QStringLiteral("compare_files"));
- if (selectedUrlsCount == 2) {
+ if (selectedUrlsCount == 2 || selectedUrlsCount == 3) {
compareFilesAction->setEnabled(isKompareInstalled());
} else {
compareFilesAction->setEnabled(false);
@@ -1326,7 +1326,7 @@
void DolphinMainWindow::compareFiles()
{
const KFileItemList items = m_tabWidget->currentTabPage()->selectedItems();
- if (items.count() != 2) {
+ if (items.count() != 2 && items.count() != 3) {
// The action is disabled in this case, but it could have been triggered
// via D-Bus, see https://bugs.kde.org/show_bug.cgi?id=325517
return;
@@ -1335,11 +1335,18 @@
QUrl urlA = items.at(0).url();
QUrl urlB = items.at(1).url();
- const QString program = QStringLiteral("kompare");
- const QStringList args({QStringLiteral("-c"), urlA.toDisplayString(QUrl::PreferLocalFile), urlB.toDisplayString(QUrl::PreferLocalFile)});
+ const QString program = QStringLiteral("meld");
+ QStringList args({urlA.toDisplayString(QUrl::PreferLocalFile), urlB.toDisplayString(QUrl::PreferLocalFile)});
+
+
+ if (items.count() == 3) {
+ QUrl urlC = items.at(2).url();
+ args.append(urlC.toDisplayString(QUrl::PreferLocalFile));
+ }
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(program, args, this);
- job->setDesktopName(QStringLiteral("org.kde.kompare"));
+ job->setDesktopName(QStringLiteral("org.gnome.meld"));
+
job->start();
}
@@ -2189,7 +2196,7 @@
// setup 'Tools' menu
QAction *compareFiles = actionCollection()->addAction(QStringLiteral("compare_files"));
compareFiles->setText(i18nc("@action:inmenu Tools", "Compare Files"));
- compareFiles->setIcon(QIcon::fromTheme(QStringLiteral("kompare")));
+ compareFiles->setIcon(QIcon::fromTheme(QStringLiteral("meld")));
compareFiles->setEnabled(false);
connect(compareFiles, &QAction::triggered, this, &DolphinMainWindow::compareFiles);
@@ -2961,7 +2968,7 @@
if (!initialized) {
// TODO: maybe replace this approach later by using a menu
// plugin like kdiff3plugin.cpp
- installed = !QStandardPaths::findExecutable(QStringLiteral("kompare")).isEmpty();
+ installed = !QStandardPaths::findExecutable(QStringLiteral("meld")).isEmpty();
initialized = true;
}
return installed;
|