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

List:       kde-commits
Subject:    kdebase/kate/app
From:       Christoph Cullmann <cullmann () kde ! org>
Date:       2005-04-24 16:29:19
Message-ID: 20050424162919.728CF62B () office ! kde ! org
[Download RAW message or body]

CVS commit by cullmann: 

here we go, now default window size is remembered too and one eventfiler case less


  M +1 -1      kateconfigdialog.cpp   1.111
  M +20 -14    katemainwindow.cpp   1.303
  M +9 -2      katemainwindow.h   1.99


--- kdebase/kate/app/kateconfigdialog.cpp  #1.110:1.111
@@ -417,5 +417,5 @@ void KateConfigDialog::slotApply()
     mainWindow->kateViewManager()->setShowFullPath( cb_fullPath->isChecked() ); // \
hm, stored 2 places :(  
-    mainWindow->saveOptions (config);
+    mainWindow->saveOptions ();
 
     // save plugin config !!

--- kdebase/kate/app/katemainwindow.cpp  #1.302:1.303
@@ -100,7 +100,4 @@ KateMainWindow::KateMainWindow (KConfig 
   greptool = 0;
 
-  // now the config
-  KConfig *config = kapp->config();
-
   // here we go, set some usable default sizes
   if (!initialGeometrySet())
@@ -133,4 +130,10 @@ KateMainWindow::KateMainWindow (KConfig 
       else // now fallback to hard defaults ;)
       {
+        // first try global app config
+        kapp->config()->setGroup ("MainWindow");
+        size.setWidth (kapp->config()->readNumEntry( QString::fromLatin1("Width \
%1").arg(desk.width()), 0 )); +        size.setHeight (kapp->config()->readNumEntry( \
QString::fromLatin1("Height %1").arg(desk.height()), 0 )); +
+        if (size.isEmpty())
         size = QSize (kMin (700, desk.width()), kMin(480, desk.height()));
       }
@@ -173,5 +176,5 @@ KateMainWindow::KateMainWindow (KConfig 
   connect(KateDocManager::self(),SIGNAL(documentCreated(Kate::Document \
*)),this,SLOT(slotDocumentCreated(Kate::Document *)));  
-  readOptions(config);
+  readOptions();
 
   if (console)
@@ -188,5 +191,10 @@ KateMainWindow::KateMainWindow (KConfig 
 KateMainWindow::~KateMainWindow()
 {
-  saveOptions(kapp->config());
+  // first, save our fallback window size ;)
+  kapp->config()->setGroup ("MainWindow");
+  saveWindowSize (kapp->config());
+
+  // save other options ;=)
+  saveOptions();
 
   ((KateApp *)kapp)->removeMainWindow (this);
@@ -396,6 +404,8 @@ void KateMainWindow::slotFileQuit()
 }
 
-void KateMainWindow::readOptions(KConfig *config)
+void KateMainWindow::readOptions ()
 {
+  KConfig *config = kapp->config ();
+
   config->setGroup("General");
   syncKonsole =  config->readBoolEntry("Sync Konsole", true);
@@ -411,6 +421,8 @@ void KateMainWindow::readOptions(KConfig
 }
 
-void KateMainWindow::saveOptions(KConfig *config)
+void KateMainWindow::saveOptions ()
 {
+  KConfig *config = kapp->config ();
+
   config->setGroup("General");
 
@@ -742,10 +754,4 @@ bool KateMainWindow::eventFilter( QObjec
     }
   }
-  if ( ( o == greptool || o == console ) &&
-      e->type() == QEvent::Hide && m_viewManager->activeView() )
-  {
-     m_viewManager->activeView()->setFocus();
-     return true;
-  }
 
   return KateMDI::MainWindow::eventFilter( o, e );

--- kdebase/kate/app/katemainwindow.h  #1.98:1.99
@@ -109,6 +109,13 @@ class KateMainWindow : public KateMDI::M
     bool queryClose();
 
-    void readOptions(KConfig *);
-    void saveOptions(KConfig *);
+    /**
+     * read some global options from katerc
+     */
+    void readOptions();
+
+    /**
+     * save some global options to katerc
+     */
+    void saveOptions();
 
     void dragEnterEvent( QDragEnterEvent * );


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

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