Files
r3ctl/r3ctlsettings.cpp

30 lines
544 B
C++
Raw Permalink Normal View History

2021-06-24 20:00:06 +02:00
#include "r3ctlsettings.h"
const QString R3CtlSettings::m_theme("theme");
QString R3CtlSettings::theme() const
{
return value(m_theme).toString();
}
bool R3CtlSettings::setTheme(const QString &theme)
{
if(this->theme() == theme)
return true;
if(theme.isEmpty())
remove(m_theme);
else
setValue(m_theme, theme);
sync();
const auto success = status() == QSettings::NoError;
if(success)
Q_EMIT themeChanged(theme);
else
Q_EMIT saveErrorOccured();
return success;
}