aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-21 15:31:13 -0500
committerTed Gould <ted@canonical.com>2009-08-21 15:31:13 -0500
commit50a2c4e02d275a88e5c917e4946410383c44b3ed (patch)
tree0427d32f44ce952015974f22f000c171e44d9d1b
parent51992ee519580718b3904adaabc76004dba6f323 (diff)
downloadayatana-indicator-messages-50a2c4e02d275a88e5c917e4946410383c44b3ed.tar.gz
ayatana-indicator-messages-50a2c4e02d275a88e5c917e4946410383c44b3ed.tar.bz2
ayatana-indicator-messages-50a2c4e02d275a88e5c917e4946410383c44b3ed.zip
Start responding to changes in the applications directories
-rw-r--r--src/messages-service.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/messages-service.c b/src/messages-service.c
index 7d48769..3a145d6 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -56,6 +56,7 @@ static gboolean blacklist_add (gpointer data);
static gboolean blacklist_remove (gpointer data);
static void blacklist_dir_changed (GFileMonitor * monitor, GFile * file, GFile * other_file, GFileMonitorEvent event_type, gpointer user_data);
static void app_dir_changed (GFileMonitor * monitor, GFile * file, GFile * other_file, GFileMonitorEvent event_type, gpointer user_data);
+static gboolean destroy_launcher (gpointer data);
/*
@@ -740,6 +741,24 @@ app_dir_changed (GFileMonitor * monitor, GFile * file, GFile * other_file, GFile
{
gchar * directory = (gchar *)user_data;
g_debug("Application directory changed: %s", directory);
+
+ switch (event_type) {
+ case G_FILE_MONITOR_EVENT_DELETED: {
+ gchar * path = g_file_get_path(file);
+ g_debug("\tDelete: %s", path);
+ g_idle_add(destroy_launcher, path);
+ break;
+ }
+ case G_FILE_MONITOR_EVENT_CREATED: {
+ gchar * path = g_file_get_path(file);
+ g_debug("\tCreate: %s", path);
+ g_idle_add(build_launcher, path);
+ break;
+ }
+ default:
+ break;
+ }
+
return;
}
@@ -793,6 +812,15 @@ remove_eclipses (AppMenuItem * ai)
return;
}
+/* Remove a launcher from the system. We need to figure
+ out what it's up to! */
+static gboolean
+destroy_launcher (gpointer data)
+{
+
+ return FALSE;
+}
+
/* This function turns a specific file into a menu
item and registers it appropriately with everyone */
static gboolean