summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-10-13 11:57:35 -0400
committerDan Winship <danw@gnome.org>2014-10-22 08:29:07 -0400
commita7b1ee77dbc74fa40864e292c75d764b958634b0 (patch)
treee3637575fd8552307493ed88168b6be83f9c799f /src
parent63957e0ed23e949ad24290f8f4c02f6925bb6bef (diff)
downloadNetworkManager-a7b1ee77dbc74fa40864e292c75d764b958634b0.tar.gz
libnm-core: drop nm_setting_lookup_type_by_quark()
nm_setting_lookup_type_by_quark() was only ever used in places that were still mistakenly assuming the old style of nm_connection_verify() errors, where the error message would contain only a property name and no further explanation. Fix those places to assume that the error will contain a real error message, and include both the setting name and the property name. Given that, there's no longer any need for nm_setting_lookup_type_by_quark(), so drop it.
Diffstat (limited to 'src')
-rw-r--r--src/settings/nm-settings.c5
-rw-r--r--src/settings/plugins/example/plugin.c7
-rw-r--r--src/settings/plugins/keyfile/reader.c5
3 files changed, 6 insertions, 11 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index f4ab2839d4..87b7d2fa34 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -834,9 +834,8 @@ claim_connection (NMSettings *self,
}
if (!nm_connection_normalize (NM_CONNECTION (connection), NULL, NULL, &error)) {
- nm_log_warn (LOGD_SETTINGS, "plugin provided invalid connection: '%s' / '%s' invalid: %d",
- g_type_name (nm_setting_lookup_type_by_quark (error->domain)),
- error->message, error->code);
+ nm_log_warn (LOGD_SETTINGS, "plugin provided invalid connection: %s",
+ error->message);
g_error_free (error);
return;
}
diff --git a/src/settings/plugins/example/plugin.c b/src/settings/plugins/example/plugin.c
index 35fc4a0f63..bc5c06e99d 100644
--- a/src/settings/plugins/example/plugin.c
+++ b/src/settings/plugins/example/plugin.c
@@ -197,11 +197,8 @@ update_connection_settings_commit_cb (NMSettingsConnection *orig, GError *error,
* an error here.
*/
if (error) {
- nm_log_warn (LOGD_SETTINGS, "%s: '%s' / '%s' invalid: %d",
- __func__,
- error ? g_type_name (nm_setting_lookup_type_by_quark (error->domain)) : "(none)",
- (error && error->message) ? error->message : "(none)",
- error ? error->code : -1);
+ nm_log_warn (LOGD_SETTINGS, "%s: connection invalid: %s",
+ __func__, error->message);
g_clear_error (&error);
nm_settings_connection_signal_remove (orig);
diff --git a/src/settings/plugins/keyfile/reader.c b/src/settings/plugins/keyfile/reader.c
index 4c6ce24397..9ec6d94d24 100644
--- a/src/settings/plugins/keyfile/reader.c
+++ b/src/settings/plugins/keyfile/reader.c
@@ -1385,9 +1385,8 @@ nm_keyfile_plugin_connection_from_file (const char *filename, GError **error)
/* Normalize and verify the connection */
if (!nm_connection_normalize (connection, NULL, NULL, &verify_error)) {
g_set_error (error, KEYFILE_PLUGIN_ERROR, 0,
- "invalid or missing connection property '%s/%s'",
- verify_error ? g_type_name (nm_setting_lookup_type_by_quark (verify_error->domain)) : "(unknown)",
- (verify_error && verify_error->message) ? verify_error->message : "(unknown)");
+ "invalid connection: %s",
+ verify_error->message);
g_clear_error (&verify_error);
g_object_unref (connection);
connection = NULL;