cli: fix metered to string property

nmc_property_connection_get_metered() must return non-localized strings
that can be parsed by nmc_property_connection_set_metered().

Fixes: f0aebfd746
This commit is contained in:
Thomas Haller
2015-06-10 11:49:04 +02:00
parent 94a393e9ed
commit 5eba53cd53

View File

@@ -2699,6 +2699,17 @@ nmc_property_connection_get_metered (NMSetting *setting, NmcPropertyGetType get_
{ {
NMSettingConnection *s_conn = NM_SETTING_CONNECTION (setting); NMSettingConnection *s_conn = NM_SETTING_CONNECTION (setting);
if (get_type == NMC_PROPERTY_GET_PARSABLE) {
switch (nm_setting_connection_get_metered (s_conn)) {
case NM_METERED_YES:
return g_strdup ("yes");
case NM_METERED_NO:
return g_strdup ("no");
case NM_METERED_UNKNOWN:
default:
return g_strdup ("unknown");
}
}
switch (nm_setting_connection_get_metered (s_conn)) { switch (nm_setting_connection_get_metered (s_conn)) {
case NM_METERED_YES: case NM_METERED_YES:
return g_strdup (_("yes")); return g_strdup (_("yes"));