[tracker/tracker-cmd: 1/10] all: Depend on GLib 2.40 and use g_info() instead of tracker_info()
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-cmd: 1/10] all: Depend on GLib 2.40 and use g_info() instead of tracker_info()
- Date: Mon, 6 Oct 2014 13:19:52 +0000 (UTC)
commit 45daf3e160b6a4b2bba9e9144f83f2995af02cd6
Author: Martyn Russell <martyn lanedo com>
Date: Mon Oct 6 12:00:01 2014 +0100
all: Depend on GLib 2.40 and use g_info() instead of tracker_info()
This API came in during GLib 2.40.
The tracker_info() is used now for the 'tracker' command's info command and it
make sense to remove the old make-shift tracker_info() API which was for
logging and duplicating g_info() anyway.
configure.ac | 2 +-
src/libtracker-common/tracker-dbus.c | 12 +++---
src/libtracker-common/tracker-log.h | 23 ------------
src/libtracker-miner/tracker-file-notifier.c | 18 +++++-----
src/libtracker-miner/tracker-miner-fs.c | 50 +++++++++++++-------------
src/miners/apps/tracker-main.c | 8 ++--
src/miners/fs/tracker-config.c | 2 +-
src/miners/fs/tracker-main.c | 8 ++--
src/miners/user-guides/tracker-main.c | 8 ++--
9 files changed, 54 insertions(+), 77 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8c8aec4..22413a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,7 +197,7 @@ PYTHON_REQUIRED=2.6
# Library required versions
DBUS_REQUIRED=1.3.1
-GLIB_REQUIRED=2.38.0
+GLIB_REQUIRED=2.40.0
PANGO_REQUIRED=1.0.0
GTK_REQUIRED=3.0.0
LIBXML2_REQUIRED=2.6
diff --git a/src/libtracker-common/tracker-dbus.c b/src/libtracker-common/tracker-dbus.c
index 06b4871..e8c43d2 100644
--- a/src/libtracker-common/tracker-dbus.c
+++ b/src/libtracker-common/tracker-dbus.c
@@ -412,12 +412,12 @@ tracker_dbus_request_info (TrackerDBusRequest *request,
str = g_strdup_vprintf (format, args);
va_end (args);
- tracker_info ("---- [%d%s%s|%lu] %s",
- request->request_id,
- request->cd ? "|" : "",
- request->cd ? request->cd->binary : "",
- request->cd ? request->cd->pid : 0,
- str);
+ g_info ("---- [%d%s%s|%lu] %s",
+ request->request_id,
+ request->cd ? "|" : "",
+ request->cd ? request->cd->binary : "",
+ request->cd ? request->cd->pid : 0,
+ str);
g_free (str);
}
diff --git a/src/libtracker-common/tracker-log.h b/src/libtracker-common/tracker-log.h
index d7a4bc7..369d022 100644
--- a/src/libtracker-common/tracker-log.h
+++ b/src/libtracker-common/tracker-log.h
@@ -28,29 +28,6 @@ G_BEGIN_DECLS
#error "only <libtracker-common/tracker-common.h> must be included directly."
#endif
-/*
- * Add support for G_LOG_LEVEL_INFO through tracker_info().
- */
-#ifdef G_HAVE_ISO_VARARGS
-#define tracker_info(...) g_log (G_LOG_DOMAIN, \
- G_LOG_LEVEL_INFO, \
- __VA_ARGS__)
-#elif defined(G_HAVE_GNUC_VARARGS)
-#define tracker_info(format...) g_log (G_LOG_DOMAIN, \
- G_LOG_LEVEL_INFO, \
- format)
-#else /* no varargs macros */
-static void
-tracker_info (const gchar *format,
- ...)
-{
- va_list args;
- va_start (args, format);
- g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format, args);
- va_end (args);
-}
-#endif /* !__GNUC__ */
-
gboolean tracker_log_init (gint verbosity,
gchar **used_filename);
void tracker_log_shutdown (void);
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 77b21f7..84f00c5 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -616,14 +616,14 @@ finish_current_directory (TrackerFileNotifier *notifier)
priv->current_index_root->files_found,
priv->current_index_root->files_ignored);
- tracker_info (" Notified files after %2.2f seconds",
- g_timer_elapsed (priv->timer, NULL));
- tracker_info (" Found %d directories, ignored %d directories",
- priv->current_index_root->directories_found,
- priv->current_index_root->directories_ignored);
- tracker_info (" Found %d files, ignored %d files",
- priv->current_index_root->files_found,
- priv->current_index_root->files_ignored);
+ g_info (" Notified files after %2.2f seconds",
+ g_timer_elapsed (priv->timer, NULL));
+ g_info (" Found %d directories, ignored %d directories",
+ priv->current_index_root->directories_found,
+ priv->current_index_root->directories_ignored);
+ g_info (" Found %d files, ignored %d files",
+ priv->current_index_root->files_found,
+ priv->current_index_root->files_ignored);
root_data_free (priv->current_index_root);
priv->current_index_root = NULL;
@@ -813,7 +813,7 @@ crawl_directories_start (TrackerFileNotifier *notifier)
gchar *uri;
uri = g_file_get_uri (directory);
- tracker_info ("Processing location: '%s'", uri);
+ g_info ("Processing location: '%s'", uri);
g_free (uri);
g_timer_reset (priv->timer);
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 4a8167d..5d70815 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -989,7 +989,7 @@ miner_started (TrackerMiner *miner)
fs->priv->been_started = TRUE;
- tracker_info ("Initializing");
+ g_info ("Initializing");
g_object_set (miner,
"progress", 0.0,
@@ -1003,7 +1003,7 @@ miner_started (TrackerMiner *miner)
static void
miner_stopped (TrackerMiner *miner)
{
- tracker_info ("Idle");
+ g_info ("Idle");
g_object_set (miner,
"progress", 1.0,
@@ -1126,22 +1126,22 @@ process_print_stats (TrackerMinerFS *fs)
if (!fs->priv->shown_totals) {
fs->priv->shown_totals = TRUE;
- tracker_info ("--------------------------------------------------");
- tracker_info ("Total directories : %d (%d ignored)",
- fs->priv->total_directories_found,
- fs->priv->total_directories_ignored);
- tracker_info ("Total files : %d (%d ignored)",
- fs->priv->total_files_found,
- fs->priv->total_files_ignored);
+ g_info ("--------------------------------------------------");
+ g_info ("Total directories : %d (%d ignored)",
+ fs->priv->total_directories_found,
+ fs->priv->total_directories_ignored);
+ g_info ("Total files : %d (%d ignored)",
+ fs->priv->total_files_found,
+ fs->priv->total_files_ignored);
#if 0
- tracker_info ("Total monitors : %d",
- tracker_monitor_get_count (fs->priv->monitor));
+ g_info ("Total monitors : %d",
+ tracker_monitor_get_count (fs->priv->monitor));
#endif
- tracker_info ("Total processed : %d (%d notified, %d with error)",
- fs->priv->total_files_processed,
- fs->priv->total_files_notified,
- fs->priv->total_files_notified_error);
- tracker_info ("--------------------------------------------------\n");
+ g_info ("Total processed : %d (%d notified, %d with error)",
+ fs->priv->total_files_processed,
+ fs->priv->total_files_notified,
+ fs->priv->total_files_notified_error);
+ g_info ("--------------------------------------------------\n");
}
}
@@ -1157,7 +1157,7 @@ process_stop (TrackerMinerFS *fs)
fs->priv->timer_stopped = TRUE;
fs->priv->extraction_timer_stopped = TRUE;
- tracker_info ("Idle");
+ g_info ("Idle");
g_object_set (fs,
"progress", 1.0,
@@ -2485,7 +2485,7 @@ item_queue_handlers_cb (gpointer user_data)
*/
if (g_strcmp0 (status, "Processing…") != 0) {
/* Don't spam this */
- tracker_info ("Processing…");
+ g_info ("Processing…");
g_object_set (fs,
"status", "Processing…",
"progress", CLAMP (progress_now, 0.02, 1.00),
@@ -2515,11 +2515,11 @@ item_queue_handlers_cb (gpointer user_data)
items_remaining);
str2 = tracker_seconds_to_string (seconds_elapsed, TRUE);
- tracker_info ("Processed %u/%u, estimated %s left, %s elapsed",
- items_processed,
- items_processed + items_remaining,
- str1,
- str2);
+ g_info ("Processed %u/%u, estimated %s left, %s elapsed",
+ items_processed,
+ items_processed + items_remaining,
+ str1,
+ str2);
g_free (str2);
g_free (str1);
@@ -2689,7 +2689,7 @@ item_queue_handlers_set_up (TrackerMinerFS *fs)
/* Don't spam this */
if (progress > 0.01 && g_strcmp0 (status, "Processing…") != 0) {
- tracker_info ("Processing…");
+ g_info ("Processing…");
g_object_set (fs, "status", "Processing…", NULL);
}
@@ -3138,7 +3138,7 @@ file_notifier_finished (TrackerFileNotifier *notifier,
TrackerMinerFS *fs = user_data;
if (!tracker_miner_fs_has_items_to_process (fs)) {
- tracker_info ("Finished all tasks");
+ g_info ("Finished all tasks");
process_stop (fs);
}
}
diff --git a/src/miners/apps/tracker-main.c b/src/miners/apps/tracker-main.c
index d3f42a9..a6ef75b 100644
--- a/src/miners/apps/tracker-main.c
+++ b/src/miners/apps/tracker-main.c
@@ -157,10 +157,10 @@ miner_finished_cb (TrackerMinerFS *fs,
guint total_files_ignored,
gpointer user_data)
{
- tracker_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
- seconds_elapsed,
- total_directories_found,
- total_files_found);
+ g_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
+ seconds_elapsed,
+ total_directories_found,
+ total_files_found);
if (no_daemon && main_loop) {
g_main_loop_quit (main_loop);
diff --git a/src/miners/fs/tracker-config.c b/src/miners/fs/tracker-config.c
index 2333a90..5c4b7dd 100644
--- a/src/miners/fs/tracker-config.c
+++ b/src/miners/fs/tracker-config.c
@@ -778,7 +778,7 @@ config_file_changed_cb (TrackerConfigFile *config_file,
{
GSettings *settings = G_SETTINGS (user_data);
- tracker_info ("Settings have changed in INI file, we need to restart to take advantage of those
changes!");
+ g_info ("Settings have changed in INI file, we need to restart to take advantage of those changes!");
tracker_config_file_import_to_settings (config_file, settings, migration);
}
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index a2ea8f4..63cfefd 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -336,10 +336,10 @@ miner_finished_cb (TrackerMinerFS *fs,
guint total_files_ignored,
gpointer user_data)
{
- tracker_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
- seconds_elapsed,
- total_directories_found,
- total_files_found);
+ g_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
+ seconds_elapsed,
+ total_directories_found,
+ total_files_found);
if (TRACKER_IS_MINER_FILES (fs) &&
tracker_miner_fs_get_initial_crawling (fs)) {
diff --git a/src/miners/user-guides/tracker-main.c b/src/miners/user-guides/tracker-main.c
index b264f9f..b596225 100644
--- a/src/miners/user-guides/tracker-main.c
+++ b/src/miners/user-guides/tracker-main.c
@@ -157,10 +157,10 @@ miner_finished_cb (TrackerMinerFS *fs,
guint total_files_ignored,
gpointer user_data)
{
- tracker_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
- seconds_elapsed,
- total_directories_found,
- total_files_found);
+ g_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
+ seconds_elapsed,
+ total_directories_found,
+ total_files_found);
if (no_daemon && main_loop) {
g_main_loop_quit (main_loop);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]