harbour-aira 0.1.0: client Sailfish per pompa di calore Aira (bridge HTTP + stato e comandi ACS)
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#ifndef SETTINGS_H
|
||||
#define SETTINGS_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QSettings>
|
||||
|
||||
// Preferenze di harbour-aira, persistite in AppConfigLocation
|
||||
// (~/.config/harbour/aira/aira.conf) perche' la sandbox SailJail rende
|
||||
// persistente SOLO quella zona: con QSettings org/app le impostazioni
|
||||
// sparivano quando l'app veniva avviata dal launcher.
|
||||
//
|
||||
// baseUrl indirizzo del bridge, es. "192.168.2.50:8790" (schema opzionale)
|
||||
// token token del bridge (Authorization: Bearer ...)
|
||||
class Settings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QString baseUrl READ baseUrl WRITE setBaseUrl NOTIFY baseUrlChanged)
|
||||
Q_PROPERTY(QString token READ token WRITE setToken NOTIFY tokenChanged)
|
||||
|
||||
public:
|
||||
explicit Settings(QObject *parent = 0);
|
||||
|
||||
QString baseUrl() const;
|
||||
void setBaseUrl(const QString &value);
|
||||
|
||||
QString token() const;
|
||||
void setToken(const QString &value);
|
||||
|
||||
signals:
|
||||
void baseUrlChanged();
|
||||
void tokenChanged();
|
||||
|
||||
private:
|
||||
static QString configPath();
|
||||
QSettings m_settings;
|
||||
};
|
||||
|
||||
#endif // SETTINGS_H
|
||||
Reference in New Issue
Block a user