Fix recentStations settings
authorLuciano Montanaro <mikelima@cirulla.net>
Sat, 10 Dec 2011 19:02:36 +0000 (20:02 +0100)
committerLuciano Montanaro <mikelima@cirulla.net>
Tue, 27 Dec 2011 22:19:13 +0000 (23:19 +0100)
application/dataprovider.cpp

index 04397b6..1c36445 100644 (file)
@@ -64,11 +64,13 @@ void DataProvider::fetchStationSchedule(const QString &station)
     stationQueryReply = accessManager->post(request, query);
     connect(stationQueryReply, SIGNAL(finished()),
             SLOT(onStationScheduleFetched()));
-    settings->recentStations().push_front(station);
-    settings->recentStations().removeDuplicates();
-    if (settings->recentStations().count() > RECENT_STATIONS_MAX_COUNT) {
-        settings->recentStations().pop_back();
+    QStringList recentStations = settings->recentStations();
+    recentStations.push_front(station);
+    recentStations.removeDuplicates();
+    if (recentStations.count() > RECENT_STATIONS_MAX_COUNT) {
+        recentStations.pop_back();
     }
+    settings->setRecentStations(recentStations);
 }
 
 void DataProvider::updateStation()