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

List:       kde-commits
Subject:    KDE/kdebase/kate/app
From:       Christoph Cullmann <cullmann () kde ! org>
Date:       2007-01-30 19:18:12
Message-ID: 1170184692.556092.4206.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 628639 by cullmann:

fix plugin session restore for mainwindows, ID is now ok in constructor already ;)

 M  +6 -2      kateapp.cpp  
 M  +8 -0      kateapp.h  
 M  +4 -0      katemainwindow.cpp  


--- trunk/KDE/kdebase/kate/app/kateapp.cpp #628638:628639
@@ -384,8 +384,6 @@
 KateMainWindow *KateApp::newMainWindow (KConfig *sconfig, const QString &sgroup)
 {
   KateMainWindow *mainWindow = new KateMainWindow (sconfig, sgroup);
-  m_mainWindows.push_back (mainWindow);
-  m_mainWindowsInterfaces.push_back (mainWindow->mainWindow());
 
   if ((mainWindows() > 1) && \
                m_mainWindows[m_mainWindows.count()-2]->viewManager()->activeView())
     mainWindow->viewManager()->activateView ( \
m_mainWindows[m_mainWindows.count()-2]->viewManager()->activeView()->document() ); @@ \
-399,6 +397,12 @@  return mainWindow;
 }
 
+void KateApp::addMainWindow (KateMainWindow *mainWindow)
+{
+  m_mainWindows.push_back (mainWindow);
+  m_mainWindowsInterfaces.push_back (mainWindow->mainWindow());
+}
+
 void KateApp::removeMainWindow (KateMainWindow *mainWindow)
 {
   m_mainWindowsInterfaces.removeAll(mainWindow->mainWindow());
--- trunk/KDE/kdebase/kate/app/kateapp.h #628638:628639
@@ -150,7 +150,15 @@
     KateMainWindow *newMainWindow (KConfig *sconfig = 0, const QString &sgroup = \
"");  
     /**
+     * add the mainwindow given
+     * should be called in mainwindow constructor
+     * @param mainWindow window to remove
+     */
+    void addMainWindow (KateMainWindow *mainWindow);
+
+    /**
      * removes the mainwindow given, DOES NOT DELETE IT
+     * should be called in mainwindow destructor
      * @param mainWindow window to remove
      */
     void removeMainWindow (KateMainWindow *mainWindow);
--- trunk/KDE/kdebase/kate/app/katemainwindow.cpp #628638:628639
@@ -167,6 +167,9 @@
 
   kDebug() << "****************************************************************************" \
<< sconfig << endl;  
+  // register mainwindow in app
+  KateApp::self()->addMainWindow (this);
+
   // enable plugin guis
   KatePluginManager::self()->enableAllPluginsGUI (this, sconfig);
 
@@ -203,6 +206,7 @@
   // save other options ;=)
   saveOptions();
 
+  // unregister mainwindow in app
   KateApp::self()->removeMainWindow (this);
 
   // disable all plugin guis, delete all pluginViews


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

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