Skip to content

Commit

Permalink
Bump version + check favs for dead stations
Browse files Browse the repository at this point in the history
  • Loading branch information
sthocs committed Apr 26, 2019
1 parent 6b1d6ef commit a51f00b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion harbour-bikeme.pro
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ OTHER_FILES += harbour-bikeme.desktop \
qml/pages/db.js \
translations/*.ts

SAILFISHAPP_ICONS = 86x86 108x108 128x128 256x256
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172 256x256

CONFIG += sailfishapp_i18n

Expand Down
2 changes: 1 addition & 1 deletion qml/pages/About.qml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Regular users: Save your favourites stations and see their status directly on th
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.fontSizeExtraSmall
color: Theme.secondaryColor
text: "2014 - 2018 Sthocs"
text: "2014 - 2019 Sthocs"
}

Item {
Expand Down
14 changes: 14 additions & 0 deletions qml/pages/Favourites.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,26 @@ Page {

property string coverLabel: "Favourites"
property int nbRefreshingStations: 0
property int nbFavs: 0

property City city

StationsModel {
id: stations

onStationsLoaded: {
// Quick fix to remove invalid favs from DB
if (favouritesModel.count != nbFavs) {
console.log('Cleaning favourites DB...');
var favs = Db.getFavourites(city.identifier);
favs.forEach(function(fav) {
if (!stations.exists(fav.number)) {
console.log('Removing invalid station ' + fav.number);
Db.removeFavourite(city.identifier, fav.number);
}
});
}

if (!withDetails) {
favouritesModel.refreshAll();
}
Expand Down Expand Up @@ -201,6 +214,7 @@ Page {

Component.onCompleted: {
var favs = Db.getFavourites(city.identifier);
nbFavs = favs.length;
var numbers = [];
favs.forEach(function(fav) {
numbers.push(fav.number);
Expand Down
5 changes: 5 additions & 0 deletions rpm/harbour-bikeme.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* Thu Mar 15 2018 Sthocs <sthocs@hotmail.com> 0.9.2-1
- New translation: Dutch (Belgium)
- Fixed Moscow stations names
- Removed dead systems (Valence (fr) and Lorient)

* Thu Mar 15 2018 Sthocs <sthocs@hotmail.com> 0.9.1-1
- New translations: Dutch and Brazilian Portuguese
- Blinking "center position" icon while there is no GPS fix
Expand Down
5 changes: 3 additions & 2 deletions rpm/harbour-bikeme.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: harbour-bikeme
Summary: Find a bike with your Sailfish OS device!
Version: 0.9.1
Version: 0.9.2
Release: 1
Group: Qt/Qt
URL: https://openrepos.net/users/sthocs
Expand All @@ -27,8 +27,9 @@ Requires:
- qt5-qtdeclarative-import-positioning
- sailfishsilica-qt5 >= 0.10.9
Files:
- '%defattr(644,root,root,-)'
- '%{_datadir}/icons/hicolor/*/apps/%{name}.png'
- '%{_datadir}/applications/%{name}.desktop'
- '%{_datadir}/%{name}'
- '%{_bindir}'
- '%attr(755,-,-) %{_bindir}'
PkgBR: []
3 changes: 2 additions & 1 deletion src/parser/russia/parsermoscow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ QList<Station*> ParserMoscow::parseStationsList(QString allStations, bool withDe
QJsonObject stationJson = stationsArray[i].toObject();
Station* station = new Station();
station->number = stationJson["Id"].toString().toInt();
station->name = stationJson["Address"].toString(); // stationJson["Name"].toString();
station->name = stationJson["Name"].toString().length() > 0 ? // 2019-04-26: Name field is still present but empty...
stationJson["Name"].toString() : stationJson["Address"].toString();
station->address = stationJson["Address"].toString();
QJsonObject position = stationJson["Position"].toObject();
QGeoCoordinate coord(position["Lat"].toDouble(), position["Lon"].toDouble());
Expand Down

0 comments on commit a51f00b

Please sign in to comment.