diff options
author | Alexander Larsson <alexl@redhat.com> | 2015-12-21 11:13:00 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2015-12-21 11:13:00 +0100 |
commit | 25ef0aaeaec51224a2db0015d90e625b84bab8a1 (patch) | |
tree | 5e99862be70e1f8700b0ea30a5df27d256180293 /lib/test-lib.c | |
parent | cd490d12a7e5fe5e936fa7a4da4bfb7ff9eadfc9 (diff) | |
download | xdg-app-25ef0aaeaec51224a2db0015d90e625b84bab8a1.tar.gz |
lib: Add xdg_app_installation_create_monitor
This just returns a new file monitor for the .changes file.
Diffstat (limited to 'lib/test-lib.c')
-rw-r--r-- | lib/test-lib.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/test-lib.c b/lib/test-lib.c index a60d196..8324003 100644 --- a/lib/test-lib.c +++ b/lib/test-lib.c @@ -14,6 +14,16 @@ progress_cb (const char *status, g_print ("status: %s, progress: %d estimating: %d, user_data: %p\n", status, progress, estimating, user_data); } +static gboolean +monitor_callback (GFileMonitor* monitor, + GFile* child, + GFile* other_file, + GFileMonitorEvent eflags) +{ + g_print ("Database changed\n"); + return TRUE; +} + int main (int argc, char *argv[]) { @@ -32,6 +42,16 @@ main (int argc, char *argv[]) return 1; } + if (argc == 4) + { + GFileMonitor * monitor = xdg_app_installation_create_monitor (installation, NULL, NULL); + GMainLoop *main_loop; + + g_signal_connect (monitor, "changed", (GCallback)monitor_callback, NULL); + main_loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (main_loop); + } + if (argc == 3) { app1 = xdg_app_installation_install (installation, |