Hello community,
here is the log from the commit of package libayatana-indicator for
openSUSE:Factory checked in at 2020-03-16 10:20:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libayatana-indicator (Old)
and /work/SRC/openSUSE:Factory/.libayatana-indicator.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libayatana-indicator"
Mon Mar 16 10:20:48 2020 rev:4 rq:785410 version:0.6.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/libayatana-indicator/libayatana-indicator.changes
2019-11-07 23:16:35.788539375 +0100
+++
/work/SRC/openSUSE:Factory/.libayatana-indicator.new.3160/libayatana-indicator.changes
2020-03-16 10:21:52.499673669 +0100
@@ -1,0 +2,12 @@
+Mon Mar 16 04:24:12 UTC 2020 - Marguerite Su <[email protected]>
+
+- add libayatana-indicator-Wno-error-deprecated-declarations.patch
+ * add Wno-error=deprecated-declarations option to tools
+- add libayatana-indicator-glib-2.58.patch
+ * g_type_class_add_private was deprecated since glib 2.58
+ get rid of it and self-defined *_GET_PRIVATE() functions,
+ use G_DEFINE_TYPE_* and auto-generated *_get_instance_private()
+ instead.
+- drop libayatana-indicator-disable-werror.patch
+
+-------------------------------------------------------------------
Old:
----
libayatana-indicator-disable-werror.patch
New:
----
libayatana-indicator-Wno-error-deprecated-declarations.patch
libayatana-indicator-glib-2.58.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libayatana-indicator.spec ++++++
--- /var/tmp/diff_new_pack.AiHFQt/_old 2020-03-16 10:21:52.951673853 +0100
+++ /var/tmp/diff_new_pack.AiHFQt/_new 2020-03-16 10:21:52.955673854 +0100
@@ -1,7 +1,7 @@
#
# spec file for package libayatana-indicator
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -27,10 +27,12 @@
Group: System/GUI/Other
URL: https://github.com/AyatanaIndicators/libayatana-indicator
Source:
https://github.com/AyatanaIndicators/libayatana-indicator/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
-# PATCH-FIX-OPENSUSE libayatana-indicator-disable-werror.patch
[email protected] -- Disable -Werror.
-Patch0: libayatana-indicator-disable-werror.patch
+# PATCH-FIX-UPSTREAM fix G_ADD_PRIVATE error
+Patch0: libayatana-indicator-glib-2.58.patch
# PATCH-FIX-UPSTREAM
libayatana-indicator-Wno-error-deprecated-declarations-for-tests.patch
Patch1:
libayatana-indicator-Wno-error-deprecated-declarations-for-tests.patch
+# PATCH-FIX-UPSTREAM
libayatana-indicator-Wno-error-deprecated-declarations.patch
+Patch2: libayatana-indicator-Wno-error-deprecated-declarations.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
++++++ libayatana-indicator-Wno-error-deprecated-declarations.patch ++++++
Index: libayatana-indicator-0.6.2/tools/Makefile.am
===================================================================
--- libayatana-indicator-0.6.2.orig/tools/Makefile.am
+++ libayatana-indicator-0.6.2/tools/Makefile.am
@@ -13,7 +13,7 @@ ayatana_indicator_loader_SOURCES = \
indicator-loader.c
ayatana_indicator_loader_CFLAGS = \
- -Wall -Werror \
+ -Wall -Werror -Wno-error=deprecated-declarations \
$(LIBINDICATOR_CFLAGS) -I$(top_srcdir) \
-DBUILD_DIR="\"$(builddir)\""
++++++ libayatana-indicator-glib-2.58.patch ++++++
Index:
libayatana-indicator-0.6.2.old/libayatana-indicator/indicator-desktop-shortcuts.c
===================================================================
---
libayatana-indicator-0.6.2.old.orig/libayatana-indicator/indicator-desktop-shortcuts.c
+++
libayatana-indicator-0.6.2.old/libayatana-indicator/indicator-desktop-shortcuts.c
@@ -60,9 +60,6 @@ enum {
PROP_IDENTITY
};
-#define INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o),
INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcutsPrivate))
-
static void indicator_desktop_shortcuts_class_init
(IndicatorDesktopShortcutsClass *klass);
static void indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts
*self);
static void indicator_desktop_shortcuts_dispose (GObject *object);
@@ -72,7 +69,7 @@ static void get_property (GObject * obje
static void parse_keyfile (IndicatorDesktopShortcuts * ids);
static gboolean should_show (GKeyFile * keyfile, const gchar * group, const
gchar * identity, gboolean should_have_target);
-G_DEFINE_TYPE (IndicatorDesktopShortcuts, indicator_desktop_shortcuts,
G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_CODE (IndicatorDesktopShortcuts,
indicator_desktop_shortcuts, G_TYPE_OBJECT,
G_ADD_PRIVATE(IndicatorDesktopShortcuts));
/* Build up the class */
static void
@@ -80,8 +77,6 @@ indicator_desktop_shortcuts_class_init (
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof
(IndicatorDesktopShortcutsPrivate));
-
object_class->dispose = indicator_desktop_shortcuts_dispose;
object_class->finalize = indicator_desktop_shortcuts_finalize;
@@ -109,7 +104,7 @@ indicator_desktop_shortcuts_class_init (
static void
indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self)
{
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(self);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(self);
priv->keyfile = NULL;
priv->identity = NULL;
@@ -124,7 +119,8 @@ indicator_desktop_shortcuts_init (Indica
static void
indicator_desktop_shortcuts_dispose (GObject *object)
{
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object);
+ IndicatorDesktopShortcuts * shortcuts =
INDICATOR_DESKTOP_SHORTCUTS(object);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(shortcuts);
if (priv->keyfile) {
g_key_file_free(priv->keyfile);
@@ -139,7 +135,8 @@ indicator_desktop_shortcuts_dispose (GOb
static void
indicator_desktop_shortcuts_finalize (GObject *object)
{
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object);
+ IndicatorDesktopShortcuts * shortcuts =
INDICATOR_DESKTOP_SHORTCUTS(object);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(shortcuts);
if (priv->identity != NULL) {
g_free(priv->identity);
@@ -170,7 +167,8 @@ static void
set_property (GObject * object, guint prop_id, const GValue * value,
GParamSpec * pspec)
{
g_return_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(object));
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object);
+ IndicatorDesktopShortcuts * shortcuts =
INDICATOR_DESKTOP_SHORTCUTS(object);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(shortcuts);
switch(prop_id) {
case PROP_DESKTOP_FILE: {
@@ -233,7 +231,8 @@ static void
get_property (GObject * object, guint prop_id, GValue * value, GParamSpec *
pspec)
{
g_return_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(object));
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object);
+ IndicatorDesktopShortcuts * shortcuts =
INDICATOR_DESKTOP_SHORTCUTS(object);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(shortcuts);
switch(prop_id) {
case PROP_IDENTITY:
@@ -253,7 +252,7 @@ get_property (GObject * object, guint pr
static void
parse_keyfile (IndicatorDesktopShortcuts * ids)
{
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(ids);
if (priv->keyfile == NULL) {
return;
@@ -475,7 +474,7 @@ const gchar **
indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids)
{
g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), NULL);
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(ids);
return (const gchar **)priv->nicks->data;
}
@@ -497,7 +496,7 @@ gchar *
indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids,
const gchar * nick)
{
g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), NULL);
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(ids);
g_return_val_if_fail(priv->actions != ACTIONS_NONE, NULL);
g_return_val_if_fail(priv->keyfile != NULL, NULL);
@@ -574,7 +573,7 @@ indicator_desktop_shortcuts_nick_exec_wi
gchar * current_dir = NULL;
g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), FALSE);
- IndicatorDesktopShortcutsPrivate * priv =
INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids);
+ IndicatorDesktopShortcutsPrivate * priv =
indicator_desktop_shortcuts_get_instance_private(ids);
g_return_val_if_fail(priv->actions != ACTIONS_NONE, FALSE);
g_return_val_if_fail(priv->keyfile != NULL, FALSE);
Index: libayatana-indicator-0.6.2.old/libayatana-indicator/indicator-object.c
===================================================================
--- libayatana-indicator-0.6.2.old.orig/libayatana-indicator/indicator-object.c
+++ libayatana-indicator-0.6.2.old/libayatana-indicator/indicator-object.c
@@ -60,6 +60,7 @@ IndicatorObjectEntryPrivate;
Structure to define the memory for the private area
of the object instance.
*/
+typedef struct _IndicatorObjectPrivate IndicatorObjectPrivate;
struct _IndicatorObjectPrivate {
GModule * module;
@@ -74,8 +75,6 @@ struct _IndicatorObjectPrivate {
GStrv environments;
};
-#define INDICATOR_OBJECT_GET_PRIVATE(o) (INDICATOR_OBJECT(o)->priv)
-
/* Signals Stuff */
enum {
@@ -118,7 +117,7 @@ static void indicator_object_entry_was_a
static gint indicator_object_real_get_position (IndicatorObject*);
static IndicatorObjectEntryPrivate * entry_get_private (IndicatorObject*,
IndicatorObjectEntry*);
-G_DEFINE_TYPE (IndicatorObject, indicator_object, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_CODE (IndicatorObject, indicator_object, G_TYPE_OBJECT,
G_ADD_PRIVATE(IndicatorObject));
/* Setup the class and put the functions into the
class structure */
@@ -127,8 +126,6 @@ indicator_object_class_init (IndicatorOb
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (IndicatorObjectPrivate));
-
object_class->dispose = indicator_object_dispose;
object_class->finalize = indicator_object_finalize;
object_class->set_property = set_property;
@@ -304,7 +301,7 @@ indicator_object_class_init (IndicatorOb
static void
indicator_object_init (IndicatorObject *self)
{
- IndicatorObjectPrivate * priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
INDICATOR_OBJECT_TYPE, IndicatorObjectPrivate);
+ IndicatorObjectPrivate * priv =
indicator_object_get_instance_private(self);
priv->module = NULL;
@@ -360,7 +357,8 @@ module_unref (gpointer data)
static void
indicator_object_finalize (GObject *object)
{
- IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(object);
+ IndicatorObject * obj = INDICATOR_OBJECT(object);
+ IndicatorObjectPrivate * priv =
indicator_object_get_instance_private(obj);
if (priv->entry_privates != NULL) {
g_hash_table_destroy (priv->entry_privates);
@@ -466,7 +464,9 @@ indicator_object_new_from_file (const gc
}
/* Now we can track the module */
- INDICATOR_OBJECT_GET_PRIVATE(object)->module = module;
+ IndicatorObject * obj = INDICATOR_OBJECT(object);
+ IndicatorObjectPrivate * priv =
indicator_object_get_instance_private(obj);
+ priv->module = module;
return INDICATOR_OBJECT(object);
@@ -487,7 +487,7 @@ unrefandout:
static GList *
get_entries_default (IndicatorObject * io)
{
- IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(io);
+ IndicatorObjectPrivate * priv =
indicator_object_get_instance_private(io);
if (!priv->gotten_entries) {
IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io);
@@ -603,7 +603,8 @@ indicator_object_get_entries (IndicatorO
GList * l;
GList * ret = NULL;
GList * all_entries = get_all_entries (io);
- const gboolean default_visibility =
INDICATOR_OBJECT_GET_PRIVATE(io)->default_visibility;
+ IndicatorObjectPrivate * priv =
indicator_object_get_instance_private(io);
+ const gboolean default_visibility = priv->default_visibility;
for (l=all_entries; l!=NULL; l=l->next)
{
@@ -900,7 +901,7 @@ get_property (GObject * object,
IndicatorObject * self = INDICATOR_OBJECT(object);
g_return_if_fail(self != NULL);
- IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(self);
+ IndicatorObjectPrivate * priv =
indicator_object_get_instance_private(self);
g_return_if_fail(priv != NULL);
switch (prop_id) {
@@ -928,7 +929,7 @@ set_property (GObject * object,
IndicatorObject * self = INDICATOR_OBJECT(object);
g_return_if_fail (self != NULL);
- IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(self);
+ IndicatorObjectPrivate * priv =
indicator_object_get_instance_private(self);
g_return_if_fail (priv != NULL);
Index: libayatana-indicator-0.6.2.old/libayatana-indicator/indicator-service.c
===================================================================
--- libayatana-indicator-0.6.2.old.orig/libayatana-indicator/indicator-service.c
+++ libayatana-indicator-0.6.2.old/libayatana-indicator/indicator-service.c
@@ -84,9 +84,6 @@ enum {
#define PROP_VERSION_S "version"
/* GObject Stuff */
-#define INDICATOR_SERVICE_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o),
INDICATOR_SERVICE_TYPE, IndicatorServicePrivate))
-
static void indicator_service_class_init (IndicatorServiceClass *klass);
static void indicator_service_init (IndicatorService *self);
static void indicator_service_dispose (GObject *object);
@@ -108,15 +105,13 @@ static GDBusInterfaceVTable interf
};
/* THE define */
-G_DEFINE_TYPE (IndicatorService, indicator_service, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_CODE (IndicatorService, indicator_service, G_TYPE_OBJECT,
G_ADD_PRIVATE(IndicatorService));
static void
indicator_service_class_init (IndicatorServiceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (IndicatorServicePrivate));
-
object_class->dispose = indicator_service_dispose;
object_class->finalize = indicator_service_finalize;
@@ -184,7 +179,7 @@ indicator_service_class_init (IndicatorS
static void
indicator_service_init (IndicatorService *self)
{
- IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(self);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(self);
/* Get the private variables in a decent state */
priv->name = NULL;
@@ -231,7 +226,8 @@ indicator_service_init (IndicatorService
static void
indicator_service_dispose (GObject *object)
{
- IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(object);
+ IndicatorService * service = INDICATOR_SERVICE(object);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
g_clear_pointer (&priv->watchers, g_hash_table_destroy);
@@ -263,7 +259,8 @@ indicator_service_dispose (GObject *obje
static void
indicator_service_finalize (GObject *object)
{
- IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(object);
+ IndicatorService * service = INDICATOR_SERVICE(object);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
g_free (priv->name);
g_clear_pointer (&priv->watchers, g_hash_table_destroy);
@@ -280,7 +277,7 @@ set_property (GObject * object, guint pr
IndicatorService * self = INDICATOR_SERVICE(object);
g_return_if_fail(self != NULL);
- IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(self);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(self);
g_return_if_fail(priv != NULL);
switch (prop_id) {
@@ -318,7 +315,7 @@ get_property (GObject * object, guint pr
IndicatorService * self = INDICATOR_SERVICE(object);
g_return_if_fail(self != NULL);
- IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(self);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(self);
g_return_if_fail(priv != NULL);
switch (prop_id) {
@@ -357,7 +354,8 @@ bus_get_cb (GObject * object, GAsyncResu
return;
}
- IndicatorServicePrivate * priv =
INDICATOR_SERVICE_GET_PRIVATE(user_data);
+ IndicatorService * service = INDICATOR_SERVICE(user_data);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
g_warn_if_fail(priv->bus == NULL);
priv->bus = connection;
@@ -439,7 +437,8 @@ try_and_get_name_acquired_cb (GDBusConne
g_return_if_fail(connection != NULL);
g_return_if_fail(INDICATOR_IS_SERVICE(user_data));
- IndicatorServicePrivate * priv =
INDICATOR_SERVICE_GET_PRIVATE(user_data);
+ IndicatorService * service = INDICATOR_SERVICE(user_data);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
/* Check to see if we already had a timer, if so we want to
extend it a bit. */
@@ -463,7 +462,8 @@ try_and_get_name_lost_cb (GDBusConnectio
g_return_if_fail(connection != NULL);
g_return_if_fail(INDICATOR_IS_SERVICE(user_data));
- IndicatorServicePrivate * priv =
INDICATOR_SERVICE_GET_PRIVATE(user_data);
+ IndicatorService * service = INDICATOR_SERVICE(user_data);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
if (!priv->replace_mode) {
g_warning("Name request failed.");
@@ -498,7 +498,7 @@ try_and_get_name_lost_cb (GDBusConnectio
static void
try_and_get_name (IndicatorService * service)
{
- IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
g_return_if_fail(priv->name != NULL);
g_bus_own_name(G_BUS_TYPE_SESSION,
@@ -519,7 +519,8 @@ static void
watcher_vanished_cb (GDBusConnection * connection, const gchar * name,
gpointer user_data)
{
g_return_if_fail(INDICATOR_IS_SERVICE(user_data));
- IndicatorServicePrivate * priv =
INDICATOR_SERVICE_GET_PRIVATE(user_data);
+ IndicatorService * service = INDICATOR_SERVICE(user_data);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
gpointer finddata = g_hash_table_lookup(priv->watchers, name);
if (finddata != NULL) {
@@ -539,7 +540,7 @@ static GVariant *
bus_watch (IndicatorService * service, const gchar * sender)
{
g_return_val_if_fail(INDICATOR_IS_SERVICE(service), NULL);
- IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
if (GPOINTER_TO_UINT(g_hash_table_lookup(priv->watchers, sender)) == 0)
{
guint watch = g_bus_watch_name_on_connection(priv->bus,
@@ -574,7 +575,7 @@ unwatch_core (IndicatorService * service
g_return_if_fail(name != NULL);
g_return_if_fail(INDICATOR_IS_SERVICE(service));
- IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service);
+ IndicatorServicePrivate * priv =
indicator_service_get_instance_private(service);
/* Remove us from the watcher list here */
gpointer watcher_item = g_hash_table_lookup(priv->watchers, name);
Index:
libayatana-indicator-0.6.2.old/libayatana-indicator/indicator-service-manager.c
===================================================================
---
libayatana-indicator-0.6.2.old.orig/libayatana-indicator/indicator-service-manager.c
+++
libayatana-indicator-0.6.2.old/libayatana-indicator/indicator-service-manager.c
@@ -88,9 +88,6 @@ static GDBusNodeInfo * node_i
static GDBusInterfaceInfo * interface_info = NULL;
/* GObject Stuff */
-#define INDICATOR_SERVICE_MANAGER_GET_PRIVATE(o) \
-(G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_SERVICE_MANAGER_TYPE,
IndicatorServiceManagerPrivate))
-
static void indicator_service_manager_class_init (IndicatorServiceManagerClass
*klass);
static void indicator_service_manager_init (IndicatorServiceManager
*self);
static void indicator_service_manager_dispose (GObject *object);
@@ -105,7 +102,7 @@ static void unwatch (GDBusProxy * proxy)
static void service_proxy_cb (GObject * object, GAsyncResult * res, gpointer
user_data);
static void service_proxy_name_changed (GDBusConnection * connection, const
gchar * sender_name, const gchar * object_path, const gchar * interface_name,
const gchar * signal_name, GVariant * parameters, gpointer user_data);
-G_DEFINE_TYPE (IndicatorServiceManager, indicator_service_manager,
G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_CODE (IndicatorServiceManager, indicator_service_manager,
G_TYPE_OBJECT, G_ADD_PRIVATE(IndicatorServiceManager));
/* Build all of our signals and proxies and tie everything
all together. Lovely. */
@@ -114,8 +111,6 @@ indicator_service_manager_class_init (In
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof
(IndicatorServiceManagerPrivate));
-
object_class->dispose = indicator_service_manager_dispose;
object_class->finalize = indicator_service_manager_finalize;
@@ -181,7 +176,7 @@ indicator_service_manager_class_init (In
static void
indicator_service_manager_init (IndicatorServiceManager *self)
{
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(self);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(self);
/* Get the private variables in a decent state */
priv->name = NULL;
@@ -204,7 +199,8 @@ indicator_service_manager_init (Indicato
static void
indicator_service_manager_dispose (GObject *object)
{
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(object);
+ IndicatorServiceManager * service = INDICATOR_SERVICE_MANAGER(object);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(service);
/* Removing the idle task to restart if it exists. */
if (priv->restart_source != 0) {
@@ -263,7 +259,8 @@ indicator_service_manager_dispose (GObje
static void
indicator_service_manager_finalize (GObject *object)
{
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(object);
+ IndicatorServiceManager * service = INDICATOR_SERVICE_MANAGER(object);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(service);
if (priv->name != NULL) {
g_free(priv->name);
@@ -282,7 +279,7 @@ set_property (GObject * object, guint pr
IndicatorServiceManager * self = INDICATOR_SERVICE_MANAGER(object);
g_return_if_fail(self != NULL);
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(self);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(self);
g_return_if_fail(priv != NULL);
switch (prop_id) {
@@ -316,7 +313,7 @@ get_property (GObject * object, guint pr
IndicatorServiceManager * self = INDICATOR_SERVICE_MANAGER(object);
g_return_if_fail(self != NULL);
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(self);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(self);
g_return_if_fail(priv != NULL);
switch (prop_id) {
@@ -363,7 +360,8 @@ static void
watch_cb (GObject * object, GAsyncResult * res, gpointer user_data)
{
GError * error = NULL;
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data);
+ IndicatorServiceManager * service =
INDICATOR_SERVICE_MANAGER(user_data);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(service);
GVariant * params = g_dbus_proxy_call_finish(G_DBUS_PROXY(object), res,
&error);
@@ -421,7 +419,7 @@ watch_cb (GObject * object, GAsyncResult
static void
start_service (IndicatorServiceManager * service)
{
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(service);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(service);
g_return_if_fail(priv->name != NULL);
@@ -463,7 +461,7 @@ service_proxy_cb (GObject * object, GAsy
GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(service);
if (priv->service_proxy_cancel != NULL) {
g_object_unref(priv->service_proxy_cancel);
@@ -534,7 +532,8 @@ service_proxy_name_changed (GDBusConnect
gpointer user_data)
{
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data);
+ IndicatorServiceManager *service = INDICATOR_SERVICE_MANAGER(user_data);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(service);
const gchar * new_name = NULL;
const gchar * prev_name = NULL;
@@ -580,7 +579,8 @@ service_proxy_name_changed (GDBusConnect
static gboolean
start_service_again_cb (gpointer data)
{
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(data);
+ IndicatorServiceManager * service = INDICATOR_SERVICE_MANAGER(data);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(service);
priv->restart_count++;
g_debug("Restarting service '%s' count %d", priv->name,
priv->restart_count);
start_service(INDICATOR_SERVICE_MANAGER(data));
@@ -595,7 +595,7 @@ start_service_again_cb (gpointer data)
static void
start_service_again (IndicatorServiceManager * manager)
{
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(manager);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(manager);
/* If we've already got a restart source running then
let's not do this again. */
@@ -683,7 +683,7 @@ gboolean
indicator_service_manager_connected (IndicatorServiceManager * sm)
{
g_return_val_if_fail(INDICATOR_IS_SERVICE_MANAGER(sm), FALSE);
- IndicatorServiceManagerPrivate * priv =
INDICATOR_SERVICE_MANAGER_GET_PRIVATE(sm);
+ IndicatorServiceManagerPrivate * priv =
indicator_service_manager_get_instance_private(sm);
return priv->connected;
}