[tracker-miners/tracker-miners-2.2: 37/47] Use G_ADD_PRIVATE() instead of g_type_class_add_private()
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/tracker-miners-2.2: 37/47] Use G_ADD_PRIVATE() instead of g_type_class_add_private()
- Date: Mon, 5 Aug 2019 15:50:11 +0000 (UTC)
commit e5ebb256562eb27738536d174c3b2ac04a6cc0b5
Author: Sam Thursfield <sam afuera me uk>
Date: Thu Jul 11 12:37:14 2019 +0100
Use G_ADD_PRIVATE() instead of g_type_class_add_private()
This fixes deprecation warnings about g_type_class_add_private()
The new G_ADD_PRIVATE() method has been around since GLib 2.38 (we
already depend on 2.40 at minimum).
See this blog post for more details:
https://www.bassi.io/articles/2013/06/21/the-king-is-dead/
Fixes https://gitlab.gnome.org/GNOME/tracker/issues/115
src/miners/fs/tracker-config.c | 43 +++++++++++-------------
src/miners/fs/tracker-config.h | 1 -
src/miners/fs/tracker-miner-files-index.c | 6 ++--
src/miners/fs/tracker-miner-files.c | 5 ++-
src/miners/fs/tracker-power-hal.c | 32 +++++++++---------
src/miners/fs/tracker-power-upower.c | 23 ++++++-------
src/miners/fs/tracker-storage.c | 32 +++++++++---------
src/miners/fs/tracker-writeback-dispatcher.c | 5 ++-
src/miners/rss/tracker-miner-rss.c | 6 ++--
src/tracker-extract/tracker-extract-controller.c | 9 ++---
src/tracker-extract/tracker-extract-decorator.c | 40 +++++++++++-----------
src/tracker-extract/tracker-extract-decorator.h | 1 -
src/tracker-extract/tracker-extract.c | 6 ++--
src/tracker-writeback/tracker-writeback.c | 39 ++++++++++-----------
src/tracker-writeback/tracker-writeback.h | 1 -
15 files changed, 110 insertions(+), 139 deletions(-)
---
diff --git a/src/miners/fs/tracker-config.c b/src/miners/fs/tracker-config.c
index 4619d087c..136a37f20 100644
--- a/src/miners/fs/tracker-config.c
+++ b/src/miners/fs/tracker-config.c
@@ -126,7 +126,7 @@ enum {
};
-G_DEFINE_TYPE (TrackerConfig, tracker_config, G_TYPE_SETTINGS)
+G_DEFINE_TYPE_WITH_PRIVATE (TrackerConfig, tracker_config, G_TYPE_SETTINGS)
static void
tracker_config_class_init (TrackerConfigClass *klass)
@@ -303,14 +303,11 @@ tracker_config_class_init (TrackerConfigClass *klass)
"Set to false to disable writeback",
DEFAULT_ENABLE_WRITEBACK,
G_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (TrackerConfigPrivate));
}
static void
tracker_config_init (TrackerConfig *object)
{
- object->priv = G_TYPE_INSTANCE_GET_PRIVATE (object, TRACKER_TYPE_CONFIG, TrackerConfigPrivate);
}
static void
@@ -401,7 +398,7 @@ config_get_property (GObject *object,
GParamSpec *pspec)
{
TrackerConfig *config = TRACKER_CONFIG (object);
- TrackerConfigPrivate *priv = config->priv;
+ TrackerConfigPrivate *priv = tracker_config_get_instance_private (config);
switch (param_id) {
/* General */
@@ -478,7 +475,7 @@ config_finalize (GObject *object)
{
TrackerConfigPrivate *priv;
- priv = TRACKER_CONFIG (object)->priv;
+ priv = tracker_config_get_instance_private (TRACKER_CONFIG (object));
g_slist_foreach (priv->ignored_file_patterns,
(GFunc) g_pattern_spec_free,
@@ -561,7 +558,7 @@ config_set_ignored_file_conveniences (TrackerConfig *config)
GSList *paths = NULL;
GSList *patterns = NULL;
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
g_slist_foreach (priv->ignored_file_patterns,
(GFunc) g_pattern_spec_free,
@@ -602,7 +599,7 @@ config_set_ignored_directory_conveniences (TrackerConfig *config)
GSList *patterns = NULL;
GSList *paths = NULL;
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
g_slist_foreach (priv->ignored_directory_patterns,
(GFunc) g_pattern_spec_free,
@@ -839,7 +836,7 @@ tracker_config_get_index_recursive_directories (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->index_recursive_directories;
}
@@ -851,7 +848,7 @@ tracker_config_get_index_single_directories (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->index_single_directories;
}
@@ -863,7 +860,7 @@ tracker_config_get_ignored_directories (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->ignored_directories;
}
@@ -875,7 +872,7 @@ tracker_config_get_ignored_directories_with_content (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->ignored_directories_with_content;
}
@@ -887,7 +884,7 @@ tracker_config_get_ignored_files (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->ignored_files;
}
@@ -943,7 +940,7 @@ rebuild_filtered_lists (TrackerConfig *config)
* 1. Only notify on changes.
* 2. Don't update the unfiltered lists (since they have aliases)
*/
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
/* Filter single directories first, checking duplicates */
old_list = priv->index_single_directories;
@@ -1025,7 +1022,7 @@ config_set_index_recursive_directories (TrackerConfig *config,
g_return_if_fail (TRACKER_IS_CONFIG (config));
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
l = priv->index_recursive_directories_unfiltered;
@@ -1058,7 +1055,7 @@ config_set_index_single_directories (TrackerConfig *config,
g_return_if_fail (TRACKER_IS_CONFIG (config));
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
l = priv->index_single_directories_unfiltered;
@@ -1091,7 +1088,7 @@ config_set_ignored_directories (TrackerConfig *config,
g_return_if_fail (TRACKER_IS_CONFIG (config));
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
l = priv->ignored_directories;
@@ -1127,7 +1124,7 @@ config_set_ignored_directories_with_content (TrackerConfig *config,
g_return_if_fail (TRACKER_IS_CONFIG (config));
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
l = priv->ignored_directories_with_content;
@@ -1160,7 +1157,7 @@ config_set_ignored_files (TrackerConfig *config,
g_return_if_fail (TRACKER_IS_CONFIG (config));
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
l = priv->ignored_files;
@@ -1197,7 +1194,7 @@ tracker_config_get_ignored_directory_patterns (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->ignored_directory_patterns;
}
@@ -1209,7 +1206,7 @@ tracker_config_get_ignored_file_patterns (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->ignored_file_patterns;
}
@@ -1221,7 +1218,7 @@ tracker_config_get_ignored_directory_paths (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->ignored_directory_paths;
}
@@ -1233,7 +1230,7 @@ tracker_config_get_ignored_file_paths (TrackerConfig *config)
g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
- priv = config->priv;
+ priv = tracker_config_get_instance_private (config);
return priv->ignored_file_paths;
}
diff --git a/src/miners/fs/tracker-config.h b/src/miners/fs/tracker-config.h
index 9a5190b29..14961295b 100644
--- a/src/miners/fs/tracker-config.h
+++ b/src/miners/fs/tracker-config.h
@@ -36,7 +36,6 @@ typedef struct TrackerConfigClass TrackerConfigClass;
struct TrackerConfig {
GSettings parent;
- gpointer priv;
};
struct TrackerConfigClass {
diff --git a/src/miners/fs/tracker-miner-files-index.c b/src/miners/fs/tracker-miner-files-index.c
index 9a31e42ef..ac48e646b 100644
--- a/src/miners/fs/tracker-miner-files-index.c
+++ b/src/miners/fs/tracker-miner-files-index.c
@@ -71,7 +71,7 @@ enum {
PROP_FILES_MINER
};
-#define TRACKER_MINER_FILES_INDEX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),
TRACKER_TYPE_MINER_FILES_INDEX, TrackerMinerFilesIndexPrivate))
+#define TRACKER_MINER_FILES_INDEX_GET_PRIVATE(o) (tracker_miner_files_index_get_instance_private
(TRACKER_MINER_FILES_INDEX (o)))
static void index_set_property (GObject *object,
guint param_id,
@@ -83,7 +83,7 @@ static void index_get_property (GObject *object,
GParamSpec *pspec);
static void index_finalize (GObject *object);
-G_DEFINE_TYPE(TrackerMinerFilesIndex, tracker_miner_files_index, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE(TrackerMinerFilesIndex, tracker_miner_files_index, G_TYPE_OBJECT)
static void
tracker_miner_files_index_class_init (TrackerMinerFilesIndexClass *klass)
@@ -103,8 +103,6 @@ tracker_miner_files_index_class_init (TrackerMinerFilesIndexClass *klass)
"The FS Miner",
TRACKER_TYPE_MINER_FILES,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (klass, sizeof (TrackerMinerFilesIndexPrivate));
}
static void
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 623925b26..da92d60d3 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -55,7 +55,7 @@
#define TRACKER_EXTRACT_DATA_SOURCE TRACKER_PREFIX_TRACKER "extractor-data-source"
-#define TRACKER_MINER_FILES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_MINER_FILES,
TrackerMinerFilesPrivate))
+#define TRACKER_MINER_FILES_GET_PRIVATE(o) (tracker_miner_files_get_instance_private (TRACKER_MINER_FILES
(o)))
static GQuark miner_files_error_quark = 0;
@@ -239,6 +239,7 @@ static void miner_files_update_filters (TrackerMinerF
static GInitableIface* miner_files_initable_parent_iface;
G_DEFINE_TYPE_WITH_CODE (TrackerMinerFiles, tracker_miner_files, TRACKER_TYPE_MINER_FS,
+ G_ADD_PRIVATE (TrackerMinerFiles)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
miner_files_initable_iface_init));
@@ -378,8 +379,6 @@ tracker_miner_files_class_init (TrackerMinerFilesClass *klass)
TRACKER_TYPE_CONFIG,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_type_class_add_private (klass, sizeof (TrackerMinerFilesPrivate));
-
miner_files_error_quark = g_quark_from_static_string ("TrackerMinerFiles");
}
diff --git a/src/miners/fs/tracker-power-hal.c b/src/miners/fs/tracker-power-hal.c
index b2f7ac0aa..061ec0a4e 100644
--- a/src/miners/fs/tracker-power-hal.c
+++ b/src/miners/fs/tracker-power-hal.c
@@ -39,7 +39,7 @@
#define BATTERY_LOW_THRESHOLD 0.05f
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_POWER, TrackerPowerPriv))
+#define GET_PRIV(obj) (tracker_power_get_instance_private (TRACKER_POWER (obj)))
typedef struct {
LibHalContext *context;
@@ -50,7 +50,7 @@ typedef struct {
gchar *ac_adapter_udi;
gboolean on_battery;
gdouble battery_percentage;
-} TrackerPowerPriv;
+} TrackerPowerPrivate;
static void tracker_power_finalize (GObject *object);
static void hal_get_property (GObject *object,
@@ -81,7 +81,7 @@ enum {
PROP_ON_LOW_BATTERY
};
-G_DEFINE_TYPE (TrackerPower, tracker_power, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (TrackerPower, tracker_power, G_TYPE_OBJECT);
static void
tracker_power_class_init (TrackerPowerClass *klass)
@@ -107,14 +107,12 @@ tracker_power_class_init (TrackerPowerClass *klass)
"Whether the battery is low",
FALSE,
G_PARAM_READABLE));
-
- g_type_class_add_private (object_class, sizeof (TrackerPowerPriv));
}
static void
tracker_power_init (TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
DBusError error;
g_message ("Initializing HAL Power...");
@@ -185,7 +183,7 @@ tracker_power_init (TrackerPower *power)
static void
tracker_power_finalize (GObject *object)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
priv = GET_PRIV (object);
@@ -214,7 +212,7 @@ hal_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
priv = GET_PRIV (object);
@@ -235,7 +233,7 @@ hal_get_property (GObject *object,
static gboolean
hal_setup_ac_adapters (TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
DBusError error;
gchar **devices, **p;
gint num;
@@ -311,7 +309,7 @@ hal_setup_ac_adapters (TrackerPower *power)
static gboolean
hal_setup_batteries (TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
DBusError error;
gchar **devices, **p;
gint num;
@@ -360,7 +358,7 @@ hal_setup_batteries (TrackerPower *power)
static void
hal_battery_notify (TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
GList *values, *v;
gint percentage, n_values;
gdouble old_percentage;
@@ -399,7 +397,7 @@ static void
hal_battery_modify (TrackerPower *power,
const gchar *udi)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
gint percentage;
priv = GET_PRIV (power);
@@ -418,7 +416,7 @@ static void
hal_battery_remove (TrackerPower *power,
const gchar *udi)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
priv = GET_PRIV (power);
@@ -444,7 +442,7 @@ hal_device_removed_cb (LibHalContext *context,
const gchar *udi)
{
TrackerPower *power;
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
power = (TrackerPower*) libhal_ctx_get_user_data (context);
priv = GET_PRIV (power);
@@ -462,7 +460,7 @@ hal_device_property_modified_cb (LibHalContext *context,
dbus_bool_t is_added)
{
TrackerPower *power;
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
DBusError error;
power = (TrackerPower*) libhal_ctx_get_user_data (context);
@@ -519,7 +517,7 @@ tracker_power_new ()
gboolean
tracker_power_get_on_battery (TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
@@ -539,7 +537,7 @@ tracker_power_get_on_battery (TrackerPower *power)
gboolean
tracker_power_get_on_low_battery (TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
diff --git a/src/miners/fs/tracker-power-upower.c b/src/miners/fs/tracker-power-upower.c
index ba583ba45..875d88809 100644
--- a/src/miners/fs/tracker-power-upower.c
+++ b/src/miners/fs/tracker-power-upower.c
@@ -26,7 +26,7 @@
#include "tracker-power.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_POWER, TrackerPowerPriv))
+#define GET_PRIV(obj) (tracker_power_get_instance_private (TRACKER_POWER (obj)))
typedef struct {
UpClient *client;
@@ -35,7 +35,7 @@ typedef struct {
#endif
gboolean on_battery;
gboolean on_low_battery;
-} TrackerPowerPriv;
+} TrackerPowerPrivate;
static void tracker_power_initable_iface_init (GInitableIface *iface);
static void tracker_power_finalize (GObject *object);
@@ -55,6 +55,7 @@ enum {
};
G_DEFINE_TYPE_WITH_CODE (TrackerPower, tracker_power, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (TrackerPower)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, tracker_power_initable_iface_init));
static void
@@ -82,8 +83,6 @@ tracker_power_class_init (TrackerPowerClass *klass)
"Whether the battery is low",
FALSE,
G_PARAM_READABLE));
-
- g_type_class_add_private (object_class, sizeof (TrackerPowerPriv));
}
#ifndef HAVE_UP_CLIENT_GET_ON_LOW_BATTERY
@@ -92,7 +91,7 @@ on_on_battery_changed (UpClient *client,
GParamSpec *pspec,
TrackerPower *power)
{
- TrackerPowerPriv *priv = GET_PRIV (power);
+ TrackerPowerPrivate *priv = GET_PRIV (power);
gboolean on_battery;
on_battery = up_client_get_on_battery (priv->client);
@@ -107,7 +106,7 @@ on_warning_level_changed (UpDevice *device,
GParamSpec *pspec,
TrackerPower *power)
{
- TrackerPowerPriv *priv = GET_PRIV (power);
+ TrackerPowerPrivate *priv = GET_PRIV (power);
UpDeviceLevel warning_level;
gboolean on_low_battery;
@@ -130,7 +129,7 @@ tracker_power_initable_init (GInitable *initable,
GError **error)
{
TrackerPower *power;
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
g_message ("Initializing UPower...");
@@ -165,7 +164,7 @@ tracker_power_initable_init (GInitable *initable,
static void
tracker_power_finalize (GObject *object)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
priv = GET_PRIV (object);
@@ -184,7 +183,7 @@ tracker_power_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
priv = GET_PRIV (object);
@@ -206,7 +205,7 @@ static void
tracker_power_client_changed_cb (UpClient *client,
TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
gboolean on_battery;
gboolean on_low_battery;
@@ -267,7 +266,7 @@ tracker_power_new ()
gboolean
tracker_power_get_on_battery (TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
@@ -287,7 +286,7 @@ tracker_power_get_on_battery (TrackerPower *power)
gboolean
tracker_power_get_on_low_battery (TrackerPower *power)
{
- TrackerPowerPriv *priv;
+ TrackerPowerPrivate *priv;
g_return_val_if_fail (TRACKER_IS_POWER (power), TRUE);
diff --git a/src/miners/fs/tracker-storage.c b/src/miners/fs/tracker-storage.c
index b7279a6d2..9fd16c4e7 100644
--- a/src/miners/fs/tracker-storage.c
+++ b/src/miners/fs/tracker-storage.c
@@ -95,7 +95,7 @@ enum {
static guint signals[LAST_SIGNAL] = {0};
-G_DEFINE_TYPE (TrackerStorage, tracker_storage, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (TrackerStorage, tracker_storage, G_TYPE_OBJECT);
static void
tracker_storage_class_init (TrackerStorageClass *klass)
@@ -132,8 +132,6 @@ tracker_storage_class_init (TrackerStorageClass *klass)
2,
G_TYPE_STRING,
G_TYPE_STRING);
-
- g_type_class_add_private (object_class, sizeof (TrackerStoragePrivate));
}
static void
@@ -143,7 +141,7 @@ tracker_storage_init (TrackerStorage *storage)
g_message ("Initializing Storage...");
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
priv->mounts = g_node_new (NULL);
@@ -177,7 +175,7 @@ tracker_storage_finalize (GObject *object)
{
TrackerStoragePrivate *priv;
- priv = TRACKER_STORAGE_GET_PRIVATE (object);
+ priv = tracker_storage_get_instance_private (TRACKER_STORAGE (object));
g_hash_table_destroy (priv->unmount_watchdogs);
@@ -345,7 +343,7 @@ mount_add_new (TrackerStorage *storage,
TrackerStoragePrivate *priv;
GNode *node;
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
node = mount_add_hierarchy (priv->mounts, uuid, mount_point, removable_device, optical_disc);
g_hash_table_insert (priv->mounts_by_uuid, g_strdup (uuid), node);
@@ -573,7 +571,7 @@ mount_add (TrackerStorage *storage,
return;
}
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
/* fstab partitions may not have corresponding
* GVolumes, so volume may be NULL */
@@ -706,7 +704,7 @@ mounts_setup (TrackerStorage *storage)
TrackerStoragePrivate *priv;
GList *mounts, *lm;
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
mounts = g_volume_monitor_get_mounts (priv->volume_monitor);
@@ -748,7 +746,7 @@ mount_remove (TrackerStorage *storage,
gchar *mount_point;
gchar *mp;
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
file = g_mount_get_root (mount);
mount_point = g_file_get_path (file);
@@ -790,7 +788,7 @@ mount_removed_cb (GVolumeMonitor *monitor,
TrackerStoragePrivate *priv;
storage = user_data;
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
mount_remove (storage, mount);
@@ -810,7 +808,7 @@ unmount_failed_cb (gpointer user_data)
* due to an error, and add back the still mounted
* path.
*/
- priv = TRACKER_STORAGE_GET_PRIVATE (data->storage);
+ priv = tracker_storage_get_instance_private (data->storage);
g_warning ("Unmount operation failed, adding back mount point...");
@@ -831,7 +829,7 @@ mount_pre_removed_cb (GVolumeMonitor *monitor,
guint id;
storage = user_data;
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
mount_remove (storage, mount);
@@ -918,7 +916,7 @@ tracker_storage_get_device_roots (TrackerStorage *storage,
g_return_val_if_fail (TRACKER_IS_STORAGE (storage), NULL);
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
gr.roots = NULL;
gr.type = type;
@@ -956,7 +954,7 @@ tracker_storage_get_device_uuids (TrackerStorage *storage,
g_return_val_if_fail (TRACKER_IS_STORAGE (storage), NULL);
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
uuids = NULL;
@@ -1004,7 +1002,7 @@ tracker_storage_get_mount_point_for_uuid (TrackerStorage *storage,
g_return_val_if_fail (TRACKER_IS_STORAGE (storage), NULL);
g_return_val_if_fail (uuid != NULL, NULL);
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
node = g_hash_table_lookup (priv->mounts_by_uuid, uuid);
@@ -1037,7 +1035,7 @@ tracker_storage_get_type_for_uuid (TrackerStorage *storage,
g_return_val_if_fail (TRACKER_IS_STORAGE (storage), 0);
g_return_val_if_fail (uuid != NULL, 0);
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
node = g_hash_table_lookup (priv->mounts_by_uuid, uuid);
@@ -1094,7 +1092,7 @@ tracker_storage_get_uuid_for_file (TrackerStorage *storage,
path = norm_path;
}
- priv = TRACKER_STORAGE_GET_PRIVATE (storage);
+ priv = tracker_storage_get_instance_private (storage);
info = mount_info_find (priv->mounts, path);
diff --git a/src/miners/fs/tracker-writeback-dispatcher.c b/src/miners/fs/tracker-writeback-dispatcher.c
index 8f8a38aeb..01c384dc6 100644
--- a/src/miners/fs/tracker-writeback-dispatcher.c
+++ b/src/miners/fs/tracker-writeback-dispatcher.c
@@ -52,7 +52,7 @@ enum {
PROP_FILES_MINER
};
-#define TRACKER_WRITEBACK_DISPATCHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),
TRACKER_TYPE_WRITEBACK_DISPATCHER, TrackerWritebackDispatcherPrivate))
+#define TRACKER_WRITEBACK_DISPATCHER_GET_PRIVATE(o) (tracker_writeback_dispatcher_get_instance_private
(TRACKER_WRITEBACK_DISPATCHER (o)))
static void writeback_dispatcher_set_property (GObject *object,
guint param_id,
@@ -82,6 +82,7 @@ writeback_dispatcher_initable_iface_init (GInitableIface *iface)
}
G_DEFINE_TYPE_WITH_CODE (TrackerWritebackDispatcher, tracker_writeback_dispatcher, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (TrackerWritebackDispatcher)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
writeback_dispatcher_initable_iface_init));
@@ -103,8 +104,6 @@ tracker_writeback_dispatcher_class_init (TrackerWritebackDispatcherClass *klass)
"The FS Miner",
TRACKER_TYPE_MINER_FILES,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (klass, sizeof (TrackerWritebackDispatcherPrivate));
}
static void
diff --git a/src/miners/rss/tracker-miner-rss.c b/src/miners/rss/tracker-miner-rss.c
index 0058da8ca..27d843ca3 100644
--- a/src/miners/rss/tracker-miner-rss.c
+++ b/src/miners/rss/tracker-miner-rss.c
@@ -32,7 +32,7 @@
#include "tracker-miner-rss.h"
-#define TRACKER_MINER_RSS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_MINER_RSS,
TrackerMinerRSSPrivate))
+#define TRACKER_MINER_RSS_GET_PRIVATE(obj) (tracker_miner_rss_get_instance_private (TRACKER_MINER_RSS (obj)))
typedef struct _TrackerMinerRSSPrivate TrackerMinerRSSPrivate;
@@ -96,7 +96,7 @@ static void feed_ready_cb (GrssFeedsPool *
gpointer user_data);
static const gchar *get_message_url (GrssFeedItem *item);
-G_DEFINE_TYPE (TrackerMinerRSS, tracker_miner_rss, TRACKER_TYPE_MINER_ONLINE)
+G_DEFINE_TYPE_WITH_PRIVATE (TrackerMinerRSS, tracker_miner_rss, TRACKER_TYPE_MINER_ONLINE)
static void
parser_characters (void *data,
@@ -239,8 +239,6 @@ tracker_miner_rss_class_init (TrackerMinerRSSClass *klass)
miner_class->resumed = miner_resumed;
miner_online_class->connected = miner_connected;
-
- g_type_class_add_private (object_class, sizeof (TrackerMinerRSSPrivate));
}
static void
diff --git a/src/tracker-extract/tracker-extract-controller.c
b/src/tracker-extract/tracker-extract-controller.c
index 9c03112bb..8036e724c 100644
--- a/src/tracker-extract/tracker-extract-controller.c
+++ b/src/tracker-extract/tracker-extract-controller.c
@@ -38,7 +38,7 @@ struct TrackerExtractControllerPrivate {
gint paused;
};
-G_DEFINE_TYPE (TrackerExtractController, tracker_extract_controller, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (TrackerExtractController, tracker_extract_controller, G_TYPE_OBJECT)
static void
files_miner_idleness_changed (TrackerExtractController *self,
@@ -288,17 +288,12 @@ tracker_extract_controller_class_init (TrackerExtractControllerClass *klass)
G_PARAM_STATIC_STRINGS |
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class,
- sizeof (TrackerExtractControllerPrivate));
}
static void
tracker_extract_controller_init (TrackerExtractController *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
- TRACKER_TYPE_EXTRACT_CONTROLLER,
- TrackerExtractControllerPrivate);
+ self->priv = tracker_extract_controller_get_instance_private (self);
}
TrackerExtractController *
diff --git a/src/tracker-extract/tracker-extract-decorator.c b/src/tracker-extract/tracker-extract-decorator.c
index 7c504363c..4caf2a9a1 100644
--- a/src/tracker-extract/tracker-extract-decorator.c
+++ b/src/tracker-extract/tracker-extract-decorator.c
@@ -85,6 +85,7 @@ static void tracker_extract_decorator_initable_iface_init (GInitableIface *iface
G_DEFINE_TYPE_WITH_CODE (TrackerExtractDecorator, tracker_extract_decorator,
TRACKER_TYPE_DECORATOR_FS,
+ G_ADD_PRIVATE (TrackerExtractDecorator)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
tracker_extract_decorator_initable_iface_init))
static void
@@ -95,7 +96,7 @@ tracker_extract_decorator_get_property (GObject *object,
{
TrackerExtractDecoratorPrivate *priv;
- priv = TRACKER_EXTRACT_DECORATOR (object)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (object));
switch (param_id) {
case PROP_EXTRACTOR:
@@ -112,7 +113,7 @@ tracker_extract_decorator_set_property (GObject *object,
{
TrackerExtractDecoratorPrivate *priv;
- priv = TRACKER_EXTRACT_DECORATOR (object)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (object));
switch (param_id) {
case PROP_EXTRACTOR:
@@ -126,7 +127,7 @@ tracker_extract_decorator_finalize (GObject *object)
{
TrackerExtractDecoratorPrivate *priv;
- priv = TRACKER_EXTRACT_DECORATOR (object)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (object));
if (priv->extractor)
g_object_unref (priv->extractor);
@@ -181,7 +182,7 @@ get_metadata_cb (TrackerExtract *extract,
GError *error = NULL;
gchar *sparql;
- priv = TRACKER_EXTRACT_DECORATOR (data->decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (data->decorator));
info = tracker_extract_file_finish (extract, result, &error);
tracker_extract_persistence_remove_file (priv->persistence, data->file);
@@ -222,7 +223,7 @@ decorator_get_recovery_file (TrackerExtractDecorator *decorator,
TrackerExtractDecoratorPrivate *priv;
GFile *file;
- priv = decorator->priv;
+ priv = tracker_extract_decorator_get_instance_private (decorator);
file = g_hash_table_lookup (priv->recovery_files,
tracker_decorator_info_get_url (info));
@@ -246,7 +247,7 @@ decorator_next_item_cb (TrackerDecorator *decorator,
ExtractData *data;
GTask *task;
- priv = TRACKER_EXTRACT_DECORATOR (decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
info = tracker_decorator_next_finish (decorator, result, &error);
if (!info) {
@@ -298,7 +299,7 @@ decorator_get_next_file (TrackerDecorator *decorator)
TrackerExtractDecoratorPrivate *priv;
guint available_items;
- priv = TRACKER_EXTRACT_DECORATOR (decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
if (!tracker_miner_is_started (TRACKER_MINER (decorator)) ||
tracker_miner_is_paused (TRACKER_MINER (decorator)))
@@ -320,7 +321,7 @@ tracker_extract_decorator_paused (TrackerMiner *miner)
{
TrackerExtractDecoratorPrivate *priv;
- priv = TRACKER_EXTRACT_DECORATOR (miner)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (miner));
g_message ("Decorator paused");
if (priv->timer)
@@ -332,7 +333,7 @@ tracker_extract_decorator_resumed (TrackerMiner *miner)
{
TrackerExtractDecoratorPrivate *priv;
- priv = TRACKER_EXTRACT_DECORATOR (miner)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (miner));
g_message ("Decorator resumed, processing remaining %d items",
tracker_decorator_get_n_items (TRACKER_DECORATOR (miner)));
@@ -347,7 +348,7 @@ tracker_extract_decorator_items_available (TrackerDecorator *decorator)
{
TrackerExtractDecoratorPrivate *priv;
- priv = TRACKER_EXTRACT_DECORATOR (decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
g_message ("Starting to process %d items",
tracker_decorator_get_n_items (decorator));
@@ -365,7 +366,7 @@ tracker_extract_decorator_finished (TrackerDecorator *decorator)
gchar *time_str;
gdouble elapsed = 0;
- priv = TRACKER_EXTRACT_DECORATOR (decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
if (priv->timer) {
elapsed = g_timer_elapsed (priv->timer, NULL);
g_clear_pointer (&priv->timer, g_timer_destroy);
@@ -412,7 +413,7 @@ priority_changed (TrackerExtractDecorator *decorator)
GHashTableIter iter;
gpointer value;
- priv = TRACKER_EXTRACT_DECORATOR (decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (decorator);
/* Construct an strv removing dups */
array = g_ptr_array_new ();
@@ -449,7 +450,7 @@ name_vanished_cb (GDBusConnection *connection,
TrackerExtractDecorator *decorator = user_data;
TrackerExtractDecoratorPrivate *priv;
- priv = TRACKER_EXTRACT_DECORATOR (decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
g_hash_table_remove (priv->apps, name);
priority_changed (decorator);
}
@@ -466,7 +467,7 @@ handle_set_rdf_types_cb (TrackerExtractDBusPriority *iface,
AppData *data;
guint i;
- priv = TRACKER_EXTRACT_DECORATOR (decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
sender = g_dbus_method_invocation_get_sender (invocation);
conn = g_dbus_method_invocation_get_connection (invocation);
@@ -521,7 +522,7 @@ handle_clear_rdf_types_cb (TrackerExtractDBusPriority *iface,
TrackerExtractDecoratorPrivate *priv;
const gchar *sender;
- priv = TRACKER_EXTRACT_DECORATOR (decorator)->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
sender = g_dbus_method_invocation_get_sender (invocation);
g_hash_table_remove (priv->apps, sender);
@@ -557,9 +558,6 @@ tracker_extract_decorator_class_init (TrackerExtractDecoratorClass *klass)
TRACKER_TYPE_EXTRACT,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class,
- sizeof (TrackerExtractDecoratorPrivate));
}
static void
@@ -567,7 +565,7 @@ decorator_retry_file (GFile *file,
gpointer user_data)
{
TrackerExtractDecorator *decorator = user_data;
- TrackerExtractDecoratorPrivate *priv = decorator->priv;
+ TrackerExtractDecoratorPrivate *priv = tracker_extract_decorator_get_instance_private (decorator);
gchar *path;
path = g_file_get_uri (file);
@@ -612,7 +610,7 @@ tracker_extract_decorator_init (TrackerExtractDecorator *decorator)
{
TrackerExtractDecoratorPrivate *priv;
- decorator->priv = priv = TRACKER_EXTRACT_DECORATOR_GET_PRIVATE (decorator);
+ priv = tracker_extract_decorator_get_instance_private (decorator);
priv->recovery_files = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
@@ -629,7 +627,7 @@ tracker_extract_decorator_initable_init (GInitable *initable,
gboolean ret = TRUE;
decorator = TRACKER_EXTRACT_DECORATOR (initable);
- priv = decorator->priv;
+ priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
priv->apps = g_hash_table_new_full (g_str_hash,
g_str_equal,
diff --git a/src/tracker-extract/tracker-extract-decorator.h b/src/tracker-extract/tracker-extract-decorator.h
index 6d16eeb64..748bce608 100644
--- a/src/tracker-extract/tracker-extract-decorator.h
+++ b/src/tracker-extract/tracker-extract-decorator.h
@@ -39,7 +39,6 @@ typedef struct TrackerExtractDecoratorClass TrackerExtractDecoratorClass;
struct TrackerExtractDecorator {
TrackerDecoratorFS parent_instance;
- gpointer priv;
};
struct TrackerExtractDecoratorClass {
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index ec08d050d..866ab4558 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -41,7 +41,7 @@
#warning Main thread traces enabled
#endif /* THREAD_ENABLE_TRACE */
-#define TRACKER_EXTRACT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_EXTRACT,
TrackerExtractPrivate))
+#define TRACKER_EXTRACT_GET_PRIVATE(obj) (tracker_extract_get_instance_private (TRACKER_EXTRACT (obj)))
G_DEFINE_QUARK (TrackerExtractError, tracker_extract_error)
@@ -100,7 +100,7 @@ static gboolean get_metadata (TrackerExtractTask *task);
static gboolean dispatch_task_cb (TrackerExtractTask *task);
-G_DEFINE_TYPE(TrackerExtract, tracker_extract, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE(TrackerExtract, tracker_extract, G_TYPE_OBJECT)
static void
tracker_extract_class_init (TrackerExtractClass *klass)
@@ -110,8 +110,6 @@ tracker_extract_class_init (TrackerExtractClass *klass)
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = tracker_extract_finalize;
-
- g_type_class_add_private (object_class, sizeof (TrackerExtractPrivate));
}
static void
diff --git a/src/tracker-writeback/tracker-writeback.c b/src/tracker-writeback/tracker-writeback.c
index aeed1de77..fc60733f6 100644
--- a/src/tracker-writeback/tracker-writeback.c
+++ b/src/tracker-writeback/tracker-writeback.c
@@ -110,6 +110,7 @@ static gboolean tracker_controller_start (TrackerController *con
GError **error);
G_DEFINE_TYPE_WITH_CODE (TrackerController, tracker_controller, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (TrackerController)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
tracker_controller_initable_iface_init));
@@ -134,7 +135,7 @@ tracker_controller_finalize (GObject *object)
TrackerController *controller;
controller = TRACKER_CONTROLLER (object);
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
if (priv->shutdown_source) {
g_source_destroy (priv->shutdown_source);
@@ -162,7 +163,7 @@ tracker_controller_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- TrackerControllerPrivate *priv = TRACKER_CONTROLLER (object)->priv;
+ TrackerControllerPrivate *priv = tracker_controller_get_instance_private (TRACKER_CONTROLLER
(object));
switch (param_id) {
case PROP_SHUTDOWN_TIMEOUT:
@@ -177,7 +178,7 @@ tracker_controller_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- TrackerControllerPrivate *priv = TRACKER_CONTROLLER (object)->priv;
+ TrackerControllerPrivate *priv = tracker_controller_get_instance_private (TRACKER_CONTROLLER
(object));
switch (param_id) {
case PROP_SHUTDOWN_TIMEOUT:
@@ -202,8 +203,6 @@ tracker_controller_class_init (TrackerControllerClass *klass)
"Shutdown timeout, 0 to disable",
0, 1000, 0,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (TrackerControllerPrivate));
}
static void
@@ -212,7 +211,7 @@ task_cancellable_cancelled_cb (GCancellable *cancellable,
{
TrackerControllerPrivate *priv;
- priv = data->controller->priv;
+ priv = tracker_controller_get_instance_private (data->controller);
g_mutex_lock (&priv->mutex);
@@ -285,7 +284,7 @@ cancel_tasks (TrackerController *controller,
TrackerControllerPrivate *priv;
GList *elem;
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
for (elem = priv->ongoing_tasks; elem; elem = elem->next) {
WritebackData *data = elem->data;
@@ -339,7 +338,7 @@ reset_shutdown_timeout_cb (gpointer user_data)
g_message ("Shutting down due to no activity");
- priv = TRACKER_CONTROLLER (user_data)->priv;
+ priv = tracker_controller_get_instance_private (TRACKER_CONTROLLER (user_data));
g_main_loop_quit (priv->main_loop);
return FALSE;
@@ -351,7 +350,7 @@ reset_shutdown_timeout (TrackerController *controller)
TrackerControllerPrivate *priv;
GSource *source;
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
if (priv->shutdown_timeout == 0) {
return;
@@ -380,9 +379,7 @@ tracker_controller_init (TrackerController *controller)
{
TrackerControllerPrivate *priv;
- priv = controller->priv = G_TYPE_INSTANCE_GET_PRIVATE (controller,
- TRACKER_TYPE_CONTROLLER,
- TrackerControllerPrivate);
+ priv = tracker_controller_get_instance_private (controller);
priv->context = g_main_context_new ();
priv->main_loop = g_main_loop_new (priv->context, FALSE);
@@ -427,7 +424,7 @@ perform_writeback_cb (gpointer user_data)
WritebackData *data;
data = user_data;
- priv = data->controller->priv;
+ priv = tracker_controller_get_instance_private (data->controller);
priv->ongoing_tasks = g_list_remove (priv->ongoing_tasks, data);
if (data->error == NULL) {
@@ -473,7 +470,7 @@ io_writeback_job (GTask *task,
GCancellable *cancellable)
{
WritebackData *data = task_data;
- TrackerControllerPrivate *priv = data->controller->priv;
+ TrackerControllerPrivate *priv = tracker_controller_get_instance_private (data->controller);
GError *error = NULL;
gboolean handled = FALSE;
GList *writeback_handlers;
@@ -527,7 +524,7 @@ handle_method_call_perform_writeback (TrackerController *controller,
gchar *rdf_type = NULL;
GList *writeback_handlers = NULL;
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
results = g_ptr_array_new_with_free_func ((GDestroyNotify) g_strfreev);
g_variant_get (parameters, "(&sasaas)", &subject, &iter1, &iter2);
@@ -669,7 +666,7 @@ controller_notify_main_thread (TrackerController *controller,
{
TrackerControllerPrivate *priv;
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
g_mutex_lock (&priv->initialization_mutex);
@@ -698,7 +695,7 @@ bus_name_vanished_cb (GDBusConnection *connection,
TrackerControllerPrivate *priv;
controller = user_data;
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
if (!priv->initialized) {
GError *error;
@@ -726,7 +723,7 @@ tracker_controller_dbus_start (TrackerController *controller,
NULL, NULL
};
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
priv->connection = tracker_sparql_connection_get (NULL, &err);
@@ -791,7 +788,7 @@ tracker_controller_dbus_stop (TrackerController *controller)
{
TrackerControllerPrivate *priv;
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
if (priv->registration_id != 0) {
g_dbus_connection_unregister_object (priv->d_connection,
@@ -838,7 +835,7 @@ tracker_controller_thread_func (gpointer user_data)
#endif /* THREAD_ENABLE_TRACE */
controller = user_data;
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
g_main_context_push_thread_default (priv->context);
reset_shutdown_timeout (controller);
@@ -877,7 +874,7 @@ tracker_controller_start (TrackerController *controller,
GList *modules;
GThread *thread;
- priv = controller->priv;
+ priv = tracker_controller_get_instance_private (controller);
priv->modules = g_hash_table_new_full (g_str_hash,
g_str_equal,
diff --git a/src/tracker-writeback/tracker-writeback.h b/src/tracker-writeback/tracker-writeback.h
index 5e439351b..cacad4754 100644
--- a/src/tracker-writeback/tracker-writeback.h
+++ b/src/tracker-writeback/tracker-writeback.h
@@ -39,7 +39,6 @@ typedef struct TrackerControllerClass TrackerControllerClass;
struct TrackerController {
GObject parent_instance;
- gpointer priv;
};
struct TrackerControllerClass {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]