aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSense Hofstede <qense@ubuntu.com>2010-07-08 20:45:51 +0200
committerSense Hofstede <qense@ubuntu.com>2010-07-08 20:45:51 +0200
commit925e3d8fea64fecdb16ce4a83750abb414f8687b (patch)
tree709f709c086e08ef59bef06237a54c68e0210846
parentcf31f2f0508305ba8363b505a6d5b402dcf8b96b (diff)
downloadayatana-indicator-application-925e3d8fea64fecdb16ce4a83750abb414f8687b.tar.gz
ayatana-indicator-application-925e3d8fea64fecdb16ce4a83750abb414f8687b.tar.bz2
ayatana-indicator-application-925e3d8fea64fecdb16ce4a83750abb414f8687b.zip
Removed all but one calls to the APPLICATION_SERVICE_APPSTORE_GET_PRIVATE() macro
All references to the APPLICATION_SERVICE_APPSTORE_GET_PRIVATE() macro were removed from src/application-service-appstore.c. This makes this file comply with the recommended practise, which should reduce overhead.
-rw-r--r--src/application-service-appstore.c22
-rw-r--r--src/application-service-appstore.h3
2 files changed, 15 insertions, 10 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 15abea3..886fe92 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -50,7 +50,6 @@ static gboolean _application_service_server_get_applications (ApplicationService
#define NOTIFICATION_ITEM_SIG_NEW_STATUS "NewStatus"
/* Private Stuff */
-typedef struct _ApplicationServiceAppstorePrivate ApplicationServiceAppstorePrivate;
struct _ApplicationServiceAppstorePrivate {
DBusGConnection * bus;
GList * applications;
@@ -139,7 +138,8 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass)
static void
application_service_appstore_init (ApplicationServiceAppstore *self)
{
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(self);
+
+ ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (self);
priv->applications = NULL;
priv->lrufile = NULL;
@@ -155,6 +155,8 @@ application_service_appstore_init (ApplicationServiceAppstore *self)
dbus_g_connection_register_g_object(priv->bus,
INDICATOR_APPLICATION_DBUS_OBJ,
G_OBJECT(self));
+
+ self->priv = priv;
return;
}
@@ -162,7 +164,7 @@ application_service_appstore_init (ApplicationServiceAppstore *self)
static void
application_service_appstore_dispose (GObject *object)
{
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(object);
+ ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE(object)->priv;
while (priv->applications != NULL) {
application_service_appstore_application_remove(APPLICATION_SERVICE_APPSTORE(object),
@@ -209,7 +211,7 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err
app->id = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ID));
app->category = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_CATEGORY));
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(app->appstore);
+ ApplicationServiceAppstorePrivate * priv = app->appstore->priv;
app_lru_file_touch(priv->lrufile, app->id, app->category);
app->icon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME));
@@ -265,7 +267,7 @@ string_to_status(const gchar * status_string)
static gint
get_position (Application * app) {
ApplicationServiceAppstore * appstore = app->appstore;
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore);
+ ApplicationServiceAppstorePrivate * priv = appstore->priv;
GList * applistitem = g_list_find(priv->applications, app);
if (applistitem == NULL) {
@@ -384,7 +386,7 @@ apply_status (Application * app, AppIndicatorStatus status)
g_debug("Changing app status to: %d", status);
ApplicationServiceAppstore * appstore = app->appstore;
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore);
+ ApplicationServiceAppstorePrivate * priv = appstore->priv;
/* This means we're going off line */
if (status == APP_INDICATOR_STATUS_PASSIVE) {
@@ -567,7 +569,7 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst
g_return_if_fail(IS_APPLICATION_SERVICE_APPSTORE(appstore));
g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0');
g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0');
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore);
+ ApplicationServiceAppstorePrivate * priv = appstore->priv;
/* Build the application entry. This will be carried
along until we're sure we've got everything. */
@@ -665,7 +667,7 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap
g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0');
g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0');
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore);
+ ApplicationServiceAppstorePrivate * priv = appstore->priv;
GList * listpntr;
for (listpntr = priv->applications; listpntr != NULL; listpntr = g_list_next(listpntr)) {
@@ -687,7 +689,7 @@ application_service_appstore_new (AppLruFile * lrufile)
{
g_return_val_if_fail(IS_APP_LRU_FILE(lrufile), NULL);
ApplicationServiceAppstore * appstore = APPLICATION_SERVICE_APPSTORE(g_object_new(APPLICATION_SERVICE_APPSTORE_TYPE, NULL));
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore);
+ ApplicationServiceAppstorePrivate * priv = appstore->priv;
priv->lrufile = lrufile;
return appstore;
}
@@ -696,7 +698,7 @@ application_service_appstore_new (AppLruFile * lrufile)
static gboolean
_application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps, GError ** error)
{
- ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore);
+ ApplicationServiceAppstorePrivate * priv = appstore->priv;
*apps = g_ptr_array_new();
GList * listpntr;
diff --git a/src/application-service-appstore.h b/src/application-service-appstore.h
index d2e0013..86d989b 100644
--- a/src/application-service-appstore.h
+++ b/src/application-service-appstore.h
@@ -38,6 +38,7 @@ G_BEGIN_DECLS
typedef struct _ApplicationServiceAppstore ApplicationServiceAppstore;
typedef struct _ApplicationServiceAppstoreClass ApplicationServiceAppstoreClass;
+typedef struct _ApplicationServiceAppstorePrivate ApplicationServiceAppstorePrivate;
struct _ApplicationServiceAppstoreClass {
GObjectClass parent_class;
@@ -49,6 +50,8 @@ struct _ApplicationServiceAppstoreClass {
struct _ApplicationServiceAppstore {
GObject parent;
+
+ ApplicationServiceAppstorePrivate * priv;
};
ApplicationServiceAppstore * application_service_appstore_new (AppLruFile * lrufile);