From 5495508bc424e6937fff77d0d41f024101815208 Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Tue, 3 Jun 2003 23:04:06 +0000 Subject: [PATCH] Suspend handling of DCOP events until after initialization is done. This prevents JuK from crashing on startup while the MediaControl applet is running. CCMAIL:geiseri@voix.home.geiseri.com svn path=/trunk/kdemultimedia/juk/; revision=229541 --- main.cpp | 8 ++++++++ systemtray.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index da4d33f2..cd8482fa 100644 --- a/main.cpp +++ b/main.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "juk.h" @@ -69,7 +70,14 @@ int main(int argc, char *argv[]) KCmdLineArgs::addCmdLineOptions(options); Application a; + + // Here we do some DCOP locking of sorts to prevent incoming DCOP calls + // before JuK has finished its initialization. + + a.dcopClient()->suspend(); JuK *juk = new JuK(); + a.dcopClient()->resume(); + a.setMainWidget(juk); juk->show(); diff --git a/systemtray.cpp b/systemtray.cpp index 601dde38..5ac7c639 100644 --- a/systemtray.cpp +++ b/systemtray.cpp @@ -176,7 +176,7 @@ void SystemTray::wheelEvent(QWheelEvent *e) // I already know the type here, but this file doesn't (and I don't want it // to) know about the JuK class, so a static_cast won't work, and I was told // that a reinterpret_cast isn't portable when combined with multiple - // inheritance. + // inheritance. (This is why I don't check the result.) JuKIface *juk = dynamic_cast(parent()); -- GitLab