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

List:       kopete-devel
Subject:    [kopete-devel] KDE/kdenetwork/kopete/libkopete/ui
From:       Rafael Fernández López <ereslibre () kde ! org>
Date:       2007-10-24 16:45:32
Message-ID: 1193244332.394996.8595.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 728913 by ereslibre:

Thanks to Bille for the pointing out. This code does not need a static deleter or a \
k_global_static* definition, since when the parent is deleted this object will also \
be.  It won't leak since it will check if the object did exist before, so... This \
code was crashing because of several deletions over the same memory address, that \
means the  qobject deleter as well as the kcleanupglobalstatic destructor. No crashes \
on exit.

CCMAIL: kopete-devel@kde.org


 M  +7 -2      kopetestdaction.cpp  
 M  +2 -0      kopetestdaction.h  


--- trunk/KDE/kdenetwork/kopete/libkopete/ui/kopetestdaction.cpp #728912:728913
@@ -30,14 +30,13 @@
 #include <kwindowsystem.h>
 #include <kcmultidialog.h>
 #include <kicon.h>
-#include <kglobal.h>
 
 #include "kopetecontactlist.h"
 #include "kopetegroup.h"
 #include "kopeteuiglobal.h"
 #include <kactioncollection.h>
 
-K_GLOBAL_STATIC_WITH_ARGS(KSettings::Dialog, s_settingsDialog, \
(Kopete::UI::Global::mainWidget())) +KSettings::Dialog \
*KopetePreferencesAction::s_settingsDialog = 0L;  
 KopetePreferencesAction::KopetePreferencesAction( KActionCollection *parent, const \
char *name )  : KAction( KIcon(KStandardGuiItem::configure().iconName()), \
KStandardGuiItem::configure().text(), parent ) @@ -52,6 +51,12 @@
 
 void KopetePreferencesAction::slotShowPreferences()
 {
+	// No need of static deleter since when the parent is deleted, the settings dialog \
is deleted (ereslibre) +	if ( !s_settingsDialog )
+	{
+		s_settingsDialog = new KSettings::Dialog( Kopete::UI::Global::mainWidget() );
+	}
+
 	s_settingsDialog->show();
 
 	s_settingsDialog->raise();
--- trunk/KDE/kdenetwork/kopete/libkopete/ui/kopetestdaction.h #728912:728913
@@ -119,6 +119,8 @@
 
 	  protected slots:
 			 void slotShowPreferences();
+	  private:
+			 static KSettings::Dialog *s_settingsDialog;
 };
 
 #endif
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel


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

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