tracker r1317 - in branches/indexer-split: . data src/libtracker src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1317 - in branches/indexer-split: . data src/libtracker src/trackerd
- Date: Mon, 28 Apr 2008 11:19:25 +0100 (BST)
Author: pvanhoof
Date: Mon Apr 28 10:19:24 2008
New Revision: 1317
URL: http://svn.gnome.org/viewvc/tracker?rev=1317&view=rev
Log:
2008-04-28 Philip Van Hoof <pvanhoof gnome org>
* Merged branches/xesam-support back to brances/indexer-split
Added:
branches/indexer-split/data/tracker-xesam-search.xml
- copied unchanged from r1316, /branches/xesam-support/data/tracker-xesam-search.xml
branches/indexer-split/src/trackerd/tracker-xesam-live-search.c
- copied unchanged from r1316, /branches/xesam-support/src/trackerd/tracker-xesam-live-search.c
branches/indexer-split/src/trackerd/tracker-xesam-live-search.h
- copied unchanged from r1316, /branches/xesam-support/src/trackerd/tracker-xesam-live-search.h
branches/indexer-split/src/trackerd/tracker-xesam-search.c
- copied unchanged from r1316, /branches/xesam-support/src/trackerd/tracker-xesam-search.c
branches/indexer-split/src/trackerd/tracker-xesam-search.h
- copied unchanged from r1316, /branches/xesam-support/src/trackerd/tracker-xesam-search.h
branches/indexer-split/src/trackerd/tracker-xesam-session.c
- copied unchanged from r1316, /branches/xesam-support/src/trackerd/tracker-xesam-session.c
branches/indexer-split/src/trackerd/tracker-xesam-session.h
- copied unchanged from r1316, /branches/xesam-support/src/trackerd/tracker-xesam-session.h
branches/indexer-split/src/trackerd/tracker-xesam.c
- copied unchanged from r1316, /branches/xesam-support/src/trackerd/tracker-xesam.c
branches/indexer-split/src/trackerd/tracker-xesam.h
- copied unchanged from r1316, /branches/xesam-support/src/trackerd/tracker-xesam.h
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/data/Makefile.am
branches/indexer-split/src/libtracker/ (props changed)
branches/indexer-split/src/trackerd/ (props changed)
branches/indexer-split/src/trackerd/Makefile.am
branches/indexer-split/src/trackerd/tracker-dbus.c
branches/indexer-split/src/trackerd/tracker-marshal.list
branches/indexer-split/src/trackerd/tracker-utils.c
branches/indexer-split/src/trackerd/tracker-utils.h
branches/indexer-split/src/trackerd/trackerd.c
Modified: branches/indexer-split/data/Makefile.am
==============================================================================
--- branches/indexer-split/data/Makefile.am (original)
+++ branches/indexer-split/data/Makefile.am Mon Apr 28 10:19:24 2008
@@ -8,6 +8,7 @@
tracker-dbus-keywords.xml \
tracker-dbus-metadata.xml \
tracker-dbus-search.xml \
+ tracker-xesam-search.xml \
sqlite-tracker.sql \
sqlite-cache.sql \
sqlite-email.sql \
Modified: branches/indexer-split/src/trackerd/Makefile.am
==============================================================================
--- branches/indexer-split/src/trackerd/Makefile.am (original)
+++ branches/indexer-split/src/trackerd/Makefile.am Mon Apr 28 10:19:24 2008
@@ -111,6 +111,8 @@
tracker-dbus-metadata.h \
tracker-dbus-search.c \
tracker-dbus-search.h \
+ tracker-xesam-search.c \
+ tracker-xesam-search.h \
tracker-email.c \
tracker-email.h \
tracker-email-utils.c \
@@ -135,7 +137,13 @@
tracker-os-dependant.h \
tracker-watch.h \
tracker-status.c \
- tracker-status.h
+ tracker-status.h \
+ tracker-xesam.h \
+ tracker-xesam.c \
+ tracker-xesam-session.c \
+ tracker-xesam-session.h \
+ tracker-xesam-live-search.c \
+ tracker-xesam-live-search.h
if OS_WIN32
trackerd_win_libs = -lws2_32 -lkernel32
@@ -181,7 +189,8 @@
tracker-dbus-files-glue.h \
tracker-dbus-keywords-glue.h \
tracker-dbus-metadata-glue.h \
- tracker-dbus-search-glue.h
+ tracker-dbus-search-glue.h \
+ tracker-xesam-search-glue.h
%-glue.h: $(top_builddir)/data/%.xml
$(DBUSBINDINGTOOL) --mode=glib-server --output=$@ --prefix=$(subst -,_,$*) $^
Modified: branches/indexer-split/src/trackerd/tracker-dbus.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-dbus.c (original)
+++ branches/indexer-split/src/trackerd/tracker-dbus.c Mon Apr 28 10:19:24 2008
@@ -38,6 +38,9 @@
#include "tracker-dbus-metadata-glue.h"
#include "tracker-dbus-search.h"
#include "tracker-dbus-search-glue.h"
+#include "tracker-xesam-search.h"
+#include "tracker-xesam-search-glue.h"
+
#include "tracker-utils.h"
#include "tracker-watch.h"
@@ -115,6 +118,12 @@
g_slice_free (GValue, value);
}
+static void
+name_owner_changed_done (gpointer data, GClosure *closure)
+{
+ g_object_unref (data);
+}
+
gboolean
tracker_dbus_init (gpointer tracker_pointer)
{
@@ -218,6 +227,28 @@
g_object_set (object, "email-index", tracker->email_index, NULL);
objects = g_slist_prepend (objects, object);
+
+ /* Add org.freedesktop.xesam.Search */
+ if (!(object = dbus_register_object (connection,
+ proxy,
+ TRACKER_TYPE_XESAM_SEARCH,
+ &dbus_glib_tracker_xesam_search_object_info,
+ TRACKER_XESAM_SEARCH_PATH))) {
+ return FALSE;
+ }
+
+ dbus_g_proxy_add_signal (proxy, "NameOwnerChanged",
+ G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_STRING, G_TYPE_INVALID);
+
+ dbus_g_proxy_connect_signal (proxy, "NameOwnerChanged",
+ G_CALLBACK (tracker_xesam_search_name_owner_changed),
+ g_object_ref (object),
+ name_owner_changed_done);
+
+ objects = g_slist_prepend (objects, object);
+
+
/* Reverse list since we added objects at the top each time */
objects = g_slist_reverse (objects);
Modified: branches/indexer-split/src/trackerd/tracker-marshal.list
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-marshal.list (original)
+++ branches/indexer-split/src/trackerd/tracker-marshal.list Mon Apr 28 10:19:24 2008
@@ -1,3 +1,13 @@
VOID:STRING,STRING,INT,INT,INT
VOID:STRING,STRING,STRING
VOID:STRING,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN
+
+# HitsRemoved, HitsModified DBus signals
+VOID:STRING,BOXED
+
+# HitsAdded DBus signal
+VOID:STRING,UINT
+
+#hits-added, hits-modified, hits-removed GObject signals
+VOID:OBJECT
+
Modified: branches/indexer-split/src/trackerd/tracker-utils.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-utils.c (original)
+++ branches/indexer-split/src/trackerd/tracker-utils.c Mon Apr 28 10:19:24 2008
@@ -2569,3 +2569,63 @@
{
return tracker->pause_manual || tracker_pause_on_battery () || tracker_low_diskspace () || tracker_index_too_big ();
}
+
+
+gchar*
+tracker_unique_key (void)
+{
+ /* This function is hardly cryptographically random but should be
+ "good enough" */
+ static guint serial = 0;
+ gchar* key;
+ guint t, ut, p, u, r;
+ GTimeVal tv;
+
+ g_get_current_time(&tv);
+
+ t = tv.tv_sec;
+ ut = tv.tv_usec;
+
+ p = getpid();
+
+ #ifdef HAVE_GETUID
+ u = getuid();
+ #else
+ u = 0;
+ #endif
+
+ /* don't bother to seed; if it's based on the time or any other
+ changing info we can get, we may as well just use that changing
+ info. since we don't seed we'll at least get a different number
+ on every call to this function in the same executable. */
+ r = rand();
+
+ /* The letters may increase uniqueness by preventing "melds"
+ i.e. 01t01k01 and 0101t0k1 are not the same */
+ key = g_strdup_printf("%ut%uut%uu%up%ur%uk%u",
+ /* Duplicate keys must be generated
+ by two different program instances */
+ serial,
+ /* Duplicate keys must be generated
+ in the same microsecond */
+ t,
+ ut,
+ /* Duplicate keys must be generated by
+ the same user */
+ u,
+ /* Duplicate keys must be generated by
+ two programs that got the same PID */
+ p,
+ /* Duplicate keys must be generated with the
+ same random seed and the same index into
+ the series of pseudorandom values */
+ r,
+ /* Duplicate keys must result from running
+ this function at the same stack location */
+ GPOINTER_TO_UINT(&key));
+
+ ++serial;
+
+ return key;
+}
+
Modified: branches/indexer-split/src/trackerd/tracker-utils.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-utils.h (original)
+++ branches/indexer-split/src/trackerd/tracker-utils.h Mon Apr 28 10:19:24 2008
@@ -299,6 +299,8 @@
GMutex *metadata_signal_mutex;
GCond *metadata_signal_cond;
+ GHashTable *xesam_sessions;
+
} Tracker;
@@ -509,5 +511,7 @@
gboolean tracker_pause_on_battery (void);
gboolean tracker_low_diskspace (void);
gboolean tracker_pause (void);
+gchar* tracker_unique_key (void);
+
#endif
Modified: branches/indexer-split/src/trackerd/trackerd.c
==============================================================================
--- branches/indexer-split/src/trackerd/trackerd.c (original)
+++ branches/indexer-split/src/trackerd/trackerd.c Mon Apr 28 10:19:24 2008
@@ -54,7 +54,8 @@
#include "tracker-hal.h"
#include "tracker-service-manager.h"
#include "tracker-status.h"
-
+#include "tracker-xesam.h"
+
#ifdef OS_WIN32
#include <windows.h>
#include <pthread.h>
@@ -654,6 +655,8 @@
tracker = g_new0 (Tracker, 1);
+ tracker_xesam_init ();
+
/* Set up directories */
tracker->pid = (int) getpid ();
tmp_dir = g_strdup_printf ("Tracker-%s.%d", g_get_user_name (), tracker->pid);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]