mirror-chatterino2/settings/boolsetting.h

57 lines
831 B
C
Raw Normal View History

2017-01-20 06:10:28 +01:00
#ifndef BOOLSETTING_H
#define BOOLSETTING_H
#include "settings/setting.h"
#include <QString>
namespace chatterino {
namespace settings {
class BoolSetting : public Setting
{
public:
BoolSetting(const QString &name, bool defaultValue)
: Setting(name)
, value(defaultValue)
, defaultValue(defaultValue)
{
}
bool
get() const
{
return this->value;
}
void
set(bool value)
{
2017-01-21 05:14:27 +01:00
if (this->value != value) {
this->value = value;
emit valueChanged(value);
}
2017-01-20 06:10:28 +01:00
}
void
save(const QSettings &settings) override
{
}
void
load(const QSettings &settings) override
{
}
2017-01-21 05:14:27 +01:00
signals:
void valueChanged(bool value);
2017-01-20 06:10:28 +01:00
private:
bool value;
bool defaultValue;
};
}
}
#endif // BOOLSETTING_H