diff options
author | Alberto Mardegan <alberto.mardegan@canonical.com> | 2012-08-21 10:38:09 +0300 |
---|---|---|
committer | Alberto Mardegan <alberto.mardegan@canonical.com> | 2012-08-21 10:38:09 +0300 |
commit | 8ebef3969c9b69dc0fe24cd2ad33530a2e0b0e4c (patch) | |
tree | 1335c3f7beec55180e0ed1564e79315941ee4280 | |
parent | 0f662c6404c8feea54028126f3010ac24d48317e (diff) | |
download | ayatana-indicator-session-8ebef3969c9b69dc0fe24cd2ad33530a2e0b0e4c.tar.gz ayatana-indicator-session-8ebef3969c9b69dc0fe24cd2ad33530a2e0b0e4c.tar.bz2 ayatana-indicator-session-8ebef3969c9b69dc0fe24cd2ad33530a2e0b0e4c.zip |
Class rename
Rename the class from Webcredentials to OnlineAccounts, for improved
consistency.
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/online-accounts-mgr.c (renamed from src/webcredentials-mgr.c) | 48 | ||||
-rw-r--r-- | src/online-accounts-mgr.h | 50 | ||||
-rw-r--r-- | src/session-menu-mgr.c | 10 | ||||
-rw-r--r-- | src/webcredentials-mgr.h | 50 |
5 files changed, 81 insertions, 81 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index b28ca4a..cd82812 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -134,8 +134,8 @@ indicator_session_service_SOURCES = \ users-service-dbus.c \ session-menu-mgr.h \ session-menu-mgr.c \ - webcredentials-mgr.c \ - webcredentials-mgr.h + online-accounts-mgr.c \ + online-accounts-mgr.h indicator_session_service_CFLAGS = \ $(SESSIONSERVICE_CFLAGS) \ diff --git a/src/webcredentials-mgr.c b/src/online-accounts-mgr.c index 17c3e46..ccdea39 100644 --- a/src/webcredentials-mgr.c +++ b/src/online-accounts-mgr.c @@ -20,25 +20,25 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <gio/gio.h> #include <glib/gi18n.h> -#include "webcredentials-mgr.h" +#include "online_accounts-mgr.h" #include <libdbusmenu-glib/client.h> -struct _WebcredentialsMgr +struct _OnlineAccountsMgr { GObject parent_instance; GDBusProxy *proxy; DbusmenuMenuitem *menu_item; }; -#define WEBCREDENTIALS_OBJECT_PATH "/com/canonical/indicators/webcredentials" -#define WEBCREDENTIALS_BUS_NAME "com.canonical.indicators.webcredentials" -#define WEBCREDENTIALS_INTERFACE WEBCREDENTIALS_BUS_NAME +#define ONLINE_ACCOUNTS_OBJECT_PATH "/com/canonical/indicators/webcredentials" +#define ONLINE_ACCOUNTS_BUS_NAME "com.canonical.indicators.webcredentials" +#define ONLINE_ACCOUNTS_INTERFACE ONLINE_ACCOUNTS_BUS_NAME -G_DEFINE_TYPE (WebcredentialsMgr, webcredentials_mgr, G_TYPE_OBJECT); +G_DEFINE_TYPE (OnlineAccountsMgr, online_accounts_mgr, G_TYPE_OBJECT); static void -update_disposition (WebcredentialsMgr *self, GVariant *error_status_prop) +update_disposition (OnlineAccountsMgr *self, GVariant *error_status_prop) { gboolean error_status; @@ -54,7 +54,7 @@ static void on_properties_changed (GDBusProxy *proxy, GVariant *changed_properties, GStrv invalidated_properties, - WebcredentialsMgr *self) + OnlineAccountsMgr *self) { if (g_variant_n_children (changed_properties) > 0) { GVariantIter *iter; @@ -74,19 +74,19 @@ on_properties_changed (GDBusProxy *proxy, static void on_menu_item_activated (DbusmenuMenuitem *menu_item, guint timestamp, - WebcredentialsMgr *self) + OnlineAccountsMgr *self) { GError *error = NULL; if (!g_spawn_command_line_async("gnome-control-center credentials", &error)) { - g_warning("Unable to show control centre: %s", error->message); + g_warning("Unable to show control center: %s", error->message); g_error_free(error); } } static void -webcredentials_mgr_init (WebcredentialsMgr *self) +online_accounts_mgr_init (OnlineAccountsMgr *self) { GError *error = NULL; GVariant *error_status_prop; @@ -107,13 +107,13 @@ webcredentials_mgr_init (WebcredentialsMgr *self) g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, NULL, - WEBCREDENTIALS_BUS_NAME, - WEBCREDENTIALS_OBJECT_PATH, - WEBCREDENTIALS_INTERFACE, + ONLINE_ACCOUNTS_BUS_NAME, + ONLINE_ACCOUNTS_OBJECT_PATH, + ONLINE_ACCOUNTS_INTERFACE, NULL, &error); if (G_UNLIKELY (error != NULL)) { - g_warning ("Couldn't create webcredentials proxy: %s", error->message); + g_warning ("Couldn't create online_accounts proxy: %s", error->message); g_clear_error (&error); return; } @@ -130,9 +130,9 @@ webcredentials_mgr_init (WebcredentialsMgr *self) } static void -webcredentials_mgr_dispose (GObject *object) +online_accounts_mgr_dispose (GObject *object) { - WebcredentialsMgr *self = WEBCREDENTIALS_MGR (object); + OnlineAccountsMgr *self = ONLINE_ACCOUNTS_MGR (object); if (self->proxy != NULL) { g_object_unref (self->proxy); @@ -144,23 +144,23 @@ webcredentials_mgr_dispose (GObject *object) self->menu_item = NULL; } - G_OBJECT_CLASS (webcredentials_mgr_parent_class)->dispose (object); + G_OBJECT_CLASS (online_accounts_mgr_parent_class)->dispose (object); } static void -webcredentials_mgr_class_init (WebcredentialsMgrClass *klass) +online_accounts_mgr_class_init (OnlineAccountsMgrClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->dispose = webcredentials_mgr_dispose; + object_class->dispose = online_accounts_mgr_dispose; } -WebcredentialsMgr *webcredentials_mgr_new () +OnlineAccountsMgr *online_accounts_mgr_new () { - return g_object_new (WEBCREDENTIALS_TYPE_MGR, NULL); + return g_object_new (ONLINE_ACCOUNTS_TYPE_MGR, NULL); } -DbusmenuMenuitem *webcredentials_mgr_get_menu_item (WebcredentialsMgr *self) +DbusmenuMenuitem *online_accounts_mgr_get_menu_item (OnlineAccountsMgr *self) { - g_return_val_if_fail (WEBCREDENTIALS_IS_MGR (self), NULL); + g_return_val_if_fail (ONLINE_ACCOUNTS_IS_MGR (self), NULL); return self->menu_item; } diff --git a/src/online-accounts-mgr.h b/src/online-accounts-mgr.h new file mode 100644 index 0000000..16c0461 --- /dev/null +++ b/src/online-accounts-mgr.h @@ -0,0 +1,50 @@ +/* +Copyright 2012 Canonical Ltd. + +Authors: + Alberto Mardegan <alberto.mardegan@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef _ONLINE_ACCOUNTS_MGR_H_ +#define _ONLINE_ACCOUNTS_MGR_H_ + +#include <glib-object.h> +#include <libdbusmenu-glib/menuitem.h> + +G_BEGIN_DECLS + +#define ONLINE_ACCOUNTS_TYPE_MGR (online_accounts_mgr_get_type ()) +#define ONLINE_ACCOUNTS_MGR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ONLINE_ACCOUNTS_TYPE_MGR, OnlineAccountsMgr)) +#define ONLINE_ACCOUNTS_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ONLINE_ACCOUNTS_TYPE_MGR, OnlineAccountsMgrClass)) +#define ONLINE_ACCOUNTS_IS_MGR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ONLINE_ACCOUNTS_TYPE_MGR)) +#define ONLINE_ACCOUNTS_IS_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ONLINE_ACCOUNTS_TYPE_MGR)) +#define ONLINE_ACCOUNTS_MGR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ONLINE_ACCOUNTS_TYPE_MGR, OnlineAccountsMgrClass)) + +typedef struct _OnlineAccountsMgrClass OnlineAccountsMgrClass; +typedef struct _OnlineAccountsMgr OnlineAccountsMgr; + +struct _OnlineAccountsMgrClass +{ + GObjectClass parent_class; +}; + +GType online_accounts_mgr_get_type (void) G_GNUC_CONST; +OnlineAccountsMgr *online_accounts_mgr_new (void); + +DbusmenuMenuitem *online_accounts_mgr_get_menu_item (OnlineAccountsMgr *self); + +G_END_DECLS + +#endif /* _ONLINE_ACCOUNTS_MGR_H_ */ diff --git a/src/session-menu-mgr.c b/src/session-menu-mgr.c index 1a66a44..72a4735 100644 --- a/src/session-menu-mgr.c +++ b/src/session-menu-mgr.c @@ -33,7 +33,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "session-menu-mgr.h" #include "shared-names.h" #include "users-service-dbus.h" -#include "webcredentials-mgr.h" +#include "online_accounts-mgr.h" #define DEBUG_SHOW_ALL FALSE @@ -116,7 +116,7 @@ struct _SessionMenuMgr DBusUPower * upower_proxy; SessionDbus * session_dbus; UsersServiceDbus * users_dbus_facade; - WebcredentialsMgr * webcredentials_mgr; + OnlineAccountsMgr * online_accounts_mgr; }; static SwitcherMode get_switcher_mode (SessionMenuMgr *); @@ -198,7 +198,7 @@ session_menu_mgr_init (SessionMenuMgr *mgr) init_upower_proxy (mgr); /* Online accounts menu item */ - mgr->webcredentials_mgr = webcredentials_mgr_new (); + mgr->online_accounts_mgr = online_accounts_mgr_new (); } static void @@ -219,7 +219,7 @@ session_menu_mgr_dispose (GObject *object) g_clear_object (&mgr->users_dbus_facade); g_clear_object (&mgr->top_mi); g_clear_object (&mgr->session_dbus); - g_clear_object (&mgr->webcredentials_mgr); + g_clear_object (&mgr->online_accounts_mgr); g_slist_free (mgr->user_menuitems); mgr->user_menuitems = NULL; @@ -476,7 +476,7 @@ build_session_menuitems (SessionMenuMgr* mgr) DbusmenuMenuitem * mi; mi = mgr->online_accounts_mi = - webcredentials_mgr_get_menu_item (mgr->webcredentials_mgr); + online_accounts_mgr_get_menu_item (mgr->online_accounts_mgr); dbusmenu_menuitem_child_append (mgr->top_mi, mi); mi = mgr->online_accounts_separator = mi_new_separator (); diff --git a/src/webcredentials-mgr.h b/src/webcredentials-mgr.h deleted file mode 100644 index 6c16ea0..0000000 --- a/src/webcredentials-mgr.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2012 Canonical Ltd. - -Authors: - Alberto Mardegan <alberto.mardegan@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef _WEBCREDENTIALS_MGR_H_ -#define _WEBCREDENTIALS_MGR_H_ - -#include <glib-object.h> -#include <libdbusmenu-glib/menuitem.h> - -G_BEGIN_DECLS - -#define WEBCREDENTIALS_TYPE_MGR (webcredentials_mgr_get_type ()) -#define WEBCREDENTIALS_MGR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBCREDENTIALS_TYPE_MGR, WebcredentialsMgr)) -#define WEBCREDENTIALS_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WEBCREDENTIALS_TYPE_MGR, WebcredentialsMgrClass)) -#define WEBCREDENTIALS_IS_MGR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WEBCREDENTIALS_TYPE_MGR)) -#define WEBCREDENTIALS_IS_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WEBCREDENTIALS_TYPE_MGR)) -#define WEBCREDENTIALS_MGR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WEBCREDENTIALS_TYPE_MGR, WebcredentialsMgrClass)) - -typedef struct _WebcredentialsMgrClass WebcredentialsMgrClass; -typedef struct _WebcredentialsMgr WebcredentialsMgr; - -struct _WebcredentialsMgrClass -{ - GObjectClass parent_class; -}; - -GType webcredentials_mgr_get_type (void) G_GNUC_CONST; -WebcredentialsMgr *webcredentials_mgr_new (void); - -DbusmenuMenuitem *webcredentials_mgr_get_menu_item (WebcredentialsMgr *self); - -G_END_DECLS - -#endif /* _WEBCREDENTIALS_MGR_H_ */ |