mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Have Preferences subclass QIniSettings privately to discourage bad usage.
This commit is contained in:
parent
1f25e6d0fe
commit
1549a443c5
1 changed files with 9 additions and 3 deletions
|
@ -62,15 +62,21 @@ namespace DNS {
|
||||||
enum Service { DYNDNS, NOIP, NONE = -1 };
|
enum Service { DYNDNS, NOIP, NONE = -1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
class Preferences : public QIniSettings {
|
class Preferences : private QIniSettings {
|
||||||
Q_DISABLE_COPY(Preferences)
|
Q_DISABLE_COPY(Preferences)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Preferences() : QIniSettings("qBittorrent", "qBittorrent") {
|
Preferences()
|
||||||
|
: QIniSettings("qBittorrent", "qBittorrent")
|
||||||
|
{
|
||||||
qDebug() << "Preferences constructor";
|
qDebug() << "Preferences constructor";
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
void sync()
|
||||||
|
{
|
||||||
|
QIniSettings::sync();
|
||||||
|
}
|
||||||
|
|
||||||
// General options
|
// General options
|
||||||
QString getLocale() const {
|
QString getLocale() const {
|
||||||
return value(QString::fromUtf8("Preferences/General/Locale"), "en_GB").toString();
|
return value(QString::fromUtf8("Preferences/General/Locale"), "en_GB").toString();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue