Exemple #1
0
BVariant
Settings::Value(Setting* setting) const
{
	AutoLocker<BLocker> locker(fLock);

	BVariant value;
	return value.SetFromMessage(fValues, setting->ID()) == B_OK
		? value : setting->DefaultValue();
}
Exemple #2
0
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;
}
Exemple #3
0
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;
}
Exemple #4
0
status_t
GUITeamUISettings::Value(const char* settingID, BVariant &value) const
{
	return value.SetFromMessage(fValues, settingID);
}