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

List:       kde-commits
Subject:    KDE/kdepim/kleopatra
From:       Marc Mutz <mutz () kde ! org>
Date:       2010-11-02 16:05:35
Message-ID: 20101102160535.E1A11AC8AC () svn ! kde ! org
[Download RAW message or body]

SVN commit 1192331 by mutz:

MainWindow: set the mainwindow as parent window of all commands

 M  +9 -4      mainwindow_mobile.cpp  


--- trunk/KDE/kdepim/kleopatra/mainwindow_mobile.cpp #1192330:1192331
@@ -156,21 +156,26 @@
     explicit Private( MainWindow * qq );
     ~Private();
 
+    void start( Command * c ) {
+        c->setParentWidget( q );
+        c->start();
+    }
+
     template <typename T>
     void createAndStart() {
-        ( new T( this->currentView(), &this->controller ) )->start();
+        this->start( new T( this->currentView(), &this->controller ) );
     }
     template <typename T>
     void createAndStart( QAbstractItemView * view ) {
-        ( new T( view, &this->controller ) )->start();
+        start( new T( view, &this->controller ) );
     }
     template <typename T>
     void createAndStart( const QStringList & a ) {
-        ( new T( a, this->currentView(), &this->controller ) )->start();
+        start( new T( a, this->currentView(), &this->controller ) );
     }
     template <typename T>
     void createAndStart( const QStringList & a, QAbstractItemView * view ) {
-        ( new T( a, view, &this->controller ) )->start();
+        start( new T( a, view, &this->controller ) );
     }
 
     void closeAndQuit() {
[prev in list] [next in list] [prev in thread] [next in thread] 

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