Commit 269c15e8 authored by Thomas Haller's avatar Thomas Haller

keyfile: various refactoring and restructure nm_keyfile_read()

- in nm_keyfile_read(), unify _read_setting() and
  _read_setting_vpn_secret() in they way they are called
  (that is, they no longer return any value and don't accept
  any arguments aside @info).

- use cleanup attributes

- use nm_streq() instead of strcmp().

- wrap lines that have multiple statements or conditions.
parent abe84859
......@@ -48,7 +48,7 @@ nm_keyfile_plugin_get_alias_for_setting_name (const char *setting_name)
g_return_val_if_fail (setting_name != NULL, NULL);
for (i = 0; i < G_N_ELEMENTS (alias_list); i++) {
if (strcmp (setting_name, alias_list[i].setting) == 0)
if (nm_streq (setting_name, alias_list[i].setting))
return alias_list[i].alias;
}
return NULL;
......@@ -62,7 +62,7 @@ nm_keyfile_plugin_get_setting_name_for_alias (const char *alias)
g_return_val_if_fail (alias != NULL, NULL);
for (i = 0; i < G_N_ELEMENTS (alias_list); i++) {
if (strcmp (alias, alias_list[i].alias) == 0)
if (nm_streq (alias, alias_list[i].alias))
return alias_list[i].setting;
}
return NULL;
......
......@@ -90,4 +90,3 @@ const char *nm_keyfile_key_decode (const char *key,
char **out_to_free);
#endif /* __NM_KEYFILE_UTILS_H__ */
This diff is collapsed.
......@@ -1196,7 +1196,7 @@ nm_g_object_set_property_boolean (GObject *object,
gboolean
nm_g_object_set_property_uint (GObject *object,
const char *property_name,
const char *property_name,
guint value,
GError **error)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment