on xenial help sign in
unbreak the clash between our timezone model and the one from system settings
commit2bb7773f62fdc1c335315d14b63aa6d658994660 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 20 Jan 2016, 13:21 (11 years ago) parent6212c32
2 files changed+9−9
plugins/Wizard/timezonemodel.cpp+4−4 plugins/Wizard/timezonemodel.h+5−5
plugins/Wizard/timezonemodel.cpp+4−4
@@ -28,7 +28,7 @@ TimeZoneLocationModel::TimeZoneLocationModel(QObject *parent):
2828 QAbstractListModel(parent),
2929 m_workerThread(new TimeZonePopulateWorker())
3030{
31− qRegisterMetaType<TzLocation>();
31+ qRegisterMetaType<TzLocationWizard>();
3232
3333 m_roleNames[Qt::DisplayRole] = "displayName";
3434 m_roleNames[TimeZoneRole] = "timeZone";
@@ -66,7 +66,7 @@ void TimeZoneLocationModel::store()
6666 endResetModel();
6767}
6868
69−void TimeZoneLocationModel::processModelResult(const TzLocation &location)
69+void TimeZoneLocationModel::processModelResult(const TzLocationWizard &location)
7070{
7171 m_locations.append(location);
7272}
@@ -83,7 +83,7 @@ QVariant TimeZoneLocationModel::data(const QModelIndex &index, int role) const
8383 if (index.row() >= m_locations.count() || index.row() < 0)
8484 return QVariant();
8585
86− const TzLocation tz = m_locations.at(index.row());
86+ const TzLocationWizard tz = m_locations.at(index.row());
8787
8888 const QString country(tz.full_country.isEmpty() ? tz.country : tz.full_country);
8989
@@ -130,7 +130,7 @@ void TimeZonePopulateWorker::buildCityMap()
130130 TzDB *tzdb = tz_load_db();
131131 GPtrArray *tz_locations = tz_get_locations(tzdb);
132132
133− TimeZoneLocationModel::TzLocation tmpTz;
133+ TimeZoneLocationModel::TzLocationWizard tmpTz;
134134
135135 for (guint i = 0; i < tz_locations->len; ++i) {
136136 auto tmp = static_cast<CcTimezoneLocation *>(g_ptr_array_index(tz_locations, i));
plugins/Wizard/timezonemodel.h+5−5
@@ -42,7 +42,7 @@ public:
4242 LongitudeRole
4343 };
4444
45− struct TzLocation {
45+ struct TzLocationWizard {
4646 QString city;
4747 QString country;
4848 QString timezone;
@@ -57,17 +57,17 @@ public:
5757 QHash<int, QByteArray> roleNames() const override;
5858
5959private Q_SLOTS:
60− void processModelResult(const TzLocation &location);
60+ void processModelResult(const TzLocationWizard &location);
6161 void store();
6262
6363private:
6464 void init();
6565 QHash<int, QByteArray> m_roleNames;
66− QList<TzLocation> m_locations;
66+ QList<TzLocationWizard> m_locations;
6767 TimeZonePopulateWorker *m_workerThread;
6868};
6969
70−Q_DECLARE_METATYPE (TimeZoneLocationModel::TzLocation)
70+Q_DECLARE_METATYPE (TimeZoneLocationModel::TzLocationWizard)
7171
7272class TimeZonePopulateWorker: public QThread
7373{
@@ -76,7 +76,7 @@ public:
7676 void run() override;
7777
7878Q_SIGNALS:
79− void resultReady(const TimeZoneLocationModel::TzLocation &tz);
79+ void resultReady(const TimeZoneLocationModel::TzLocationWizard &tz);
8080
8181private:
8282 void buildCityMap();