BVariant Settings::Value(Setting* setting) const { AutoLocker<BLocker> locker(fLock); BVariant value; return value.SetFromMessage(fValues, setting->ID()) == B_OK ? value : setting->DefaultValue(); }
BVariant Settings::Value(const char* settingID) const { AutoLocker<BLocker> locker(fLock); BVariant value; if (value.SetFromMessage(fValues, settingID) == B_OK) return value; Setting* setting = fDescription->SettingByID(settingID); return setting != NULL ? setting->DefaultValue() : value; }
bool Settings::RestoreValues(const BMessage& message) { AutoLocker<BLocker> locker(fLock); for (int32 i = 0; i < fDescription->CountSettings(); i++) { Setting* setting = fDescription->SettingAt(i); BVariant value; if (value.SetFromMessage(message, setting->ID()) == B_OK) { if (!SetValue(setting, value)) return false; } } return true; }
status_t GUITeamUISettings::Value(const char* settingID, BVariant &value) const { return value.SetFromMessage(fValues, settingID); }