diff options
author | Bastien Nocera <hadess@hadess.net> | 2012-11-09 11:49:49 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2012-11-09 11:50:23 +0100 |
commit | b831fcad33b0b32c6c9112502f93c56a81562ea2 (patch) | |
tree | cb9095442f2db8f59bef8736ffc5a479e63f990a /panels | |
parent | b72c1c554112844e856085d1a13232f41a153710 (diff) | |
download | gnome-control-center-b831fcad33b0b32c6c9112502f93c56a81562ea2.tar.gz |
network: Avoid type clashes with the Bluetooth panel
Done with:
sed -i -e 's/RfkillGlib/CcRfkillGlib/g' \
-e 's/RFKILL_GLIB/CC_RFKILL_GLIB/g' \
-e 's/rfkill_glib/cc_rfkill_glib/g' \
-e 's/RFKILL_TYPE_GLIB/CC_RFKILL_TYPE_GLIB/g' \
rfkill-glib.[ch] cc-network-panel.c
This would need to be done when we reset the copy/paste from
gnome-bluetooth.
Diffstat (limited to 'panels')
-rw-r--r-- | panels/network/cc-network-panel.c | 10 | ||||
-rw-r--r-- | panels/network/rfkill-glib.c | 48 | ||||
-rw-r--r-- | panels/network/rfkill-glib.h | 44 |
3 files changed, 51 insertions, 51 deletions
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c index 68904cee6..3039157fc 100644 --- a/panels/network/cc-network-panel.c +++ b/panels/network/cc-network-panel.c @@ -73,7 +73,7 @@ struct _CcNetworkPanelPrivate /* Killswitch stuff */ GtkWidget *kill_switch_header; - RfkillGlib *rfkill; + CcRfkillGlib *rfkill; GtkSwitch *rfkill_switch; GHashTable *killswitches; @@ -257,12 +257,12 @@ cc_network_panel_notify_enable_active_cb (GtkSwitch *sw, event.op = RFKILL_OP_CHANGE_ALL; event.type = RFKILL_TYPE_ALL; event.soft = enable ? 1 : 0; - if (rfkill_glib_send_event (panel->priv->rfkill, &event) < 0) + if (cc_rfkill_glib_send_event (panel->priv->rfkill, &event) < 0) g_warning ("Setting the killswitch %s failed", enable ? "on" : "off"); } static void -rfkill_changed (RfkillGlib *rfkill, +rfkill_changed (CcRfkillGlib *rfkill, GList *events, CcNetworkPanel *panel) { @@ -341,10 +341,10 @@ cc_network_panel_constructed (GObject *object) panel->priv->kill_switch_header = g_object_ref (box); panel->priv->killswitches = g_hash_table_new (g_direct_hash, g_direct_equal); - panel->priv->rfkill = rfkill_glib_new (); + panel->priv->rfkill = cc_rfkill_glib_new (); g_signal_connect (G_OBJECT (panel->priv->rfkill), "changed", G_CALLBACK (rfkill_changed), panel); - if (rfkill_glib_open (panel->priv->rfkill) < 0) + if (cc_rfkill_glib_open (panel->priv->rfkill) < 0) gtk_widget_hide (box); g_signal_connect (panel->priv->rfkill_switch, "notify::active", diff --git a/panels/network/rfkill-glib.c b/panels/network/rfkill-glib.c index 039e80adb..e27ca4080 100644 --- a/panels/network/rfkill-glib.c +++ b/panels/network/rfkill-glib.c @@ -43,19 +43,19 @@ enum { static int signals[LAST_SIGNAL] = { 0 }; -#define RFKILL_GLIB_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ - RFKILL_TYPE_GLIB, RfkillGlibPrivate)) +#define CC_RFKILL_GLIB_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ + CC_RFKILL_TYPE_GLIB, CcRfkillGlibPrivate)) -struct RfkillGlibPrivate { +struct CcRfkillGlibPrivate { int fd; GIOChannel *channel; guint watch_id; }; -G_DEFINE_TYPE(RfkillGlib, rfkill_glib, G_TYPE_OBJECT) +G_DEFINE_TYPE(CcRfkillGlib, cc_rfkill_glib, G_TYPE_OBJECT) int -rfkill_glib_send_event (RfkillGlib *rfkill, struct rfkill_event *event) +cc_rfkill_glib_send_event (CcRfkillGlib *rfkill, struct rfkill_event *event) { g_return_val_if_fail (RFKILL_IS_GLIB (rfkill), -1); g_return_val_if_fail (rfkill->priv->fd > 0, -1); @@ -112,7 +112,7 @@ print_event (struct rfkill_event *event) } static void -emit_changed_signal_and_free (RfkillGlib *rfkill, +emit_changed_signal_and_free (CcRfkillGlib *rfkill, GList *events) { if (events == NULL) @@ -127,7 +127,7 @@ emit_changed_signal_and_free (RfkillGlib *rfkill, static gboolean event_cb (GIOChannel *source, GIOCondition condition, - RfkillGlib *rfkill) + CcRfkillGlib *rfkill) { GList *events; @@ -170,19 +170,19 @@ event_cb (GIOChannel *source, } static void -rfkill_glib_init (RfkillGlib *rfkill) +cc_rfkill_glib_init (CcRfkillGlib *rfkill) { - RfkillGlibPrivate *priv; + CcRfkillGlibPrivate *priv; - priv = RFKILL_GLIB_GET_PRIVATE (rfkill); + priv = CC_RFKILL_GLIB_GET_PRIVATE (rfkill); rfkill->priv = priv; rfkill->priv->fd = -1; } int -rfkill_glib_open (RfkillGlib *rfkill) +cc_rfkill_glib_open (CcRfkillGlib *rfkill) { - RfkillGlibPrivate *priv; + CcRfkillGlibPrivate *priv; int fd; int ret; GList *events; @@ -252,12 +252,12 @@ rfkill_glib_open (RfkillGlib *rfkill) } static void -rfkill_glib_finalize (GObject *object) +cc_rfkill_glib_finalize (GObject *object) { - RfkillGlib *rfkill; - RfkillGlibPrivate *priv; + CcRfkillGlib *rfkill; + CcRfkillGlibPrivate *priv; - rfkill = RFKILL_GLIB (object); + rfkill = CC_RFKILL_GLIB (object); priv = rfkill->priv; /* cleanup monitoring */ @@ -270,30 +270,30 @@ rfkill_glib_finalize (GObject *object) close(priv->fd); priv->fd = -1; - G_OBJECT_CLASS(rfkill_glib_parent_class)->finalize(object); + G_OBJECT_CLASS(cc_rfkill_glib_parent_class)->finalize(object); } static void -rfkill_glib_class_init(RfkillGlibClass *klass) +cc_rfkill_glib_class_init(CcRfkillGlibClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; - g_type_class_add_private(klass, sizeof(RfkillGlibPrivate)); - object_class->finalize = rfkill_glib_finalize; + g_type_class_add_private(klass, sizeof(CcRfkillGlibPrivate)); + object_class->finalize = cc_rfkill_glib_finalize; signals[CHANGED] = g_signal_new ("changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (RfkillGlibClass, changed), + G_STRUCT_OFFSET (CcRfkillGlibClass, changed), NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_POINTER); } -RfkillGlib * -rfkill_glib_new (void) +CcRfkillGlib * +cc_rfkill_glib_new (void) { - return RFKILL_GLIB (g_object_new (RFKILL_TYPE_GLIB, NULL)); + return CC_RFKILL_GLIB (g_object_new (CC_RFKILL_TYPE_GLIB, NULL)); } diff --git a/panels/network/rfkill-glib.h b/panels/network/rfkill-glib.h index 23f3df644..c2834d448 100644 --- a/panels/network/rfkill-glib.h +++ b/panels/network/rfkill-glib.h @@ -21,45 +21,45 @@ * */ -#ifndef __RFKILL_GLIB_H -#define __RFKILL_GLIB_H +#ifndef __CC_RFKILL_GLIB_H +#define __CC_RFKILL_GLIB_H #include <glib-object.h> #include "rfkill.h" G_BEGIN_DECLS -#define RFKILL_TYPE_GLIB (rfkill_glib_get_type()) -#define RFKILL_GLIB(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - RFKILL_TYPE_GLIB, RfkillGlib)) -#define RFKILL_GLIB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - RFKILL_TYPE_GLIB, RfkillGlibClass)) +#define CC_RFKILL_TYPE_GLIB (cc_rfkill_glib_get_type()) +#define CC_RFKILL_GLIB(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + CC_RFKILL_TYPE_GLIB, CcRfkillGlib)) +#define CC_RFKILL_GLIB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + CC_RFKILL_TYPE_GLIB, CcRfkillGlibClass)) #define RFKILL_IS_GLIB(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - RFKILL_TYPE_GLIB)) + CC_RFKILL_TYPE_GLIB)) #define RFKILL_IS_GLIB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \ - RFKILL_TYPE_GLIB)) + CC_RFKILL_TYPE_GLIB)) #define RFKILL_GET_GLIB_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \ - RFKILL_TYPE_GLIB, RfkillGlibClass)) + CC_RFKILL_TYPE_GLIB, CcRfkillGlibClass)) -typedef struct RfkillGlibPrivate RfkillGlibPrivate; +typedef struct CcRfkillGlibPrivate CcRfkillGlibPrivate; -typedef struct _RfkillGlib { +typedef struct _CcRfkillGlib { GObject parent; - RfkillGlibPrivate *priv; -} RfkillGlib; + CcRfkillGlibPrivate *priv; +} CcRfkillGlib; -typedef struct _RfkillGlibClass { +typedef struct _CcRfkillGlibClass { GObjectClass parent_class; - void (*changed) (RfkillGlib *rfkill, GList *events); -} RfkillGlibClass; + void (*changed) (CcRfkillGlib *rfkill, GList *events); +} CcRfkillGlibClass; -GType rfkill_glib_get_type(void); +GType cc_rfkill_glib_get_type(void); -RfkillGlib *rfkill_glib_new (void); -int rfkill_glib_open (RfkillGlib *rfkill); -int rfkill_glib_send_event (RfkillGlib *rfkill, struct rfkill_event *event); +CcRfkillGlib *cc_rfkill_glib_new (void); +int cc_rfkill_glib_open (CcRfkillGlib *rfkill); +int cc_rfkill_glib_send_event (CcRfkillGlib *rfkill, struct rfkill_event *event); G_END_DECLS -#endif /* __RFKILL_GLIB_H */ +#endif /* __CC_RFKILL_GLIB_H */ |