diff options
author | Ted Gould <ted@gould.cx> | 2010-08-10 16:59:25 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-08-10 16:59:25 -0500 |
commit | f4b22a7fa52695acc7e1e5abd20859f320e3895f (patch) | |
tree | 32c0172171f21c0176972daf9eeb62a972f518a1 /src | |
parent | dad491a83573507401805d9782a02dec2bad743a (diff) | |
download | ayatana-indicator-application-f4b22a7fa52695acc7e1e5abd20859f320e3895f.tar.gz ayatana-indicator-application-f4b22a7fa52695acc7e1e5abd20859f320e3895f.tar.bz2 ayatana-indicator-application-f4b22a7fa52695acc7e1e5abd20859f320e3895f.zip |
Putting together the pieces to look for override files
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/application-service-appstore.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index a7cfc0b..1c4e7ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,6 +54,7 @@ indicator_application_service_SOURCES = \ indicator_application_service_CFLAGS = \ $(INDICATOR_CFLAGS) \ + -DDATADIR="\"$(pkgdatadir)\"" \ -Wall -Werror \ -DG_LOG_DOMAIN=\"indicator-application-service\" diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 47396bb..0df4dd5 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -57,6 +57,7 @@ static gboolean _application_service_server_get_applications (ApplicationService #define NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH "NewIconThemePath" #define OVERRIDE_GROUP_NAME "Ordering Index Overrides" +#define OVERRIDE_FILE_NAME "ordering-override.keyfile" /* Private Stuff */ struct _ApplicationServiceAppstorePrivate { @@ -112,6 +113,7 @@ static void application_service_appstore_class_init (ApplicationServiceAppstoreC static void application_service_appstore_init (ApplicationServiceAppstore *self); static void application_service_appstore_dispose (GObject *object); static void application_service_appstore_finalize (GObject *object); +static void load_override_file (GHashTable * hash, const gchar * filename); static AppIndicatorStatus string_to_status(const gchar * status_string); static void apply_status (Application * app, AppIndicatorStatus status); static void approver_free (gpointer papprover, gpointer user_data); @@ -188,6 +190,11 @@ application_service_appstore_init (ApplicationServiceAppstore *self) priv->approvers = NULL; priv->ordering_overrides = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + + load_override_file(priv->ordering_overrides, DATADIR "/" OVERRIDE_FILE_NAME); + gchar * userfile = g_build_filename(g_get_user_data_dir(), "indicators", "application", OVERRIDE_FILE_NAME, NULL); + load_override_file(priv->ordering_overrides, userfile); + g_free(userfile); GError * error = NULL; priv->bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error); @@ -241,6 +248,15 @@ application_service_appstore_finalize (GObject *object) return; } +/* Loads the file and adds the override entries to the table + of overrides */ +static void +load_override_file (GHashTable * hash, const gchar * filename) +{ + + +} + /* Return from getting the properties from the item. We're looking at those and making sure we have everythign that we need. If we do, then we'll move on up to sending this onto the indicator. */ |