Files
haikuports/net-p2p/ktorrent/patches/ktorrent-25.12.0.patchset
Schrijvers Luc 3a98af918e KDE_internet, bump to 25.12.0 (#13462)
NeoChat bumped to 25.08.3, latest version crashes
2025-12-22 14:19:45 +01:00

322 lines
8.8 KiB
Plaintext

From 38551d99b4b41c528ac8ab847a353ea23c9d5470 Mon Sep 17 00:00:00 2001
From: Luc Schrijvers <begasus@gmail.com>
Date: Fri, 21 Mar 2025 08:31:49 +0100
Subject: Fix build errors for Qt6DBus
diff --git a/libktcore/CMakeLists.txt b/libktcore/CMakeLists.txt
index 551ad7d..a8e3726 100644
--- a/libktcore/CMakeLists.txt
+++ b/libktcore/CMakeLists.txt
@@ -69,6 +69,7 @@ target_link_libraries(ktcore PUBLIC
KF6::Parts
KTorrent6
KF6::XmlGui
+ Qt6::DBus
)
if (BUILD_TESTING)
diff --git a/libktcore/dbus/dbus.cpp b/libktcore/dbus/dbus.cpp
index d840bd3..4ea2bc4 100644
--- a/libktcore/dbus/dbus.cpp
+++ b/libktcore/dbus/dbus.cpp
@@ -4,7 +4,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <QDBusConnection>
+#include <QtDBus/QDBusConnection>
#include <QFile>
#include <QTimer>
diff --git a/libktcore/dbus/dbusgroup.cpp b/libktcore/dbus/dbusgroup.cpp
index 6b6a159..33bbc77 100644
--- a/libktcore/dbus/dbusgroup.cpp
+++ b/libktcore/dbus/dbusgroup.cpp
@@ -4,7 +4,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <QDBusConnection>
+#include <QtDBus/QDBusConnection>
#include "dbusgroup.h"
#include <groups/group.h>
diff --git a/libktcore/dbus/dbussettings.cpp b/libktcore/dbus/dbussettings.cpp
index c436778..7c08045 100644
--- a/libktcore/dbus/dbussettings.cpp
+++ b/libktcore/dbus/dbussettings.cpp
@@ -6,7 +6,7 @@
#include "dbussettings.h"
#include "settings.h"
-#include <QDBusConnection>
+#include <QtDBus/QDBusConnection>
#include <interfaces/coreinterface.h>
diff --git a/libktcore/dbus/dbustorrent.cpp b/libktcore/dbus/dbustorrent.cpp
index 3dc8cda..bf31583 100644
--- a/libktcore/dbus/dbustorrent.cpp
+++ b/libktcore/dbus/dbustorrent.cpp
@@ -4,7 +4,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <QDBusConnection>
+#include <QtDBus/QDBusConnection>
#include <QThread>
#include <KLocalizedString>
diff --git a/libktcore/dbus/dbustorrentfilestream.cpp b/libktcore/dbus/dbustorrentfilestream.cpp
index 5ab50a5..16c77b4 100644
--- a/libktcore/dbus/dbustorrentfilestream.cpp
+++ b/libktcore/dbus/dbustorrentfilestream.cpp
@@ -8,7 +8,7 @@
#include <algorithm>
-#include <QDBusConnection>
+#include <QtDBus/QDBusConnection>
#include <util/sha1hash.h>
namespace kt
--
2.48.1
From 981081fb2139b1191f1825eb5783f49cbb027e3a Mon Sep 17 00:00:00 2001
From: Luc Schrijvers <begasus@gmail.com>
Date: Fri, 21 Mar 2025 10:16:21 +0100
Subject: Disable KGlobalAccel for Haiku
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77c65c5..2472414 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,7 +55,6 @@ find_package(KF6 ${KF_MIN_VERSION} REQUIRED
CoreAddons
Crash
DBusAddons
- GlobalAccel
I18n
IconThemes
KIO
@@ -69,6 +68,7 @@ find_package(KF6 ${KF_MIN_VERSION} REQUIRED
XmlGui
OPTIONAL_COMPONENTS
DocTools
+ GlobalAccel
)
find_package(Qt6Core5Compat ${QT_MIN_VERSION})
@@ -96,6 +96,16 @@ if(KF6TextWidgets_FOUND)
set(HAVE_KF6TextWidgets 1)
endif()
+find_package(KF6GlobalAccel ${KF_MIN_VERSION})
+set_package_properties(KF6GlobalAccel
+ PROPERTIES
+ TYPE OPTIONAL
+ PURPOSE "Required for global shortcuts"
+)
+if(KF6GlobalAccel_FOUND)
+ set(HAVE_KF6GlobalAccel 1)
+endif()
+
find_package(KF6ItemViews ${KF_MIN_VERSION})
set_package_properties(KF6ItemViews
PROPERTIES
diff --git a/ktorrent/CMakeLists.txt b/ktorrent/CMakeLists.txt
index 582846c..a773df5 100644
--- a/ktorrent/CMakeLists.txt
+++ b/ktorrent/CMakeLists.txt
@@ -106,7 +106,6 @@ target_link_libraries(ktorrent_app
KF6::ConfigCore
KF6::ConfigGui
KF6::DBusAddons
- KF6::GlobalAccel
KF6::I18n
KF6::IconThemes
KF6::KIOCore
@@ -121,6 +120,12 @@ target_link_libraries(ktorrent_app
KF6::Crash
)
+if(KF6GlobalAccel_FOUND)
+target_link_libraries(ktorrent_app
+ KF6::GlobalAccel
+)
+endif()
+
install(TARGETS ktorrent_app ${INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.ktorrent.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
install(FILES ktorrentui.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/ktorrent )
diff --git a/ktorrent/gui.cpp b/ktorrent/gui.cpp
index 07ba368..f6aa4d9 100644
--- a/ktorrent/gui.cpp
+++ b/ktorrent/gui.cpp
@@ -17,7 +17,9 @@
#include <KConfig>
#include <KEditToolBar>
#include <KFileWidget>
-#include <KGlobalAccel>
+#ifdef HAVE_KF6GlobalAccel
+ #include <KGlobalAccel>
+#endif
#include <KIO/Job>
#include <KIO/JobUiDelegate>
#include <KMessageBox>
@@ -399,7 +401,9 @@ void GUI::setupActions()
show_kt_action = new QAction(QIcon::fromTheme(QStringLiteral("kt-show-hide")), i18n("Show/Hide KTorrent"), this);
connect(show_kt_action, &QAction::triggered, this, &GUI::showOrHide);
ac->addAction(QStringLiteral("show_kt"), show_kt_action);
+#ifdef HAVE_KF6GlobalAccel
KGlobalAccel::setGlobalShortcut(show_kt_action, QKeySequence(Qt::ALT | Qt::SHIFT | Qt::Key_T));
+#endif
setStandardToolBarMenuEnabled(true);
}
diff --git a/ktorrent/torrentactivity.cpp b/ktorrent/torrentactivity.cpp
index 6f72181..c554ff8 100644
--- a/ktorrent/torrentactivity.cpp
+++ b/ktorrent/torrentactivity.cpp
@@ -12,7 +12,9 @@
#include <KActionCollection>
#include <KComboBox>
#include <KConfigGroup>
-#include <KGlobalAccel>
+#ifdef HAVE_KF6GlobalAccel
+ #include <KGlobalAccel>
+#endif
#include <KLocalizedString>
#include <KToggleAction>
@@ -122,7 +124,9 @@ void TorrentActivity::setupActions()
ac->addAction(QStringLiteral("queue_suspend"), queue_suspend_action);
ac->setDefaultShortcut(queue_suspend_action, QKeySequence(Qt::SHIFT | Qt::Key_P));
queue_suspend_action->setToolTip(i18n("Suspend all running torrents"));
+#ifdef HAVE_KF6GlobalAccel
KGlobalAccel::setGlobalShortcut(queue_suspend_action, QKeySequence(Qt::ALT | Qt::SHIFT | Qt::Key_P));
+#endif
connect(queue_suspend_action, &KToggleAction::toggled, this, &TorrentActivity::suspendQueue);
show_group_view_action = new KToggleAction(QIcon::fromTheme(QStringLiteral("view-list-tree")), i18n("Group View"), this);
--
2.48.1
From 2a8c9ca944198a3715f4601e6b3b1bfe3b3df392 Mon Sep 17 00:00:00 2001
From: Luc Schrijvers <begasus@gmail.com>
Date: Fri, 21 Mar 2025 09:52:25 +0100
Subject: Disable KDBusService
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2472414..5acb32f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,7 +54,6 @@ find_package(KF6 ${KF_MIN_VERSION} REQUIRED
ConfigWidgets
CoreAddons
Crash
- DBusAddons
I18n
IconThemes
KIO
@@ -68,6 +67,7 @@ find_package(KF6 ${KF_MIN_VERSION} REQUIRED
XmlGui
OPTIONAL_COMPONENTS
DocTools
+ DBusAddons
GlobalAccel
)
@@ -96,6 +96,16 @@ if(KF6TextWidgets_FOUND)
set(HAVE_KF6TextWidgets 1)
endif()
+find_package(KF6DBusAddons ${KF_MIN_VERSION})
+set_package_properties(KF6DBusAddons
+ PROPERTIES
+ TYPE OPTIONAL
+ PURPOSE "Required for KTorrent's dbus services"
+)
+if(KF6DBusAddons)
+ set(HAVE_KF6DBusAddons 1)
+endif()
+
find_package(KF6GlobalAccel ${KF_MIN_VERSION})
set_package_properties(KF6GlobalAccel
PROPERTIES
diff --git a/ktorrent/CMakeLists.txt b/ktorrent/CMakeLists.txt
index a773df5..03778bc 100644
--- a/ktorrent/CMakeLists.txt
+++ b/ktorrent/CMakeLists.txt
@@ -105,7 +105,6 @@ target_link_libraries(ktorrent_app
KF6::Crash
KF6::ConfigCore
KF6::ConfigGui
- KF6::DBusAddons
KF6::I18n
KF6::IconThemes
KF6::KIOCore
@@ -120,6 +119,12 @@ target_link_libraries(ktorrent_app
KF6::Crash
)
+if(KF6DBusAddons_FOUND)
+target_link_libraries(ktorrent_app
+ KF6::DBusAddons
+)
+endif()
+
if(KF6GlobalAccel_FOUND)
target_link_libraries(ktorrent_app
KF6::GlobalAccel
diff --git a/ktorrent/main.cpp b/ktorrent/main.cpp
index e1bcea2..9d645a2 100644
--- a/ktorrent/main.cpp
+++ b/ktorrent/main.cpp
@@ -24,7 +24,9 @@
#include <KAboutData>
#include <KConfigGroup>
#include <KCrash>
-#include <KDBusService>
+#ifdef HAVE_KF6DBusAddons
+ #include <KDBusService>
+#endif
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowSystem>
@@ -201,7 +203,9 @@ int main(int argc, char **argv)
}
}
+#ifdef HAVE_KF6DBusAddons
const KDBusService dbusService(KDBusService::Unique);
+#endif
#if 0 // ndef Q_WS_WIN
// need to grab lock after the fork call in start, otherwise this will not work properly
@@ -245,6 +249,7 @@ int main(int argc, char **argv)
if (!workingDirectory.isEmpty())
QDir::setCurrent(oldCurrent);
};
+#ifdef HAVE_KF6DBusAddons
QObject::connect(&dbusService, &KDBusService::activateRequested, handleCmdLine);
QObject::connect(&dbusService, &KDBusService::activateRequested, &widget, [&widget] {
if (!widget.isVisible()) {
@@ -254,6 +259,7 @@ int main(int argc, char **argv)
KWindowSystem::activateWindow(widget.windowHandle());
}
});
+#endif
handleCmdLine(app.arguments(), QString());
app.setQuitOnLastWindowClosed(false);
--
2.48.1