/
Computershik
/
harbour-kat
Обзор
Документация
Войти
/
Computershik
/
harbour-kat
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/settingswrapper.h
66 строк
2 KB
Petr Vytovtov
Added online/offline mode
19 фев 2017, 18:30
19 фев 2017, 18:30
2979aaa
Код
Авторство
О чём код?
/* Copyright (C) 2016 Petr Vytovtov Contact: Petr Vytovtov <osanwe@protonmail.ch> All rights reserved. This file is part of Kat. Kat is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Kat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Kat. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SETTINGSWRAPPER_H #define SETTINGSWRAPPER_H #include <QObject> #include <QSettings> #include <QStandardPaths> #include <QDebug> class SettingsWrapper : public QObject { Q_OBJECT public: explicit SettingsWrapper(QObject *parent = 0); ~SettingsWrapper(); Q_INVOKABLE void setAccessToken(QString value); Q_INVOKABLE void setUserId(int value); Q_INVOKABLE void setDefaultPage(QString value); Q_INVOKABLE void incrementAttachmentsHintCounter(); Q_INVOKABLE QString accessToken(); Q_INVOKABLE int userId(); Q_INVOKABLE QString defaultPage(); Q_INVOKABLE int attachmentsHintCounter(); Q_INVOKABLE void removeAccessToken(); Q_INVOKABLE void removeUserId(); Q_INVOKABLE void setOfflineStatus(bool offline); Q_INVOKABLE bool offlineStatus(); private: QSettings *_settings; const QString ACCESS_TOKEN_KEY = "accessToken"; const QString USER_ID_KEY = "userId"; const QString DEFAULT_PAGE_KEY = "defaultPage"; const QString ATTACHMENTS_HINT = "attachmentsHint"; const QString OFFLINE_STATUS_KEY = "offlineStatus"; }; #endif // SETTINGSWRAPPER_H