tracker r2516 - in branches/uri: . data/db data/dbus src/libtracker-common src/libtracker-data src/tracker-indexer src/trackerd
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2516 - in branches/uri: . data/db data/dbus src/libtracker-common src/libtracker-data src/tracker-indexer src/trackerd
- Date: Tue, 18 Nov 2008 11:28:57 +0000 (UTC)
Author: juergbi
Date: Tue Nov 18 11:28:57 2008
New Revision: 2516
URL: http://svn.gnome.org/viewvc/tracker?rev=2516&view=rev
Log:
Merge volume handling from trunk
Modified:
branches/uri/ (props changed)
branches/uri/ChangeLog
branches/uri/data/db/sqlite-stored-procs.sql
branches/uri/data/dbus/tracker-indexer.xml
branches/uri/src/libtracker-common/Makefile.am
branches/uri/src/libtracker-common/tracker-hal.c
branches/uri/src/libtracker-data/tracker-data-manager.c (props changed)
branches/uri/src/libtracker-data/tracker-data-manager.h (props changed)
branches/uri/src/libtracker-data/tracker-data-metadata.c (props changed)
branches/uri/src/libtracker-data/tracker-data-metadata.h (props changed)
branches/uri/src/libtracker-data/tracker-data-update.c (contents, props changed)
branches/uri/src/libtracker-data/tracker-data-update.h (contents, props changed)
branches/uri/src/libtracker-data/tracker-query-tree.c (props changed)
branches/uri/src/libtracker-data/tracker-query-tree.h (props changed)
branches/uri/src/libtracker-data/tracker-rdf-query.c (props changed)
branches/uri/src/libtracker-data/tracker-rdf-query.h (props changed)
branches/uri/src/libtracker-data/tracker-xesam-query.c (props changed)
branches/uri/src/libtracker-data/tracker-xesam-query.h (props changed)
branches/uri/src/tracker-indexer/tracker-indexer.c
branches/uri/src/tracker-indexer/tracker-indexer.h
branches/uri/src/trackerd/tracker-main.c
branches/uri/src/trackerd/tracker-processor.c
Modified: branches/uri/data/db/sqlite-stored-procs.sql
==============================================================================
--- branches/uri/data/db/sqlite-stored-procs.sql (original)
+++ branches/uri/data/db/sqlite-stored-procs.sql Tue Nov 18 11:28:57 2008
@@ -127,6 +127,16 @@
GetHitDetails SELECT ROWID, HitCount, HitArraySize FROM HitIndex WHERE word = ?;
/*
+ * Volume handling
+ */
+
+GetVolumeID SELECT VolumeID FROM Volumes WHERE UDI = ?;
+GetVolumeByPath SELECT VolumeID FROM Volumes WHERE Enabled = 1 AND ? LIKE (MountPath || '/%');
+InsertVolume INSERT INTO Volumes (MountPath, UDI, Enabled) VALUES (?, ?, 1);
+EnableVolume UPDATE Volumes SET MountPath = ?, Enabled = 1 WHERE UDI = ?;
+DisableVolume UPDATE Volumes SET Enabled = 0 WHERE UDI = ?;
+
+/*
* XESAM queries
*/
InsertXesamMetadataType INSERT INTO XesamMetaDataTypes (MetaName) VALUES (?);
Modified: branches/uri/data/dbus/tracker-indexer.xml
==============================================================================
--- branches/uri/data/dbus/tracker-indexer.xml (original)
+++ branches/uri/data/dbus/tracker-indexer.xml Tue Nov 18 11:28:57 2008
@@ -33,6 +33,13 @@
<arg type="s" name="file_to" direction="in" />
</method>
+ <method name="VolumeUpdateState">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+ <arg type="s" name="volume_id" direction="in" />
+ <arg type="s" name="path" direction="in" />
+ <arg type="b" name="enabled" direction="in" />
+ </method>
+
<method name="PropertySet">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="s" name="service_type" direction="in" />
Modified: branches/uri/src/libtracker-common/Makefile.am
==============================================================================
--- branches/uri/src/libtracker-common/Makefile.am (original)
+++ branches/uri/src/libtracker-common/Makefile.am Tue Nov 18 11:28:57 2008
@@ -40,6 +40,7 @@
tracker-ioprio.c \
tracker-language.c \
tracker-log.c \
+ tracker-marshal-main.c \
tracker-module-config.c \
tracker-nfs-lock.c \
tracker-ontology.c \
@@ -80,3 +81,24 @@
$(GIO_LIBS) \
$(GLIB2_LIBS)
+
+tracker-marshal.h: tracker-marshal.list
+ $(GLIB_GENMARSHAL) $< --prefix=tracker_marshal --header > $@
+
+tracker-marshal.c: tracker-marshal.list
+ $(GLIB_GENMARSHAL) $< --prefix=tracker_marshal --body > $@
+
+tracker-marshal-main.c: tracker-marshal.c tracker-marshal.h
+
+marshal_sources = \
+ tracker-marshal.h \
+ tracker-marshal.c
+
+BUILT_SOURCES = \
+ $(marshal_sources)
+
+CLEANFILES = $(BUILT_SOURCES)
+
+EXTRA_DIST = \
+ $(BUILT_SOURCES) \
+ tracker-marshal.list
Modified: branches/uri/src/libtracker-common/tracker-hal.c
==============================================================================
--- branches/uri/src/libtracker-common/tracker-hal.c (original)
+++ branches/uri/src/libtracker-common/tracker-hal.c Tue Nov 18 11:28:57 2008
@@ -33,14 +33,15 @@
#include "tracker-log.h"
#include "tracker-hal.h"
#include "tracker-utils.h"
+#include "tracker-marshal.h"
#define CAPABILITY_AC_ADAPTER "ac_adapter"
#define CAPABILITY_BATTERY "battery"
#define CAPABILITY_VOLUME "volume"
-#define PROP_AC_ADAPTER_ON "ac_adapter.present"
-#define PROP_BATT_PERCENTAGE "battery.charge_level.percentage"
-#define PROP_IS_MOUNTED "volume.is_mounted"
+#define PROP_AC_ADAPTER_ON "ac_adapter.present"
+#define PROP_BATT_PERCENTAGE "battery.charge_level.percentage"
+#define PROP_IS_MOUNTED "volume.is_mounted"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_HAL, TrackerHalPriv))
@@ -98,8 +99,8 @@
};
enum {
- SIG_MOUNT_POINT_ADDED,
- SIG_MOUNT_POINT_REMOVED,
+ MOUNT_POINT_ADDED,
+ MOUNT_POINT_REMOVED,
LAST_SIGNAL
};
@@ -117,25 +118,29 @@
object_class->finalize = tracker_hal_finalize;
object_class->get_property = hal_get_property;
- signals[SIG_MOUNT_POINT_ADDED] =
+ signals[MOUNT_POINT_ADDED] =
g_signal_new ("mount-point-added",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
+ tracker_marshal_VOID__STRING_STRING,
G_TYPE_NONE,
- 1, G_TYPE_STRING);
+ 2,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
- signals[SIG_MOUNT_POINT_REMOVED] =
+ signals[MOUNT_POINT_REMOVED] =
g_signal_new ("mount-point-removed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
+ tracker_marshal_VOID__STRING_STRING,
G_TYPE_NONE,
- 1, G_TYPE_STRING);
+ 2,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
g_object_class_install_property (object_class,
PROP_BATTERY_IN_USE,
@@ -349,13 +354,13 @@
}
g_message ("HAL device found:\n"
- " - udi : %s\n"
+ " - udi : %s\n"
" - mount point: %s\n"
" - device file: %s\n"
- " - uuid : %s\n"
- " - mounted : %s\n"
+ " - uuid : %s\n"
+ " - mounted : %s\n"
" - file system: %s\n"
- " - label : %s",
+ " - label : %s",
libhal_volume_get_udi (volume),
libhal_volume_get_mount_point (volume),
libhal_volume_get_device_file (volume),
@@ -511,9 +516,9 @@
priv = GET_PRIV (hal);
g_message ("HAL device with mount point:'%s', removable:%s now being tracked",
- mount_point,
- removable_device ? "yes" : "no");
-
+ mount_point,
+ removable_device ? "yes" : "no");
+
g_hash_table_insert (priv->mounted_devices,
g_strdup (udi),
g_strdup (mount_point));
@@ -524,7 +529,7 @@
g_strdup (mount_point));
}
- g_signal_emit (hal, signals[SIG_MOUNT_POINT_ADDED], 0, mount_point, NULL);
+ g_signal_emit (hal, signals[MOUNT_POINT_ADDED], 0, udi, mount_point, NULL);
}
static void
@@ -532,20 +537,24 @@
const gchar *udi)
{
TrackerHalPriv *priv;
+ LibHalVolume *volume;
const gchar *mount_point;
+ const gchar *volume_uuid;
priv = GET_PRIV (hal);
mount_point = g_hash_table_lookup (priv->mounted_devices, udi);
+
if (!mount_point) {
return;
}
- g_message ("HAL device with mount point:'%s', removable:%s NO LONGER being tracked",
- mount_point,
- g_hash_table_remove (priv->removable_devices, udi) ? "yes" : "no");
-
- g_signal_emit (hal, signals[SIG_MOUNT_POINT_REMOVED], 0, mount_point, NULL);
+ g_message ("HAL device with mount point:'%s' (uuid:'%s'), removable:%s NO LONGER being tracked",
+ mount_point,
+ udi,
+ g_hash_table_remove (priv->removable_devices, udi) ? "yes" : "no");
+
+ g_signal_emit (hal, signals[MOUNT_POINT_REMOVED], 0, udi, mount_point, NULL);
g_hash_table_remove (priv->mounted_devices, udi);
g_hash_table_remove (priv->removable_devices, udi);
@@ -810,13 +819,13 @@
}
g_message ("HAL device added:\n"
- " - udi : %s\n"
+ " - udi : %s\n"
" - mount point: %s\n"
" - device file: %s\n"
- " - uuid : %s\n"
+ " - uuid : %s\n"
" - mounted : %s\n"
" - file system: %s\n"
- " - label : %s",
+ " - label : %s",
udi,
libhal_volume_get_mount_point (volume),
libhal_volume_get_device_file (volume),
@@ -855,7 +864,7 @@
mount_point = g_hash_table_lookup (priv->mounted_devices, udi);
g_message ("HAL device removed:\n"
- " - udi : %s\n"
+ " - udi : %s\n"
" - mount point: %s\n"
" - device_file: %s",
udi,
Modified: branches/uri/src/libtracker-data/tracker-data-update.c
==============================================================================
--- branches/uri/src/libtracker-data/tracker-data-update.c (original)
+++ branches/uri/src/libtracker-data/tracker-data-update.c Tue Nov 18 11:28:57 2008
@@ -152,22 +152,37 @@
TrackerDBInterface *iface;
GFile *file;
GFileInfo *file_info;
- gchar *id_str, *service_type_id_str, *basename;
+ TrackerDBResultSet *result_set;
+ guint32 volume_id = 0;
+ gchar *id_str, *service_type_id_str, *basename, *path, *volume_id_str;
gboolean is_dir, is_symlink, enabled;
if (!service) {
return FALSE;
}
+ file = g_file_new_for_uri (uri);
+ basename = g_file_get_basename (file);
+ path = g_file_get_path (file);
+
+ /* retrieve VolumeID */
+ iface = tracker_db_manager_get_db_interface (TRACKER_DB_COMMON);
+ result_set = tracker_db_interface_execute_procedure (iface, NULL,
+ "GetVolumeByPath",
+ path,
+ NULL);
+ if (result_set) {
+ tracker_db_result_set_get (result_set, 0, &volume_id, -1);
+ g_object_unref (result_set);
+ }
+ volume_id_str = tracker_guint32_to_string (volume_id);
+
iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
id_str = tracker_guint32_to_string (service_id);
service_type_id_str = tracker_gint_to_string (tracker_service_get_id (service));
- file = g_file_new_for_uri (uri);
- basename = g_file_get_basename (file);
-
file_info = g_file_query_info (file, "standard::*", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, NULL);
if (file_info) {
is_dir = (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY);
@@ -192,7 +207,7 @@
is_symlink ? "1" : "0",
"0", /* Offset */
tracker_data_metadata_lookup (metadata, "File:Modified"),
- "0", /* Aux ID */
+ volume_id_str, /* Aux ID */
NULL);
enabled = is_dir ?
@@ -208,7 +223,9 @@
g_free (id_str);
g_free (service_type_id_str);
g_free (basename);
+ g_free (path);
g_object_unref (file);
+ g_free (volume_id_str);
return TRUE;
}
@@ -550,3 +567,57 @@
tracker_data_manager_exec (iface, "DELETE FROM Events WHERE BeingHandled = 1");
}
+void
+tracker_data_update_add_volume (const gchar *udi,
+ const gchar *mount_path)
+{
+ TrackerDBInterface *iface;
+ TrackerDBResultSet *result_set;
+ guint32 id = 0;
+
+ g_return_if_fail (udi != NULL);
+ g_return_if_fail (mount_path != NULL);
+
+ iface = tracker_db_manager_get_db_interface (TRACKER_DB_COMMON);
+
+ result_set = tracker_db_interface_execute_procedure (iface, NULL,
+ "GetVolumeID",
+ udi,
+ NULL);
+
+
+ if (result_set) {
+ tracker_db_result_set_get (result_set, 0, &id, -1);
+ g_object_unref (result_set);
+ }
+
+ if (id == 0) {
+ tracker_db_interface_execute_procedure (iface, NULL,
+ "InsertVolume",
+ mount_path,
+ udi,
+ NULL);
+ } else {
+ tracker_db_interface_execute_procedure (iface, NULL,
+ "EnableVolume",
+ mount_path,
+ udi,
+ NULL);
+ }
+}
+
+void
+tracker_data_update_remove_volume (const gchar *udi)
+{
+ TrackerDBInterface *iface;
+
+ g_return_if_fail (udi != NULL);
+
+ iface = tracker_db_manager_get_db_interface (TRACKER_DB_COMMON);
+
+ tracker_db_interface_execute_procedure (iface, NULL,
+ "DisableVolume",
+ udi,
+ NULL);
+}
+
Modified: branches/uri/src/libtracker-data/tracker-data-update.h
==============================================================================
--- branches/uri/src/libtracker-data/tracker-data-update.h (original)
+++ branches/uri/src/libtracker-data/tracker-data-update.h Tue Nov 18 11:28:57 2008
@@ -80,6 +80,11 @@
/* XESAM API */
void tracker_data_update_delete_handled_events (TrackerDBInterface *iface);
+/* Volume handling */
+void tracker_data_update_add_volume (const gchar *udi,
+ const gchar *mount_path);
+void tracker_data_update_remove_volume (const gchar *udi);
+
G_END_DECLS
#endif /* __TRACKER_DATA_UPDATE_H__ */
Modified: branches/uri/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/uri/src/tracker-indexer/tracker-indexer.c (original)
+++ branches/uri/src/tracker-indexer/tracker-indexer.c Tue Nov 18 11:28:57 2008
@@ -2612,6 +2612,39 @@
}
void
+tracker_indexer_volume_update_state (TrackerIndexer *indexer,
+ const gchar *volume_uuid,
+ const gchar *path,
+ gboolean enabled,
+ DBusGMethodInvocation *context,
+ GError **error)
+{
+ guint request_id;
+
+ tracker_dbus_async_return_if_fail (TRACKER_IS_INDEXER (indexer), context);
+ tracker_dbus_async_return_if_fail (volume_uuid != NULL, context);
+ tracker_dbus_async_return_if_fail (path != NULL, context);
+
+ request_id = tracker_dbus_get_next_request_id ();
+
+ tracker_dbus_request_new (request_id,
+ "DBus request to update volume "
+ "UUID:'%s', path:'%s', enabled:%s",
+ volume_uuid,
+ path,
+ enabled ? "yes" : "no");
+
+ if (enabled) {
+ tracker_data_update_add_volume (volume_uuid, path);
+ } else {
+ tracker_data_update_remove_volume (volume_uuid);
+ }
+
+ dbus_g_method_return (context);
+ tracker_dbus_request_success (request_id);
+}
+
+void
tracker_indexer_property_set (TrackerIndexer *indexer,
const gchar *service_type,
const gchar *uri,
Modified: branches/uri/src/tracker-indexer/tracker-indexer.h
==============================================================================
--- branches/uri/src/tracker-indexer/tracker-indexer.h (original)
+++ branches/uri/src/tracker-indexer/tracker-indexer.h Tue Nov 18 11:28:57 2008
@@ -70,66 +70,72 @@
const gchar *module_name);
};
-GType tracker_indexer_get_type (void) G_GNUC_CONST;
+GType tracker_indexer_get_type (void) G_GNUC_CONST;
-TrackerIndexer *tracker_indexer_new (void);
-gboolean tracker_indexer_get_running (TrackerIndexer *indexer);
-void tracker_indexer_set_running (TrackerIndexer *indexer,
- gboolean running);
-void tracker_indexer_stop (TrackerIndexer *indexer);
-void tracker_indexer_process_all (TrackerIndexer *indexer);
-void tracker_indexer_process_modules (TrackerIndexer *indexer,
- gchar **modules);
+TrackerIndexer *tracker_indexer_new (void);
+gboolean tracker_indexer_get_running (TrackerIndexer *indexer);
+void tracker_indexer_set_running (TrackerIndexer *indexer,
+ gboolean running);
+void tracker_indexer_stop (TrackerIndexer *indexer);
+void tracker_indexer_process_all (TrackerIndexer *indexer);
+void tracker_indexer_process_modules (TrackerIndexer *indexer,
+ gchar **modules);
/* DBus methods */
-void tracker_indexer_pause (TrackerIndexer *indexer,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_pause_for_duration (TrackerIndexer *indexer,
- guint seconds,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_continue (TrackerIndexer *indexer,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_files_check (TrackerIndexer *indexer,
- const gchar *module,
- GStrv files,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_files_update (TrackerIndexer *indexer,
- const gchar *module,
- GStrv files,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_files_delete (TrackerIndexer *indexer,
- const gchar *module,
- GStrv files,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_file_move (TrackerIndexer *indexer,
- const gchar *module_name,
- gchar *from,
- gchar *to,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_property_set (TrackerIndexer *indexer,
- const gchar *service_type,
- const gchar *uri,
- const gchar *property,
- GStrv values,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_property_remove (TrackerIndexer *indexer,
- const gchar *service_type,
- const gchar *uri,
- const gchar *property,
- GStrv values,
- DBusGMethodInvocation *context,
- GError **error);
-void tracker_indexer_shutdown (TrackerIndexer *indexer,
- DBusGMethodInvocation *context,
- GError **error);
+void tracker_indexer_pause (TrackerIndexer *indexer,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_pause_for_duration (TrackerIndexer *indexer,
+ guint seconds,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_continue (TrackerIndexer *indexer,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_files_check (TrackerIndexer *indexer,
+ const gchar *module,
+ GStrv files,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_files_update (TrackerIndexer *indexer,
+ const gchar *module,
+ GStrv files,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_files_delete (TrackerIndexer *indexer,
+ const gchar *module,
+ GStrv files,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_file_move (TrackerIndexer *indexer,
+ const gchar *module_name,
+ gchar *from,
+ gchar *to,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_volume_update_state (TrackerIndexer *indexer,
+ const gchar *volume_uuid,
+ const gchar *path,
+ gboolean enabled,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_property_set (TrackerIndexer *indexer,
+ const gchar *service_type,
+ const gchar *uri,
+ const gchar *property,
+ GStrv values,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_property_remove (TrackerIndexer *indexer,
+ const gchar *service_type,
+ const gchar *uri,
+ const gchar *property,
+ GStrv values,
+ DBusGMethodInvocation *context,
+ GError **error);
+void tracker_indexer_shutdown (TrackerIndexer *indexer,
+ DBusGMethodInvocation *context,
+ GError **error);
G_END_DECLS
Modified: branches/uri/src/trackerd/tracker-main.c
==============================================================================
--- branches/uri/src/trackerd/tracker-main.c (original)
+++ branches/uri/src/trackerd/tracker-main.c Tue Nov 18 11:28:57 2008
@@ -288,6 +288,69 @@
return runlevel;
}
+#ifdef HAVE_HAL
+
+static void
+mount_point_set_cb (DBusGProxy *proxy,
+ GError *error,
+ gpointer user_data)
+{
+ switch (GPOINTER_TO_INT (user_data)) {
+ case 1:
+ g_message ("Indexer now knows about mount point addition");
+ break;
+ case 2:
+ g_message ("Indexer now knows about mount point removal");
+ break;
+ }
+}
+
+static void
+mount_point_added_cb (TrackerHal *hal,
+ const gchar *udi,
+ const gchar *mount_point,
+ gpointer user_data)
+{
+ TrackerMainPrivate *private;
+ GError *error = NULL;
+
+ private = g_static_private_get (&private_key);
+
+ g_message ("Indexer is being notified about added mount point:'%s'",
+ mount_point);
+
+ org_freedesktop_Tracker_Indexer_volume_update_state_async (tracker_dbus_indexer_get_proxy (),
+ udi,
+ mount_point,
+ TRUE,
+ mount_point_set_cb,
+ GINT_TO_POINTER (1));
+}
+
+static void
+mount_point_removed_cb (TrackerHal *hal,
+ const gchar *udi,
+ const gchar *mount_point,
+ gpointer user_data)
+{
+ TrackerMainPrivate *private;
+ GError *error = NULL;
+
+ private = g_static_private_get (&private_key);
+
+ g_message ("Indexer is being notified about removed mount point:'%s'",
+ mount_point);
+
+ org_freedesktop_Tracker_Indexer_volume_update_state_async (tracker_dbus_indexer_get_proxy (),
+ udi,
+ mount_point,
+ FALSE,
+ mount_point_set_cb,
+ GINT_TO_POINTER (2));
+}
+
+#endif /* HAVE_HAL */
+
static void
log_option_list (GSList *list,
const gchar *str)
@@ -648,14 +711,15 @@
g_type_init ();
+ if (!g_thread_supported ()) {
+ g_thread_init (NULL);
+ }
+
private = g_new0 (TrackerMainPrivate, 1);
g_static_private_set (&private_key,
private,
private_free);
- if (!g_thread_supported ())
- g_thread_init (NULL);
-
dbus_g_thread_init ();
setlocale (LC_ALL, "");
@@ -745,6 +809,12 @@
g_signal_connect (hal, "notify::battery-in-use",
G_CALLBACK (notify_battery_in_use_cb),
config);
+ g_signal_connect (hal, "mount-point-added",
+ G_CALLBACK (mount_point_added_cb),
+ NULL);
+ g_signal_connect (hal, "mount-point-removed",
+ G_CALLBACK (mount_point_removed_cb),
+ NULL);
set_up_throttle (hal, config);
#endif /* HAVE_HAL */
@@ -905,15 +975,6 @@
g_main_loop_run (private->main_loop);
}
-#if 0
- /* We can block on this since we are likely to block on
- * shutting down otherwise anyway.
- */
- org_freedesktop_Tracker_Indexer_pause_for_duration (tracker_dbus_indexer_get_proxy (),
- 2,
- NULL);
-#endif
-
/*
* Shutdown the daemon
*/
@@ -961,6 +1022,12 @@
g_signal_handlers_disconnect_by_func (hal,
notify_battery_in_use_cb,
config);
+ g_signal_handlers_disconnect_by_func (hal,
+ mount_point_added_cb,
+ NULL);
+ g_signal_handlers_disconnect_by_func (hal,
+ mount_point_removed_cb,
+ NULL);
g_object_unref (hal);
#endif /* HAVE_HAL */
Modified: branches/uri/src/trackerd/tracker-processor.c
==============================================================================
--- branches/uri/src/trackerd/tracker-processor.c (original)
+++ branches/uri/src/trackerd/tracker-processor.c Tue Nov 18 11:28:57 2008
@@ -160,9 +160,11 @@
#ifdef HAVE_HAL
static void mount_point_added_cb (TrackerHal *hal,
+ const gchar *volume_uuid,
const gchar *mount_point,
gpointer user_data);
static void mount_point_removed_cb (TrackerHal *hal,
+ const gchar *volume_uuid,
const gchar *mount_point,
gpointer user_data);
#endif /* HAVE_HAL */
@@ -1411,6 +1413,7 @@
static void
mount_point_added_cb (TrackerHal *hal,
+ const gchar *udi,
const gchar *mount_point,
gpointer user_data)
{
@@ -1419,8 +1422,6 @@
processor = user_data;
- g_message ("** TRAWLING THROUGH NEW MOUNT POINT:'%s'", mount_point);
-
status = tracker_status_get ();
processor->private->iterated_removable_media = FALSE;
@@ -1438,6 +1439,7 @@
static void
mount_point_removed_cb (TrackerHal *hal,
+ const gchar *udi,
const gchar *mount_point,
gpointer user_data)
{
@@ -1447,8 +1449,6 @@
processor = user_data;
- g_message ("** CLEANING UP OLD MOUNT POINT:'%s'", mount_point);
-
/* Remove the monitor and item from the database */
file = g_file_new_for_path (mount_point);
tracker_monitor_remove (processor->private->monitor, module_name, file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]