aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-10 14:47:23 -0500
committerTed Gould <ted@gould.cx>2010-08-10 14:47:23 -0500
commitbf3f4c6eb3affcf8e66b67ed61666c93a97ca47b (patch)
tree6fe210bea2010383da5136750e5c88e059998930
parent961575a255bf88e7befcc17fed6bcf6c87337e88 (diff)
downloadlibayatana-appindicator-bf3f4c6eb3affcf8e66b67ed61666c93a97ca47b.tar.gz
libayatana-appindicator-bf3f4c6eb3affcf8e66b67ed61666c93a97ca47b.tar.bz2
libayatana-appindicator-bf3f4c6eb3affcf8e66b67ed61666c93a97ca47b.zip
Removing the LRU file
-rw-r--r--src/application-service-appstore.c16
-rw-r--r--src/application-service-appstore.h3
-rw-r--r--src/application-service.c9
3 files changed, 6 insertions, 22 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 4ae316c..2aa418a 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -58,7 +58,6 @@ struct _ApplicationServiceAppstorePrivate {
DBusGConnection * bus;
GList * applications;
GList * approvers;
- AppLruFile * lrufile;
};
typedef struct _Approver Approver;
@@ -165,7 +164,6 @@ application_service_appstore_init (ApplicationServiceAppstore *self)
priv->applications = NULL;
priv->approvers = NULL;
- priv->lrufile = NULL;
GError * error = NULL;
priv->bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error);
@@ -241,7 +239,6 @@ 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 = 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));
@@ -411,15 +408,13 @@ can_add_application (GList *applications, Application *app)
}
/* This function takes two Application structure
- pointers and uses the lrufile to compare them. */
+ pointers and uses their ordering index to compare them. */
static gint
app_sort_func (gconstpointer a, gconstpointer b, gpointer userdata)
{
Application * appa = (Application *)a;
Application * appb = (Application *)b;
- AppLruFile * lrufile = (AppLruFile *)userdata;
-
- return app_lru_file_sort(lrufile, appa->id, appb->id);
+ return appa->ordering_index - appb->ordering_index;
}
/* Change the status of the application. If we're going passive
@@ -456,7 +451,7 @@ apply_status (Application * app, AppIndicatorStatus status)
if (app->status == APP_INDICATOR_STATUS_PASSIVE) {
if (can_add_application (priv->applications, app)) {
/* Put on panel */
- priv->applications = g_list_insert_sorted_with_data (priv->applications, app, app_sort_func, priv->lrufile);
+ priv->applications = g_list_insert_sorted_with_data (priv->applications, app, app_sort_func, NULL);
g_signal_emit(G_OBJECT(app->appstore),
signals[APPLICATION_ADDED], 0,
@@ -769,12 +764,9 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap
/* Creates a basic appstore object and attaches the
LRU file object to it. */
ApplicationServiceAppstore *
-application_service_appstore_new (AppLruFile * lrufile)
+application_service_appstore_new (void)
{
- 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 = appstore->priv;
- priv->lrufile = lrufile;
return appstore;
}
diff --git a/src/application-service-appstore.h b/src/application-service-appstore.h
index 422b0fd..665d422 100644
--- a/src/application-service-appstore.h
+++ b/src/application-service-appstore.h
@@ -25,7 +25,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <glib.h>
#include <glib-object.h>
-#include "application-service-lru-file.h"
G_BEGIN_DECLS
@@ -55,7 +54,7 @@ struct _ApplicationServiceAppstore {
ApplicationServiceAppstorePrivate * priv;
};
-ApplicationServiceAppstore * application_service_appstore_new (AppLruFile * lrufile);
+ApplicationServiceAppstore * application_service_appstore_new (void);
GType application_service_appstore_get_type (void);
void application_service_appstore_application_add (ApplicationServiceAppstore * appstore,
const gchar * dbus_name,
diff --git a/src/application-service.c b/src/application-service.c
index ffd042e..94e7d2e 100644
--- a/src/application-service.c
+++ b/src/application-service.c
@@ -25,7 +25,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "notification-item-client.h"
#include "application-service-appstore.h"
#include "application-service-watcher.h"
-#include "application-service-lru-file.h"
#include "dbus-shared.h"
/* The base main loop */
@@ -36,8 +35,6 @@ static ApplicationServiceAppstore * appstore = NULL;
static ApplicationServiceWatcher * watcher = NULL;
/* The service management interface */
static IndicatorService * service = NULL;
-/* The LRU file interface */
-static AppLruFile * lrufile = NULL;
/* Recieves the disonnection signal from the service
object and closes the mainloop. */
@@ -62,11 +59,8 @@ main (int argc, char ** argv)
service = indicator_service_new(INDICATOR_APPLICATION_DBUS_ADDR);
g_signal_connect(G_OBJECT(service), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, G_CALLBACK(service_disconnected), NULL);
- /* Start up the LRU file reading */
- lrufile = app_lru_file_new();
-
/* Building our app store */
- appstore = application_service_appstore_new(lrufile);
+ appstore = application_service_appstore_new();
/* Adding a watcher for the Apps coming up */
watcher = application_service_watcher_new(appstore);
@@ -79,7 +73,6 @@ main (int argc, char ** argv)
g_object_unref(G_OBJECT(watcher));
g_object_unref(G_OBJECT(appstore));
g_object_unref(G_OBJECT(service));
- g_object_unref(G_OBJECT(lrufile));
return 0;
}