6 Copyright (C) 2011 Luciano Montanaro <mikelima@cirulla.net>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; see the file COPYING. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
27 #include <QStringList>
29 class Settings : public QObject
32 Q_PROPERTY(QString queryBaseUrl
33 READ queryBaseUrl WRITE setQueryBaseUrl
34 NOTIFY queryBaseUrlChanged)
35 Q_PROPERTY(QStringList recentStations
36 READ recentStations WRITE setRecentStations
37 NOTIFY recentStationsChanged)
38 Q_PROPERTY(int checkingInterval
39 READ checkingInterval WRITE setCheckingInterval
40 NOTIFY checkingIntervalChanged)
41 Q_PROPERTY(bool stationViewPreferred
42 READ stationViewPreferred WRITE setStationViewPreferred
43 NOTIFY stationViewPreferredChanged)
46 explicit Settings(QObject *parent = 0);
48 Q_INVOKABLE static Settings *instance();
50 Q_INVOKABLE void load(void);
51 Q_INVOKABLE void save(void);
53 QString queryBaseUrl();
54 void setQueryBaseUrl(const QString &url);
56 QStringList recentStations();
57 void setRecentStations(const QStringList &stations);
59 int checkingInterval();
60 void setCheckingInterval(int);
62 bool stationViewPreferred();
63 void setStationViewPreferred(bool);
66 void queryBaseUrlChanged(const QString &);
67 void recentStationsChanged(const QStringList &);
68 void checkingIntervalChanged(int);
69 void stationViewPreferredChanged(bool);
74 QString m_queryBaseUrl;
75 QStringList m_recentStations;
76 int m_checkingInterval;
77 bool m_stationViewPreferred;