From 3ac0f528780895c474a437bd75ab7e4baeaa83aa Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 26 Jun 2014 13:44:36 -0400 Subject: libnm, core, cli, tui: fix the capitalization of various types GLib/Gtk have mostly settled on the convention that two-letter acronyms in type names remain all-caps (eg, "IO"), but longer acronyms become initial-caps-only (eg, "Tcp"). NM was inconsistent, with most long acronyms using initial caps only (Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP, PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all three-or-more-letter-long acronyms (and update nmcli and nmtui for the libnm changes). --- clients/cli/common.c | 4 ++-- clients/cli/common.h | 4 ++-- clients/cli/connections.c | 28 ++++++++++++++-------------- clients/cli/devices.c | 4 ++-- clients/cli/settings.c | 14 +++++++------- clients/tui/nmt-secret-agent.c | 2 +- clients/tui/vpn-helpers.c | 6 +++--- 7 files changed, 31 insertions(+), 31 deletions(-) (limited to 'clients') diff --git a/clients/cli/common.c b/clients/cli/common.c index 5236431d73..d860d6386d 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -286,7 +286,7 @@ print_ip6_config (NMIP6Config *cfg6, } gboolean -print_dhcp4_config (NMDHCP4Config *dhcp4, +print_dhcp4_config (NMDhcp4Config *dhcp4, NmCli *nmc, const char *group_prefix, const char *one_field) @@ -334,7 +334,7 @@ print_dhcp4_config (NMDHCP4Config *dhcp4, } gboolean -print_dhcp6_config (NMDHCP6Config *dhcp6, +print_dhcp6_config (NMDhcp6Config *dhcp6, NmCli *nmc, const char *group_prefix, const char *one_field) diff --git a/clients/cli/common.h b/clients/cli/common.h index ec347500aa..1397194f17 100644 --- a/clients/cli/common.h +++ b/clients/cli/common.h @@ -34,8 +34,8 @@ gboolean print_ip4_config (NMIP4Config *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field); gboolean print_ip6_config (NMIP6Config *cfg6, NmCli *nmc, const char *group_prefix, const char *one_field); -gboolean print_dhcp4_config (NMDHCP4Config *dhcp4, NmCli *nmc, const char *group_prefix, const char *one_field); -gboolean print_dhcp6_config (NMDHCP6Config *dhcp6, NmCli *nmc, const char *group_prefix, const char *one_field); +gboolean print_dhcp4_config (NMDhcp4Config *dhcp4, NmCli *nmc, const char *group_prefix, const char *one_field); +gboolean print_dhcp6_config (NMDhcp6Config *dhcp6, NmCli *nmc, const char *group_prefix, const char *one_field); NMIP4Address *nmc_parse_and_build_ip4_address (const char *ip_str, const char *gw_str, GError **error); NMIP6Address *nmc_parse_and_build_ip6_address (const char *ip_str, const char *gw_str, GError **error); diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 10660213d2..9c0597ca68 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -567,7 +567,7 @@ active_connection_state_to_string (NMActiveConnectionState state) } static const char * -vpn_connection_state_to_string (NMVPNConnectionState state) +vpn_connection_state_to_string (NMVpnConnectionState state) { switch (state) { case NM_VPN_CONNECTION_STATE_PREPARE: @@ -1088,7 +1088,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc) /* DHCP4 */ if (strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[2].name) == 0) { gboolean b1 = FALSE; - NMDHCP4Config *dhcp4 = nm_active_connection_get_dhcp4_config (acon); + NMDhcp4Config *dhcp4 = nm_active_connection_get_dhcp4_config (acon); b1 = print_dhcp4_config (dhcp4, nmc, "DHCP4", group_fld); was_output = was_output || b1; @@ -1106,7 +1106,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc) /* DHCP6 */ if (strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[4].name) == 0) { gboolean b1 = FALSE; - NMDHCP6Config *dhcp6 = nm_active_connection_get_dhcp6_config (acon); + NMDhcp6Config *dhcp6 = nm_active_connection_get_dhcp6_config (acon); b1 = print_dhcp6_config (dhcp6, nmc, "DHCP6", group_fld); was_output = was_output || b1; @@ -1117,8 +1117,8 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc) strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[5].name) == 0) { NMConnection *con; NMSettingConnection *s_con; - NMSettingVPN *s_vpn; - NMVPNConnectionState vpn_state; + NMSettingVpn *s_vpn; + NMVpnConnectionState vpn_state; char *type_str, *banner_str, *vpn_state_str; const char *username = NULL; char **vpn_data_array = NULL; @@ -1625,7 +1625,7 @@ find_device_for_connection (NmCli *nmc, } static const char * -vpn_connection_state_reason_to_string (NMVPNConnectionStateReason reason) +vpn_connection_state_reason_to_string (NMVpnConnectionStateReason reason) { switch (reason) { case NM_VPN_CONNECTION_STATE_REASON_UNKNOWN: @@ -1680,9 +1680,9 @@ active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpoin } static void -vpn_connection_state_cb (NMVPNConnection *vpn, - NMVPNConnectionState state, - NMVPNConnectionStateReason reason, +vpn_connection_state_cb (NMVpnConnection *vpn, + NMVpnConnectionState state, + NMVpnConnectionStateReason reason, gpointer user_data) { NmCli *nmc = (NmCli *) user_data; @@ -1752,7 +1752,7 @@ progress_device_cb (gpointer user_data) static gboolean progress_vpn_cb (gpointer user_data) { - NMVPNConnection *vpn = (NMVPNConnection *) user_data; + NMVpnConnection *vpn = (NMVpnConnection *) user_data; const char *str; str = NM_IS_VPN_CONNECTION (vpn) ? @@ -3643,7 +3643,7 @@ complete_connection_by_type (NMConnection *connection, NMSettingInfiniband *s_infiniband; NMSettingWireless *s_wifi; NMSettingWimax *s_wimax; - NMSettingPPPOE *s_pppoe; + NMSettingPppoe *s_pppoe; NMSettingGsm *s_gsm; NMSettingCdma *s_cdma; NMSettingBluetooth *s_bt; @@ -3653,7 +3653,7 @@ complete_connection_by_type (NMConnection *connection, NMSettingTeamPort *s_team_port; NMSettingBridge *s_bridge; NMSettingBridgePort *s_bridge_port; - NMSettingVPN *s_vpn; + NMSettingVpn *s_vpn; NMSettingOlpcMesh *s_olpc_mesh; g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -3968,7 +3968,7 @@ cleanup_wimax: goto cleanup_pppoe; /* Add 'pppoe' setting */ - s_pppoe = (NMSettingPPPOE *) nm_setting_pppoe_new (); + s_pppoe = (NMSettingPppoe *) nm_setting_pppoe_new (); nm_connection_add_setting (connection, NM_SETTING (s_pppoe)); g_object_set (s_pppoe, NM_SETTING_PPPOE_USERNAME, username, NULL); g_object_set (s_pppoe, NM_SETTING_PPPOE_PASSWORD, password, NULL); @@ -4808,7 +4808,7 @@ cleanup_bridge_slave: do_questionnaire_vpn (&user); /* Add 'vpn' setting */ - s_vpn = (NMSettingVPN *) nm_setting_vpn_new (); + s_vpn = (NMSettingVpn *) nm_setting_vpn_new (); nm_connection_add_setting (connection, NM_SETTING (s_vpn)); g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, service_type, NULL); diff --git a/clients/cli/devices.c b/clients/cli/devices.c index 36aab74fc1..9cf8203d7d 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -742,8 +742,8 @@ show_device_info (NMDevice *device, NmCli *nmc) gboolean was_output = FALSE; NMIP4Config *cfg4; NMIP6Config *cfg6; - NMDHCP4Config *dhcp4; - NMDHCP6Config *dhcp6; + NMDhcp4Config *dhcp4; + NMDhcp6Config *dhcp6; const char *base_hdr = _("Device details"); GPtrArray *fields_in_section = NULL; diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 3e7a7e2259..c952ecda96 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -1345,7 +1345,7 @@ DEFINE_GETTER (nmc_property_vpn_get_user_name, NM_SETTING_VPN_USER_NAME) static char * nmc_property_vpn_get_data (NMSetting *setting) { - NMSettingVPN *s_vpn = NM_SETTING_VPN (setting); + NMSettingVpn *s_vpn = NM_SETTING_VPN (setting); GString *data_item_str; data_item_str = g_string_new (NULL); @@ -1357,7 +1357,7 @@ nmc_property_vpn_get_data (NMSetting *setting) static char * nmc_property_vpn_get_secrets (NMSetting *setting) { - NMSettingVPN *s_vpn = NM_SETTING_VPN (setting); + NMSettingVpn *s_vpn = NM_SETTING_VPN (setting); GString *secret_str; secret_str = g_string_new (NULL); @@ -3741,7 +3741,7 @@ nmc_property_vlan_remove_egress_priority_map (NMSetting *setting, /* 'data' */ DEFINE_SETTER_OPTIONS (nmc_property_vpn_set_data, NM_SETTING_VPN, - NMSettingVPN, + NMSettingVpn, nm_setting_vpn_add_data_item, NULL, NULL) @@ -3752,7 +3752,7 @@ DEFINE_REMOVER_OPTION (nmc_property_vpn_remove_option_data, /* 'secrets' */ DEFINE_SETTER_OPTIONS (nmc_property_vpn_set_secrets, NM_SETTING_VPN, - NMSettingVPN, + NMSettingVpn, nm_setting_vpn_add_secret, NULL, NULL) @@ -6668,7 +6668,7 @@ setting_serial_details (NMSetting *setting, NmCli *nmc, const char *one_prop) static gboolean setting_ppp_details (NMSetting *setting, NmCli *nmc, const char *one_prop) { - NMSettingPPP *s_ppp = NM_SETTING_PPP (setting); + NMSettingPpp *s_ppp = NM_SETTING_PPP (setting); NmcOutputField *tmpl, *arr; size_t tmpl_len; @@ -6711,7 +6711,7 @@ setting_ppp_details (NMSetting *setting, NmCli *nmc, const char *one_prop) static gboolean setting_pppoe_details (NMSetting *setting, NmCli *nmc, const char *one_prop) { - NMSettingPPPOE *s_pppoe = NM_SETTING_PPPOE (setting); + NMSettingPppoe *s_pppoe = NM_SETTING_PPPOE (setting); NmcOutputField *tmpl, *arr; size_t tmpl_len; @@ -6858,7 +6858,7 @@ setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc, const char *one_prop) static gboolean setting_vpn_details (NMSetting *setting, NmCli *nmc, const char *one_prop) { - NMSettingVPN *s_vpn = NM_SETTING_VPN (setting); + NMSettingVpn *s_vpn = NM_SETTING_VPN (setting); NmcOutputField *tmpl, *arr; size_t tmpl_len; diff --git a/clients/tui/nmt-secret-agent.c b/clients/tui/nmt-secret-agent.c index 7939a84379..147e11957c 100644 --- a/clients/tui/nmt-secret-agent.c +++ b/clients/tui/nmt-secret-agent.c @@ -298,7 +298,7 @@ static gboolean add_pppoe_secrets (NmtSecretAgentRequest *request, GPtrArray *secrets) { - NMSettingPPPOE *s_pppoe = nm_connection_get_setting_pppoe (request->connection); + NMSettingPppoe *s_pppoe = nm_connection_get_setting_pppoe (request->connection); NmtSecretAgentSecret *secret; secret = nmt_secret_agent_secret_new (_("Username"), diff --git a/clients/tui/vpn-helpers.c b/clients/tui/vpn-helpers.c index 2bdb501a37..fb0ee6f7f8 100644 --- a/clients/tui/vpn-helpers.c +++ b/clients/tui/vpn-helpers.c @@ -274,7 +274,7 @@ export_vpn_to_file_cb (GtkWidget *dialog, gint response, gpointer user_data) GError *error = NULL; NMVpnPluginUiInterface *plugin; NMSettingConnection *s_con = NULL; - NMSettingVPN *s_vpn = NULL; + NMSettingVpn *s_vpn = NULL; const char *service_type; const char *id = NULL; gboolean success = FALSE; @@ -363,7 +363,7 @@ vpn_export (NMConnection *connection) { GtkWidget *dialog; NMVpnPluginUiInterface *plugin; - NMSettingVPN *s_vpn = NULL; + NMSettingVpn *s_vpn = NULL; const char *service_type; const char *home_folder; @@ -405,7 +405,7 @@ vpn_export (NMConnection *connection) gboolean vpn_supports_ipv6 (NMConnection *connection) { - NMSettingVPN *s_vpn; + NMSettingVpn *s_vpn; const char *service_type; NMVpnPluginUiInterface *plugin; guint32 capabilities; -- cgit v1.2.1