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

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars
From:       Akarsh Simha <akarshsimha () gmail ! com>
Date:       2008-05-29 22:45:46
Message-ID: 1212101146.417575.20533.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 814315 by asimha:

Improvisations to the find dialog:

+ Adding a flag that keeps track of whether the List view was updated
after changing the text filter.

+ Ensure that the List view has been updated before calling accept()
or checking for existance of the selected object.

CCMAIL: kstars-devel@kde.org



 M  +9 -0      finddialog.cpp  
 M  +1 -0      finddialog.h  


--- trunk/KDE/kdeedu/kstars/kstars/finddialog.cpp #814314:814315
@@ -74,6 +74,8 @@
 
     // first create and paint dialog and then load list
     QTimer::singleShot(0, this, SLOT( init() ));
+
+    listFiltered = false;
 }
 
 FindDialog::~FindDialog() {
@@ -189,6 +191,8 @@
             button( Ok )->setEnabled( true );
         }
     }
+
+    listFiltered = true;
 }
 
 void FindDialog::filterByType( int /*f*/ ) {
@@ -219,6 +223,8 @@
             button( Ok )->setEnabled( true );
         }
     }
+
+    listFiltered = true;
 }
 
 SkyObject* FindDialog::selectedObject() const {
@@ -234,6 +240,7 @@
 }
 
 void FindDialog::enqueueSearch() {
+    listFiltered = false;
     if ( timer ) {
         timer->stop();
     } else {
@@ -246,6 +253,8 @@
 
 void FindDialog::slotOk() {
     //If no valid object selected, show a sorry-box.  Otherwise, emit accept()
+    if(!listFiltered)
+        filterByName();
     if ( selectedObject() == 0 ) {
         QString message = i18n( "No object named %1 found.", ui->SearchBox->text() );
         KMessageBox::sorry( 0, message, i18n( "Bad object name" ) );
--- trunk/KDE/kdeedu/kstars/kstars/finddialog.h #814314:814315
@@ -112,6 +112,7 @@
     QStringListModel *fModel;
     QSortFilterProxyModel* sortModel;
     QTimer* timer;
+    bool listFiltered;
 };
 
 #endif
[prev in list] [next in list] [prev in thread] [next in thread] 

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