KDE/kdeedu/kstars/kstars/dialogs

View: New views
1 Messages — Rating Filter:   Alert me  

KDE/kdeedu/kstars/kstars/dialogs

by Khudyakov Alexey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SVN commit 1045845 by khudyakov:

Fix crash bug.

Location dialog crashed on construction due to use of invalid iterators

CCMAIL: kstars-devel@...

 M  +5 -6      locationdialog.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/dialogs/locationdialog.cpp #1045844:1045845
@@ -46,12 +46,11 @@
         ui->TZBox->addItem( KGlobal::locale()->formatNumber( (double)(i-12) ) );
 
     //Populate DSTRuleBox
-    QMap<QString, TimeZoneRule>::Iterator it = data->getRulebook().begin();
-    QMap<QString, TimeZoneRule>::Iterator itEnd = data->getRulebook().end();
-    for ( ; it != itEnd; ++it )
-        if ( it.key().length() )
-            ui->DSTRuleBox->addItem( it.key() );
-    
+    foreach( QString key, data->getRulebook().keys() ) {
+        if( !key.isEmpty() )
+            ui->DSTRuleBox->addItem( key );
+    }
+
     connect( this, SIGNAL( cancelClicked() ), this, SLOT( reject() ) );
     connect( ui->CityFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( filterCity() ) );
     connect( ui->ProvinceFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( filterCity() ) );
_______________________________________________
Kstars-devel mailing list
Kstars-devel@...
https://mail.kde.org/mailman/listinfo/kstars-devel