[Digikam-devel] extragear/graphics/digikam/digikam

Tom Albers tomalbers at kde.nl
Sun Aug 28 14:53:14 BST 2005


SVN commit 454279 by toma:

Save the size of the advanced search window. Could someone look if this is the right place and way to do this?
CCMAIL: digikam-devel at kde.org


 M  +14 -0     searchadvanceddialog.cpp  


--- trunk/extragear/graphics/digikam/digikam/searchadvanceddialog.cpp #454278:454279
@@ -30,6 +30,8 @@
 #include <qlabel.h>
 #include <qtimer.h>
 
+#include <kconfig.h>
+#include <kapplication.h>
 #include <kurl.h>
 #include <klocale.h>
 #include <kdebug.h>
@@ -46,6 +48,12 @@
     QWidget *page = new QWidget( this );
     setMainWidget(page);
 
+    KConfig* config=kapp->config();
+    config->setGroup("AdvancedSearch Settings");
+    int w = config->readNumEntry("Width", 500);
+    int h = config->readNumEntry("Height", 500);
+    resize(w,h);
+
     // two columns, one for the rules, one for the preview.
     QHBoxLayout* hbox = new QHBoxLayout( page );
     hbox->setSpacing( spacingHint() );
@@ -150,6 +158,12 @@
 
 SearchAdvancedDialog::~SearchAdvancedDialog()
 {
+    KConfig* config=kapp->config();
+    config->setGroup("AdvancedSearch Settings");
+    config->writeEntry("Width", width());
+    config->writeEntry("Height", height());
+    config->sync();
+
     delete m_timer;
 }
 



More information about the Digikam-devel mailing list