StelLocationMgr.hpp   StelLocationMgr.hpp 
skipping to change at line 30 skipping to change at line 30
#define _STELLOCATIONMGR_HPP_ #define _STELLOCATIONMGR_HPP_
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include <QString> #include <QString>
#include <QObject> #include <QObject>
#include <QMetaType> #include <QMetaType>
#include <QMap> #include <QMap>
typedef QList<StelLocation> LocationList; typedef QList<StelLocation> LocationList;
typedef QMap<QString,StelLocation> LocationMap; typedef QMap<QString,StelLocation> LocationMap;
typedef QMap<QByteArray,QByteArray> TimezoneNameMap;
//! @class StelLocationMgr //! @class StelLocationMgr
//! Manage the list of available location. //! Manage the list of available location.
class StelLocationMgr : public QObject class StelLocationMgr : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
//! Default constructor which loads the list of locations from the b ase and user location files. //! Default constructor which loads the list of locations from the b ase and user location files.
StelLocationMgr(); StelLocationMgr();
skipping to change at line 93 skipping to change at line 94
LocationMap pickLocationsInCountry(const QString country); LocationMap pickLocationsInCountry(const QString country);
public slots: public slots:
//! Return the StelLocation for a given string //! Return the StelLocation for a given string
//! Can match location name, or coordinates //! Can match location name, or coordinates
const StelLocation locationForString(const QString& s) const; const StelLocation locationForString(const QString& s) const;
//! Process answer from online lookup of IP address //! Process answer from online lookup of IP address
void changeLocationFromNetworkLookup(); void changeLocationFromNetworkLookup();
//! Check timezone string and return either the same or one that we
use in the Stellarium location database.
//! If timezone name starts with "UTC", always return unchanged.
//! This is required to store timezone names exactly as we know them
, and not mix ours and corrent-IANA spelling flavour.
static QString sanitizeTimezoneStringForLocationDB(QString tzString)
;
//! Attempt to translate a timezone name from those used in Stellari
um's location database to a name which is known
//! to Qt at runtime as result of QTimeZone::availableTimeZoneIds().
That list may be updated by OS anytime and is known to differ
//! between OSes. Some spellings may be different, or in some cases
some names get simply translated to "UTC+HH:MM" style.
//! The empty string gets translated to "UTC".
static QString sanitizeTimezoneStringFromLocationDB(QString dbString
);
signals: signals:
//! Can be used to detect changes to the full location list //! Can be used to detect changes to the full location list
//! i.e. when the user added or removed locations //! i.e. when the user added or removed locations
void locationListChanged(); void locationListChanged();
private: private:
void generateBinaryLocationFile(const QString& txtFile, bool isUserL ocation, const QString& binFile) const; void generateBinaryLocationFile(const QString& txtFile, bool isUserL ocation, const QString& binFile) const;
//! Load cities from a file //! Load cities from a file
static LocationMap loadCities(const QString& fileName, bool isUserLo cation); static LocationMap loadCities(const QString& fileName, bool isUserLo cation);
static LocationMap loadCitiesBin(const QString& fileName); static LocationMap loadCitiesBin(const QString& fileName);
//! The list of all loaded locations //! The list of all loaded locations
LocationMap locations; LocationMap locations;
//! A Map which has to be used to replace, system- and Qt-version de
pendent,
//! timezone names from our location database to the code names curr
ently used by Qt.
//! Required to avoid https://bugs.launchpad.net/stellarium/+bug/166
2132,
//! details on IANA names with Qt at http://doc.qt.io/qt-5/qtimezone
.html.
//! This has nothing to do with the Windows timezone names!
//! Key: TZ name as used in our database.
//! Value: TZ name as may be available instead in the currently runn
ing version of Qt.
//! The list has to be maintained based on empirical observations.
//! @todo Make it load from a configurable external file.
static TimezoneNameMap locationDBToIANAtranslations;
StelLocation lastResortLocation; StelLocation lastResortLocation;
}; };
#endif // _STELLOCATIONMGR_HPP_ #endif // _STELLOCATIONMGR_HPP_
 End of changes. 3 change blocks. 
0 lines changed or deleted 33 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/