[network-manager-pptp/th/vpn-editor-split-bgo766623: 5/21] properties/trivial: rename PPTP_PLUGIN_UI_ERROR to NMV_EDITOR_PLUGIN_ERROR
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-pptp/th/vpn-editor-split-bgo766623: 5/21] properties/trivial: rename PPTP_PLUGIN_UI_ERROR to NMV_EDITOR_PLUGIN_ERROR
- Date: Wed, 18 May 2016 19:04:33 +0000 (UTC)
commit 9241331e828ebabcf8d9a294a4211ae7fe007405
Author: Thomas Haller <thaller redhat com>
Date: Wed May 18 13:37:59 2016 +0200
properties/trivial: rename PPTP_PLUGIN_UI_ERROR to NMV_EDITOR_PLUGIN_ERROR
For other plugins, the VPN specific error instance is called
NMV_EDITOR_PLUGIN_ERROR. Naming it different for each plugin,
only increases the diff between the plugins, for no good reason.
properties/import-export.c | 8 ++++----
properties/nm-pptp.c | 36 ++++++++++++++++++------------------
properties/nm-pptp.h | 18 +++++++++---------
3 files changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index c8dcd3d..0bd35e7 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -44,8 +44,8 @@ NMConnection *
do_import (const char *path, char **lines, GError **error)
{
g_set_error_literal (error,
- PPTP_PLUGIN_UI_ERROR,
- PPTP_PLUGIN_UI_ERROR_UNKNOWN,
+ NMV_EDITOR_PLUGIN_ERROR,
+ NMV_EDITOR_PLUGIN_ERROR_UNKNOWN,
"PPTP import is not implemented");
return NULL;
}
@@ -54,8 +54,8 @@ gboolean
do_export (const char *path, NMConnection *connection, GError **error)
{
g_set_error_literal (error,
- PPTP_PLUGIN_UI_ERROR,
- PPTP_PLUGIN_UI_ERROR_UNKNOWN,
+ NMV_EDITOR_PLUGIN_ERROR,
+ NMV_EDITOR_PLUGIN_ERROR_UNKNOWN,
"PPTP export is not implemented");
return FALSE;
}
diff --git a/properties/nm-pptp.c b/properties/nm-pptp.c
index 89d70c0..477f5b2 100644
--- a/properties/nm-pptp.c
+++ b/properties/nm-pptp.c
@@ -96,7 +96,7 @@ enum {
};
GQuark
-pptp_plugin_ui_error_quark (void)
+nmv_editor_plugin_error_quark (void)
{
static GQuark error_quark = 0;
@@ -117,17 +117,17 @@ pptp_plugin_ui_error_get_type (void)
if (etype == 0) {
static const GEnumValue values[] = {
/* Unknown error. */
- ENUM_ENTRY (PPTP_PLUGIN_UI_ERROR_UNKNOWN, "UnknownError"),
+ ENUM_ENTRY (NMV_EDITOR_PLUGIN_ERROR_UNKNOWN, "UnknownError"),
/* The connection was missing invalid. */
- ENUM_ENTRY (PPTP_PLUGIN_UI_ERROR_INVALID_CONNECTION, "InvalidConnection"),
+ ENUM_ENTRY (NMV_EDITOR_PLUGIN_ERROR_INVALID_CONNECTION, "InvalidConnection"),
/* The specified property was invalid. */
- ENUM_ENTRY (PPTP_PLUGIN_UI_ERROR_INVALID_PROPERTY, "InvalidProperty"),
+ ENUM_ENTRY (NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY, "InvalidProperty"),
/* The specified property was missing and is required. */
- ENUM_ENTRY (PPTP_PLUGIN_UI_ERROR_MISSING_PROPERTY, "MissingProperty"),
+ ENUM_ENTRY (NMV_EDITOR_PLUGIN_ERROR_MISSING_PROPERTY, "MissingProperty"),
/* The file to import could not be read. */
- ENUM_ENTRY (PPTP_PLUGIN_UI_ERROR_FILE_NOT_READABLE, "FileNotReadable"),
+ ENUM_ENTRY (NMV_EDITOR_PLUGIN_ERROR_FILE_NOT_READABLE, "FileNotReadable"),
/* The file to import could was not an PPTP client file. */
- ENUM_ENTRY (PPTP_PLUGIN_UI_ERROR_FILE_NOT_PPTP, "FileNotPPTP"),
+ ENUM_ENTRY (NMV_EDITOR_PLUGIN_ERROR_FILE_NOT_VPN, "FileNotPPTP"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("PptpPluginUiError", values);
@@ -146,8 +146,8 @@ check_validity (PptpPluginUiWidget *self, GError **error)
str = gtk_entry_get_text (GTK_ENTRY (widget));
if (!str || !strlen (str)) {
g_set_error (error,
- PPTP_PLUGIN_UI_ERROR,
- PPTP_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ NMV_EDITOR_PLUGIN_ERROR,
+ NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_PPTP_KEY_GATEWAY);
return FALSE;
}
@@ -495,7 +495,7 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
object = NM_VPN_EDITOR (g_object_new (PPTP_TYPE_PLUGIN_UI_WIDGET, NULL));
if (!object) {
- g_set_error (error, PPTP_PLUGIN_UI_ERROR, 0, "could not create pptp object");
+ g_set_error (error, NMV_EDITOR_PLUGIN_ERROR, 0, "could not create pptp object");
return NULL;
}
@@ -510,7 +510,7 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
g_warning ("Couldn't load builder file: %s",
error && *error ? (*error)->message : "(unknown)");
g_clear_error (error);
- g_set_error (error, PPTP_PLUGIN_UI_ERROR, 0,
+ g_set_error (error, NMV_EDITOR_PLUGIN_ERROR, 0,
"could not load required resources at %s", ui_file);
g_free (ui_file);
g_object_unref (object);
@@ -520,7 +520,7 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
priv->widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "pptp-vbox"));
if (!priv->widget) {
- g_set_error (error, PPTP_PLUGIN_UI_ERROR, 0, "could not load UI widget");
+ g_set_error (error, NMV_EDITOR_PLUGIN_ERROR, 0, "could not load UI widget");
g_object_unref (object);
return NULL;
}
@@ -611,16 +611,16 @@ import (NMVpnEditorPlugin *iface, const char *path, GError **error)
ext = strrchr (path, '.');
if (!ext) {
g_set_error (error,
- PPTP_PLUGIN_UI_ERROR,
- PPTP_PLUGIN_UI_ERROR_FILE_NOT_PPTP,
+ NMV_EDITOR_PLUGIN_ERROR,
+ NMV_EDITOR_PLUGIN_ERROR_FILE_NOT_VPN,
"unknown PPTP file extension");
goto out;
}
if (strcmp (ext, ".conf") && strcmp (ext, ".cnf")) {
g_set_error (error,
- PPTP_PLUGIN_UI_ERROR,
- PPTP_PLUGIN_UI_ERROR_FILE_NOT_PPTP,
+ NMV_EDITOR_PLUGIN_ERROR,
+ NMV_EDITOR_PLUGIN_ERROR_FILE_NOT_VPN,
"unknown PPTP file extension");
goto out;
}
@@ -631,8 +631,8 @@ import (NMVpnEditorPlugin *iface, const char *path, GError **error)
lines = g_strsplit_set (contents, "\r\n", 0);
if (g_strv_length (lines) <= 1) {
g_set_error (error,
- PPTP_PLUGIN_UI_ERROR,
- PPTP_PLUGIN_UI_ERROR_FILE_NOT_READABLE,
+ NMV_EDITOR_PLUGIN_ERROR,
+ NMV_EDITOR_PLUGIN_ERROR_FILE_NOT_READABLE,
"not a valid PPTP configuration file");
goto out;
}
diff --git a/properties/nm-pptp.h b/properties/nm-pptp.h
index 4f312b5..2812270 100644
--- a/properties/nm-pptp.h
+++ b/properties/nm-pptp.h
@@ -27,19 +27,19 @@
typedef enum
{
- PPTP_PLUGIN_UI_ERROR_UNKNOWN = 0,
- PPTP_PLUGIN_UI_ERROR_INVALID_CONNECTION,
- PPTP_PLUGIN_UI_ERROR_INVALID_PROPERTY,
- PPTP_PLUGIN_UI_ERROR_MISSING_PROPERTY,
- PPTP_PLUGIN_UI_ERROR_FILE_NOT_READABLE,
- PPTP_PLUGIN_UI_ERROR_FILE_NOT_PPTP
+ NMV_EDITOR_PLUGIN_ERROR_UNKNOWN = 0,
+ NMV_EDITOR_PLUGIN_ERROR_INVALID_CONNECTION,
+ NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
+ NMV_EDITOR_PLUGIN_ERROR_MISSING_PROPERTY,
+ NMV_EDITOR_PLUGIN_ERROR_FILE_NOT_READABLE,
+ NMV_EDITOR_PLUGIN_ERROR_FILE_NOT_VPN,
} PptpPluginUiError;
-#define PPTP_TYPE_PLUGIN_UI_ERROR (pptp_plugin_ui_error_get_type ())
+#define PPTP_TYPE_PLUGIN_UI_ERROR (pptp_plugin_ui_error_get_type ())
GType pptp_plugin_ui_error_get_type (void);
-#define PPTP_PLUGIN_UI_ERROR (pptp_plugin_ui_error_quark ())
-GQuark pptp_plugin_ui_error_quark (void);
+#define NMV_EDITOR_PLUGIN_ERROR (nmv_editor_plugin_error_quark ())
+GQuark nmv_editor_plugin_error_quark (void);
#define PPTP_TYPE_PLUGIN_UI (pptp_plugin_ui_get_type ())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]