ssu
Loading...
Searching...
No Matches
ssucoreconfig_p.h
Go to the documentation of this file.
1
7
8#ifndef _SSUCORECONFIG_P_H
9#define _SSUCORECONFIG_P_H
10
11#include <QObject>
12#include "ssusettings_p.h"
13#include "ssu.h"
14
15#ifndef SSU_CONFIGURATION
17#define SSU_CONFIGURATION "/etc/ssu/ssu.ini"
18#endif
19
20#ifndef SSU_DEFAULT_CONFIGURATION
22#define SSU_DEFAULT_CONFIGURATION "/usr/share/ssu/ssu-defaults.ini"
23#endif
24
25class QDBusConnection;
26
27class SsuCoreConfig: public SsuSettings
28{
29 Q_OBJECT
30
31public:
32 static SsuCoreConfig *instance();
37 QPair<QString, QString> credentials(const QString &scope);
47 QString credentialsScope(const QString &repoName, bool rndRepo = false);
51 QString credentialsUrl(const QString &scope);
56 Q_INVOKABLE QString flavour();
60 Q_INVOKABLE Ssu::DeviceModeFlags deviceMode();
67 Q_INVOKABLE QString domain(bool pretty = false);
72 Q_INVOKABLE QString brand();
78 Q_INVOKABLE bool isRegistered();
83 Q_INVOKABLE QDateTime lastCredentialsUpdate();
87 Q_INVOKABLE QString release(bool rnd = false);
91 Q_INVOKABLE void setDeviceMode(Ssu::DeviceModeFlags mode, enum Ssu::EditMode editMode = Ssu::Replace);
95 Q_INVOKABLE void setFlavour(const QString &flavour);
99 Q_INVOKABLE void setRelease(const QString &release, bool rnd = false);
103 Q_INVOKABLE void setDomain(const QString &domain);
109 Q_INVOKABLE bool useSslVerify();
113 static QDBusConnection userSessionBus();
114
115
116private:
117 SsuCoreConfig(): SsuSettings(SSU_CONFIGURATION, QSettings::IniFormat, SSU_DEFAULT_CONFIGURATION) {}
118 Q_DISABLE_COPY(SsuCoreConfig)
119
120 static SsuCoreConfig *ssuCoreConfig;
121};
122
123
124#endif
Q_INVOKABLE QString domain(bool pretty=false)
QString credentialsScope(const QString &repoName, bool rndRepo=false)
Q_INVOKABLE void setFlavour(const QString &flavour)
Q_INVOKABLE bool useSslVerify()
Q_INVOKABLE QDateTime lastCredentialsUpdate()
Q_INVOKABLE Ssu::DeviceModeFlags deviceMode()
Q_INVOKABLE void setDeviceMode(Ssu::DeviceModeFlags mode, enum Ssu::EditMode editMode=Ssu::Replace)
Q_INVOKABLE bool isRegistered()
Q_INVOKABLE void setDomain(const QString &domain)
QString credentialsUrl(const QString &scope)
static QDBusConnection userSessionBus()
Q_INVOKABLE QString release(bool rnd=false)
Q_INVOKABLE QString brand()
Q_INVOKABLE void setRelease(const QString &release, bool rnd=false)
Q_INVOKABLE QString flavour()
QPair< QString, QString > credentials(const QString &scope)
EditMode
Definition ssu.h:91
@ Replace
Replace the old value with the new one.
Definition ssu.h:92
#define SSU_DEFAULT_CONFIGURATION
Path to the main ssu configuration file.
#define SSU_CONFIGURATION
Path to the main ssu configuration file.