Files
haikuports/media-sound/amarok/patches/amarok-3.2.2.patchset
2025-03-05 09:20:41 +00:00

74 lines
1.8 KiB
Plaintext

From b6f554bd2a06087652e62fb6575c05ffb4a7ba1d Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Tue, 4 Mar 2025 18:27:52 +0100
Subject: Enable dbus-launch
diff --git a/src/main.cpp b/src/main.cpp
index b45510d..2b351b7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -19,6 +19,12 @@
#include "App.h"
#include "aboutdialog/OcsData.h"
+#ifdef Q_OS_HAIKU
+#include <QProcess>
+#include <QString>
+#include <QStringList>
+#endif
+
#include <KAboutData>
#include <KCrash>
#include <KDBusService>
@@ -41,6 +47,20 @@ AMAROK_EXPORT OcsData ocsData;
int main( int argc, char *argv[] )
{
+#ifdef Q_OS_HAIKU
+ if (getenv("DBUS_SESSION_BUS_PID") == NULL) {
+ QProcess dbusProcess;
+ QString exec = "/bin/dbus-launch";
+ QStringList params;
+ dbusProcess.start(exec, params);
+ dbusProcess.waitForFinished();
+ QString output(dbusProcess.readAllStandardOutput());
+
+ QStringList list = output.split("\n", Qt::SkipEmptyParts);
+ for (int i = 0; i < list.count(); i++)
+ putenv(list.at(i).toLatin1().data());
+ }
+#endif
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
@@ -372,6 +392,11 @@ int main( int argc, char *argv[] )
return 0;
}
+#ifdef Q_OS_HAIKU
+ QProcess kdedProcess;
+ kdedProcess.start("/bin/kded5", QStringList());
+#endif
+
// Rewrite default SIGINT and SIGTERM handlers
// to make amarok save current playlists during forced
// application termination (logout, Ctr+C in console etc.)
@@ -379,6 +404,12 @@ int main( int argc, char *argv[] )
signal( SIGTERM, &QCoreApplication::exit );
app.continueInit();
+#ifdef Q_OS_HAIKU
+ int status=app.exec();
+ kdedProcess.kill();
+ system("kill -3 $DBUS_SESSION_BUS_PID");
+ return status;
+#else
return app.exec();
+#endif
}
-
--
2.48.1