[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    new_kcm_code: kdelibs/kutils
From:       Frans Englich <frans.englich () telia ! com>
Date:       2004-11-13 15:16:18
Message-ID: 20041113151618.1D12016C94 () office ! kde ! org
[Download RAW message or body]

CVS commit by englich: 

Deregister modules when dialog is hidden, & prettify.


  M +1 -0      kcmoduleloader.h   1.17.2.6
  M +23 -11    kcmultidialog.cpp   1.51.2.3
  M +12 -2     kcmultidialog.h   1.31.4.3


--- kdelibs/kutils/kcmoduleloader.h  #1.17.2.5:1.17.2.6
@@ -38,4 +38,5 @@ class KLibLoader;
  * 
  * @author Matthias Hoelzer-Kluepfel <mhk@kde.org>
+ * @author Frans Englich <frans.englich@telia.com>
  * @since 3.2
  * @internal

--- kdelibs/kutils/kcmultidialog.cpp  #1.51.2.2:1.51.2.3
@@ -22,24 +22,23 @@
 */
 
-#include <qhbox.h>
 #include <qcursor.h>
+#include <qhbox.h>
+#include <qlayout.h>
 
-#include <klocale.h>
-#include <kstdguiitem.h>
+#include <kaboutdata.h>
+#include <kapplication.h>
 #include <kdebug.h>
 #include <kiconloader.h>
-#include <kmessagebox.h>
 #include <klibloader.h>
-#include <kapplication.h>
-#include <krun.h>
+#include <klocale.h>
+#include <kmessagebox.h>
 #include <kprocess.h>
-#include <kaboutdata.h>
+#include <krun.h>
+#include <kstdguiitem.h>
 
-#include "kcmultidialog.h"
-#include "kcmultidialog.moc"
 #include "kcmoduleloader.h"
 #include "kcmoduleproxy.h"
-#include <assert.h>
-#include <qlayout.h>
+#include "kcmultidialog.h"
+#include "kcmultidialog.moc"
 
 class KCMultiDialog::KCMultiDialogPrivate
@@ -87,4 +86,5 @@ KCMultiDialog::KCMultiDialog( int dialog
 inline void KCMultiDialog::init()
 {
+    connect( this, SIGNAL( finished()), SLOT( dialogClosed()));
     showButton( User1, false );
     showButton( User2, false );
@@ -379,4 +379,16 @@ void KCMultiDialog::rootExit()
 }
 
+void KCMultiDialog::dialogClosed()
+{
+    kdDebug(710) << k_funcinfo << endl;
+
+    /* If we don't delete them, the DCOP registration stays, and trying to load the \
KCMs  +     * in other situations will lead to "module already loaded in Foo," while \
to the user  +     * doesn't appear so(the dialog is hidden) */
+    ModuleList::Iterator end = m_modules.end();
+    for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
+            ( *it ).kcm->deleteClient();
+}
+
 
 // vim: sw=4 et sts=4

--- kdelibs/kutils/kcmultidialog.h  #1.31.4.2:1.31.4.3
@@ -27,6 +27,6 @@
 
 #include <kdialogbase.h>
-#include <kservice.h>
 #include <klocale.h>
+#include <kservice.h>
 
 class KCModuleProxy;
@@ -67,5 +67,6 @@ public:
      *        the dialog is open.
      */
-    KCMultiDialog( int dialogFace, const QString & caption, QWidget * parent = 0, \
const char * name = 0, bool modal = false ); +    KCMultiDialog( int dialogFace, \
const QString & caption, QWidget * parent = 0,  +            const char * name = 0, \
bool modal = false );  
 
@@ -237,4 +239,12 @@ private:
     void apply();
 
+    /**
+     *
+     * Called when the dialog is hidden. It unregisters the modules,
+     * such that they don't hinder the same modules to be opened in 
+     * another application.
+     */
+    void dialogClosed();
+
     struct CreatedModule
     {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic