From kstars-devel Sat Jun 05 22:29:43 2010 From: =?utf-8?q?M=C3=A9d=C3=A9ric=20Boquien?= Date: Sat, 05 Jun 2010 22:29:43 +0000 To: kstars-devel Subject: [Kstars-devel] KDE/kdeedu/kstars/kstars Message-Id: <20100605222943.4FCCAAC8CC () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kstars-devel&m=127577658226523 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@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() { _______________________________________________ Kstars-devel mailing list Kstars-devel@kde.org https://mail.kde.org/mailman/listinfo/kstars-devel