Fix header include, add missing setModel
commit246c47b833b0714b6e310729614cfb68f3e71dc4
authorMichael Terry <michael.terry@canonical.com>
dateFri 26 Feb 2016, 16:22 (11 years ago)
parent6561899
plugins/Wizard/timezonemodel.cpp+12
@@ -83,6 +83,18 @@ QHash<int, QByteArray> TimeZoneLocationModel::roleNames() const
8383 return m_roleNames;
8484}
8585
86+void TimeZoneLocationModel::setModel(QList<GeonamesCity *> locations)
87+{
88+ beginResetModel();
89+
90+ Q_FOREACH(GeonamesCity *city, m_locations) {
91+ geonames_city_free(city);
92+ }
93+
94+ m_locations = locations;
95+ endResetModel();
96+}
97+
8698void TimeZoneLocationModel::filterFinished(GObject *source_object,
8799 GAsyncResult *res,
88100 gpointer user_data)
plugins/Wizard/timezonemodel.h+3
@@ -17,7 +17,10 @@
1717#ifndef TIMEZONEMODEL_H
1818#define TIMEZONEMODEL_H
1919
20+extern "C" {
2021#include <geonames.h>
22+}
23+
2124#include <glib.h>
2225#include <QAbstractListModel>
2326