[tracker] libtracker-miner: Updated test case to use ::finished not ::terminated
- From: Martyn James Russell <mr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-miner: Updated test case to use ::finished not ::terminated
- Date: Mon, 23 Nov 2009 07:41:58 +0000 (UTC)
commit 06d09f2673a9d15b7b85837b3299c12a092a424f
Author: Martyn Russell <martyn lanedo com>
Date: Mon Nov 23 06:53:38 2009 +0000
libtracker-miner: Updated test case to use ::finished not ::terminated
Actually, ::terminated is completely unused and should probably be
removed at some point.
src/libtracker-miner/test/tracker-main.c | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/test/tracker-main.c b/src/libtracker-miner/test/tracker-main.c
index 156cf11..1a93955 100644
--- a/src/libtracker-miner/test/tracker-main.c
+++ b/src/libtracker-miner/test/tracker-main.c
@@ -23,16 +23,28 @@
#include <string.h>
#include <stdlib.h>
+#include <glib.h>
+
#include <libtracker-common/tracker-utils.h>
#include "tracker-miner-test.h"
static void
-miner_terminated_cb (TrackerMiner *miner,
- gpointer user_data)
+miner_finished_cb (TrackerMiner *miner,
+ gdouble seconds_elapsed,
+ guint total_directories_found,
+ guint total_directories_ignored,
+ guint total_files_found,
+ guint total_files_ignored,
+ gpointer user_data)
{
GMainLoop *main_loop = user_data;
+ g_message ("Finished mining in seconds:%f, total directories:%d, total files:%d",
+ seconds_elapsed,
+ total_directories_found + total_directories_ignored,
+ total_files_found + total_files_ignored);
+
g_main_loop_quit (main_loop);
}
@@ -212,9 +224,6 @@ main (int argc, char *argv[])
g_get_tmp_dir (),
TRUE);
add_directory_path (TRACKER_MINER_FS (miner),
- g_get_current_dir (),
- TRUE);
- add_directory_path (TRACKER_MINER_FS (miner),
g_get_user_special_dir (G_USER_DIRECTORY_PICTURES),
TRUE);
add_directory_path (TRACKER_MINER_FS (miner),
@@ -233,13 +242,12 @@ main (int argc, char *argv[])
g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP),
TRUE);
- g_signal_connect (miner, "terminated",
- G_CALLBACK (miner_terminated_cb),
+ g_signal_connect (miner, "finished",
+ G_CALLBACK (miner_finished_cb),
main_loop);
g_timeout_add_seconds (1, miner_start_cb, miner);
g_main_loop_run (main_loop);
- g_object_unref (main_loop);
return EXIT_SUCCESS;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]