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

List:       kde-commits
Subject:    branches/work/kdepim-3.5.5+/libkhalkhi/control
From:       Friedrich W. H. Kossebau <kossebau () kde ! org>
Date:       2007-02-23 14:19:01
Message-ID: 1172240341.599353.3332.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 636599 by kossebau:

create modal dialogs on the stack, not heap (as suggested by wise dfaure)

 M  +5 -7      branches/work/kdepim-3.5.5+/libkhalkhi/control/kservicelistitem.cpp  


--- branches/work/kdepim-3.5.5+/libkhalkhi/control/kservicelistitem.cpp \
#636598:636599 @@ -43,21 +43,19 @@
 {
     bool Result = false;
 
-    ServiceConfigDialog *Dialog = new ServiceConfigDialog( Parent, Service->name() \
); +    ServiceConfigDialog Dialog( Parent, Service->name() );
 
     QWidget *ConfigWidget =
-        KParts::ComponentFactory::createInstanceFromLibrary<QWidget>( \
configLibrary(Service).local8Bit().data(), Dialog ); +        \
KParts::ComponentFactory::createInstanceFromLibrary<QWidget>( \
configLibrary(Service).local8Bit().data(), &Dialog );  
     if( ConfigWidget )
     {
-        Dialog->setConfigWidget( ConfigWidget );
+        Dialog.setConfigWidget( ConfigWidget );
 
-        if( Dialog->exec() == QDialog::Accepted )
-            Result = Dialog->isDirty();
+        if( Dialog.exec() == QDialog::Accepted )
+            Result = Dialog.isDirty();
     }
 
-    delete Dialog;
-
     return Result;
 }
 


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

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