File 0001-kinit_win-autostart.patch of Package mingw64-kdelibs4
--- a/kinit/kinit_win.cpp 2016-01-26 16:42:40.346823993 +0100
+++ b/kinit/kinit_win.cpp 2016-01-27 08:21:15.667762723 +0100
@@ -480,6 +480,31 @@
}
}
+bool triggerAutoStart(int phase)
+{
+ if (verbose)
+ fprintf(stderr, "trigger autostart phase %d\n", phase);
+ QDBusConnection bus = QDBusConnection::sessionBus();
+ QDBusInterface *iface = new QDBusInterface(QLatin1String("org.kde.klauncher"),
+ QLatin1String("/KLauncher"),
+ QLatin1String("org.kde.KLauncher"),
+ bus);
+ if (!iface->isValid()) {
+ if (verbose)
+ fprintf(stderr, "invalid interface org.kde.klauncher\n");
+ delete iface;
+ return false;
+ }
+ iface->call("autoStart", phase);
+ if (iface->lastError().isValid()) {
+ if (verbose)
+ fprintf(stderr,"could not call method autoSstark on interface org.kde.klauncher\n");
+ delete iface;
+ return false;
+ }
+ return true;
+}
+
int main(int argc, char **argv, char **envp)
{
pid_t pid = 0;
@@ -492,6 +517,7 @@
bool listAppsInDBus = false;
bool quitAppsOverDBus = false;
bool shutdown = false;
+ bool autostart = true;
/** Save arguments first... **/
char **safe_argv = (char **) malloc( sizeof(char *) * argc);
@@ -504,6 +530,8 @@
launch_klauncher = false;
if (strcmp(safe_argv[i], "--no-kded") == 0)
launch_kded = false;
+ if (strcmp(safe_argv[i], "--no-autostart") == 0)
+ autostart = false;
if (strcmp(safe_argv[i], "--suicide") == 0)
suicide = true;
#ifdef ENABLE_EXIT
@@ -531,6 +559,7 @@
printf(" --no-dbus do not start dbus-daemon\n");
printf(" --no-klauncher do not start klauncher\n");
printf(" --no-kded do not start kded\n");
+ printf(" --no-autostart do not trigger auto start support\n");
printf(" --shutdown safe shutdown of all running kde processes\n");
printf(" first over dbus, then using hard kill\n");
#ifdef ENABLE_SUICIDE
@@ -613,6 +642,11 @@
exit(1);
}
+ if (autostart)
+ triggerAutoStart(0);
+
+ if (autostart)
+ triggerAutoStart(1);
if (launch_kded && !processList.find(KDED_EXENAME))
{
@@ -637,6 +671,9 @@
}
}
+ if (autostart)
+ triggerAutoStart(2);
+
/** Free arguments **/
for(int i = 0; i < argc; i++)
{