[PATCH] Re: weirdo crash - solved

Ravikiran Rajagopal ravi at ee.eng.ohio-state.edu
Mon Feb 17 20:29:20 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
  I think I have found the root of the problem. If not, atleast a hack. The 
problem is in the idle time processing of the QApplication event loop. When 
your widgets are still alive (in your case, the config windows of winskin and 
charlatan), some idle time processing events are queued. However, after you 
select something else (in your case, other skin config), these widgets were 
destroyed and the idle time processing screws up.
  The solution is to call QApplication::sendPostedEvents() manually prior to 
deleting any KJanusWidget pages. (I have a complicated test case I can send 
you in a private mail if you are interested.) This is actually a problem, I 
believe, because of the new (Qt 3.1.x) event filter stuff for QWidgetStack. I 
am looking at fixing this at the KJanusWidget level. Until that happens, 
here's the patch necessary for Noatun (lines may be wrapped):

- --- pluginmodule.cpp  2003-02-17 15:17:02.000000000 -0500
+++ noatun/library/pluginmodule.cpp       2003-02-17 15:17:58.000000000 -0500
@@ -20,6 +20,7 @@

 #include <noatun/app.h>

+#include <kapplication.h>
 #include <kdialog.h>
 #include <kiconloader.h>
 #include <klocale.h>
@@ -269,6 +270,7 @@
        // Here are the ones loaded
        QValueList<NoatunLibraryInfo> loaded = 
napp->libraryLoader()->loaded();

+       kapp->sendPostedEvents();
        // Add the ones marked for loading
        for(QStringList::ConstIterator i = mAdded.begin(); i != mAdded.end(); 
++i)
                loaded.append(loader.getInfo(*i));

Hope this helps,
Ravi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+UUYgbI8Y8y0oVXcRAo8YAJ4n1b7VqNKO2ljLJ2+969aR0EzMdACff8Qw
yanJ/Mj5M/JrPIrDNvt6Nv8=
=O/x4
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list