Moved loadSetting to MyAvatar

This commit is contained in:
Atlante45 2015-01-20 00:56:25 -08:00
parent 75ce99cd62
commit e4fa9e508e
3 changed files with 9 additions and 10 deletions

View file

@ -731,6 +731,14 @@ void MyAvatar::saveData(QSettings* settings) {
settings->endGroup();
}
float loadSetting(QSettings* settings, const char* name, float defaultValue) {
float value = settings->value(name, defaultValue).toFloat();
if (glm::isnan(value)) {
value = defaultValue;
}
return value;
}
void MyAvatar::loadData(QSettings* settings) {
settings->beginGroup("Avatar");

View file

@ -27,4 +27,4 @@ void SettingsBridge::removeFromSettings(const QString& key) {
QSettings().remove(key);
}
}
}

View file

@ -17,18 +17,9 @@
#include <QVariant>
// TODO: remove
#include <glm/glm.hpp>
class Settings : public QSettings {
};
float loadSetting(QSettings* settings, const char* name, float defaultValue) {
float value = settings->value(name, defaultValue).toFloat();
if (glm::isnan(value)) {
value = defaultValue;
}
return value;
}
////
namespace SettingHandles {