2 * Copyright (C) 2016 Canonical Ltd.
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef TIMEZONEMODEL_H
18#define TIMEZONEMODEL_H
22#include <QAbstractListModel>
24class TimeZoneLocationModel: public QAbstractListModel
27 Q_PROPERTY(bool listUpdating READ listUpdating NOTIFY listUpdatingChanged)
28 Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged)
29 Q_PROPERTY(QString country READ country WRITE setCountry NOTIFY countryChanged)
32 explicit TimeZoneLocationModel(QObject *parent = nullptr);
33 ~TimeZoneLocationModel();
36 TimeZoneRole = Qt::UserRole + 1,
46 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
47 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
48 QHash<int, QByteArray> roleNames() const override;
50 bool listUpdating() const;
52 QString filter() const;
53 void setFilter(const QString &filter);
55 QString country() const;
56 void setCountry(const QString &country);
59 void listUpdatingChanged();
61 void countryChanged(const QString &country);
64 void setModel(const QList<GeonamesCity *> &locations);
65 void setListUpdating(bool listUpdating);
66 static void filterFinished(GObject *source_object,
74 GCancellable *m_cancellable;
75 QHash<int, QByteArray> m_roleNames;
76 QList<GeonamesCity *> m_locations;
77 QList<GeonamesCity *> m_countryLocations;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list