[Kstars-devel] KDE/kdeedu/kstars/kstars

Médéric Boquien mboquien at free.fr
Sun Jun 6 00:29:43 CEST 2010


SVN commit 1134966 by mboquien:

Ever wondered why kstars default location was Greenville, SC instead of Greenwich England? Apparently the list sorting messed up the index. Now we just search for the right item in the list based on its name.

CCMAIL: kstars-devel at kde.org


 M  +1 -3      kswizard.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/kswizard.cpp #1134965:1134966
@@ -120,12 +120,10 @@
 
     //Populate the CityListBox
     //flag the ID of the current City
-    int index = 0;
     foreach ( GeoLocation *loc, data->getGeoList() ) {
         location->CityListBox->insertItem( loc->fullName() );
         filteredCityList.append( loc );
         if ( loc->fullName() == data->geo()->fullName() ) {
-            index = data->getGeoList().indexOf( loc );
             Geo = loc;
         }
     }
@@ -133,7 +131,7 @@
     //Sort alphabetically
     location->CityListBox->sort();
     //preset to current city
-    location->CityListBox->setCurrentItem( index );
+    location->CityListBox->setCurrentItem( location->CityListBox->findItem(QString(data->geo()->fullName()) ) );
 }
 
 void KSWizard::slotChangeCity() {


More information about the Kstars-devel mailing list