tracker r1660 - in branches/indexer-split: . src/tracker-indexer src/trackerd
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1660 - in branches/indexer-split: . src/tracker-indexer src/trackerd
- Date: Thu, 12 Jun 2008 15:06:55 +0000 (UTC)
Author: mr
Date: Thu Jun 12 15:06:54 2008
New Revision: 1660
URL: http://svn.gnome.org/viewvc/tracker?rev=1660&view=rev
Log:
* src/tracker-indexer/tracker-indexer.c:
* src/trackerd/tracker-crawler.c: Change all instances of
g_strfreev() on dynamically allocated GPtrArrays, since they grow,
the strings should be freed separately and the array itself after
that, this is also better than g_strfreev() in case one or the
other changes to a GSlice implementation.
* src/trackerd/tracker-main.c:
* src/trackerd/tracker-monitor.[ch]: Pass the TrackerConfig since
we need it to know if we shouldn't monitor certain locations.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/tracker-indexer/tracker-indexer.c
branches/indexer-split/src/trackerd/tracker-crawler.c
branches/indexer-split/src/trackerd/tracker-main.c
branches/indexer-split/src/trackerd/tracker-monitor.c
branches/indexer-split/src/trackerd/tracker-monitor.h
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer.c Thu Jun 12 15:06:54 2008
@@ -549,9 +549,11 @@
info = path_info_new (module, dirs[i]);
tracker_indexer_add_directory (indexer, info);
+
+ g_free (dirs[i]);
}
- g_strfreev (dirs);
+ g_free (dirs);
}
Modified: branches/indexer-split/src/trackerd/tracker-crawler.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-crawler.c (original)
+++ branches/indexer-split/src/trackerd/tracker-crawler.c Thu Jun 12 15:06:54 2008
@@ -196,11 +196,21 @@
crawler_finalize (GObject *object)
{
TrackerCrawlerPriv *priv;
+ gint i;
priv = GET_PRIV (object);
- g_strfreev (priv->ignored_prefixes);
- g_strfreev (priv->ignored_suffixes);
+ for (i = 0; priv->ignored_prefixes[i] != NULL; i++) {
+ g_free (priv->ignored_prefixes[i]);
+ }
+
+ g_free (priv->ignored_prefixes);
+
+ for (i = 0; priv->ignored_suffixes[i] != NULL; i++) {
+ g_free (priv->ignored_suffixes[i]);
+ }
+
+ g_free (priv->ignored_suffixes);
g_hash_table_unref (priv->temp_black_list);
g_hash_table_unref (priv->ignored_names);
@@ -727,6 +737,7 @@
gboolean running;
gint length;
gint items;
+ gint i;
crawler = user_data;
@@ -774,11 +785,11 @@
}
}
+ length = ptr_array->len;
g_ptr_array_add (ptr_array, NULL);
files = (gchar **) g_ptr_array_free (ptr_array, FALSE);
- g_debug ("Sending %d files to indexer to process",
- g_strv_length (files));
+ g_debug ("Sending %d files to indexer to process", length);
org_freedesktop_Tracker_Indexer_process_files (proxy,
(const gchar **) files,
@@ -793,7 +804,11 @@
g_debug ("Sent!");
}
- g_strfreev (files);
+ for (i = 0; files[i] != NULL; i++) {
+ g_free (files[i]);
+ }
+
+ g_free (files);
return TRUE;
}
Modified: branches/indexer-split/src/trackerd/tracker-main.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-main.c (original)
+++ branches/indexer-split/src/trackerd/tracker-main.c Thu Jun 12 15:06:54 2008
@@ -816,12 +816,12 @@
return EXIT_FAILURE;
}
- sanity_check_option_values ();
-
- if (!tracker_monitor_init ()) {
+ if (!tracker_monitor_init (tracker->config)) {
return EXIT_FAILURE;
}
+ sanity_check_option_values ();
+
initialise_directories (&need_index);
tracker_nfs_lock_init (tracker_config_get_nfs_locking (tracker->config));
Modified: branches/indexer-split/src/trackerd/tracker-monitor.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-monitor.c (original)
+++ branches/indexer-split/src/trackerd/tracker-monitor.c Thu Jun 12 15:06:54 2008
@@ -80,8 +80,10 @@
#endif
gboolean
-tracker_monitor_init (void)
+tracker_monitor_init (TrackerConfig *config)
{
+ g_return_val_if_fail (TRACKER_IS_CONFIG (config), FALSE);
+
if (monitors) {
return TRUE;
}
Modified: branches/indexer-split/src/trackerd/tracker-monitor.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-monitor.h (original)
+++ branches/indexer-split/src/trackerd/tracker-monitor.h Thu Jun 12 15:06:54 2008
@@ -22,16 +22,18 @@
#ifndef __TRACKERD_MONITOR_H__
#define __TRACKERD_MONITOR_H__
+#include <libtracker-common/tracker-config.h>
+
#include "tracker-db.h"
G_BEGIN_DECLS
-gboolean tracker_monitor_init (void);
+gboolean tracker_monitor_init (TrackerConfig *config);
void tracker_monitor_shutdown (void);
-gboolean tracker_monitor_add (const gchar *path);
-gboolean tracker_monitor_remove (const gchar *path,
- gboolean delete_subdirs);
-gboolean tracker_monitor_is_watched (const gchar *path);
+gboolean tracker_monitor_add (const gchar *path);
+gboolean tracker_monitor_remove (const gchar *path,
+ gboolean delete_subdirs);
+gboolean tracker_monitor_is_watched (const gchar *path);
gint tracker_monitor_get_count (void);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]