Hi Niklas.
My idea is to:
Instead of QList of cities, I would like to use QMap of cities:
QMap<QString, TimeZone> citiesMap;
Where TimeZone will be struct, with following fields:
QString cityName; //localized city name
QString country; //localized country name
QTimeZone timeZone;
With using QMap, I don't need to reiterate whole container, and I
will receive city data very fast.
What do you think about that idea?
I need to learn how to connect Qt/C++ and QML to properly get data
from C++ code.
http://doc.qt.io/qt-4.8/qml-extending-tutorial-index.html
Best Regards
Bartosz
2015-08-03 20:57 GMT+02:00 Niklas Wenzel <nikwen.developer@xxxxxxxxx>:
Hi Bartosz,
I just came online on IRC but I couldn't find you there. That being
said, it's quite difficult for me at the moment to come online at
fixed times unless it's at the weekend.
Therefore, I'd really prefer using email. I'm just struggling with
seeing why (in the worst case) you can't use a for loop to iterate
over every entry of the city list and check if its id matches the
given one which you want to find out the city name for.
Cheers
Niklas
2015-08-02 23:42 GMT+02:00 Bartosz Kosiorek <gang65@xxxxxxxxxxxxxx>:
Hello Niklas.
Can we discuss about that on hangout or irc?
I would really get advice from you about that.
Best Regards
Bartosz
2015-08-02 14:00 GMT+02:00 Niklas Wenzel
<nikwen.developer@xxxxxxxxx>:
Hi Bartosz,
I really tried to understand this, but I fail to see what hinders
you from using the list to which I saw you have already added city
IDs for retrieving the city name.
What's the problem with writing a method which queries that model
for the city name?
Cheers,
Niklas
2015-07-31 22:30 GMT+02:00 Bartosz Kosiorek
<gang65@xxxxxxxxxxxxxx>:
Hello everyone,
In the Clock App, we maintain a list of about 250
popular/commonly used locations which have been translated to
various languages. The user sees this list when opening the
add-world-city page where he can choose which cities to add to
the main clock page. The cities he add are stored in the
user-database file.
Recently we found an issue in the Clock app that results in the
added user city names not being translated when switching the
system language. It became apparent that user added locations are
stored in the database as translated strings. Thereby when the
user switches the phone language, the previously translated
strings are retrieved from the database and shown in the UI in
the language previously used by the user.
Steps to reproduce the bug,
1. Assuming your phone is used with Language A, open clock app
and add few locations.
2. Change phone language to B.
3. Open Clock App
What happens:
4. Notice how the added cities are shown in Language A
What is expected:
4. Previously added cities are shown in Language B
Bug report:
https://bugs.launchpad.net/ubuntu-clock-app/+bug/1477492
The location is stored with following format:
"worldlocation":
{
"city": city,
"country": country,
"timezone": timezone
}
In that case "city" is the stored localized name. It is causing
the above issue.
My idea is to store the "cityID" instead of the localized "city".
"CityID" will be untranslated universal names like "london",
"berlin". I have created branch, in which I'm storing "cityId"
instead of localized city names. The idea is to then use this
"CityID" and then return the translated cityNames on the fly.
My question is how do I use the generic "cityID" to retrieve the
translated city names from the popular city location list
mentioned above? I understand the situation is a bit difficult to
understand. If you have any further questions about this
situation, I can try explaining in more detail.
Thanks in advance
Bartosz
--
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps
Post to : ubuntu-touch-coreapps@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps
More help : https://help.launchpad.net/ListHelp