tracker r1419 - in branches/xesam-support: . src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1419 - in branches/xesam-support: . src/trackerd
- Date: Wed, 14 May 2008 10:29:12 +0100 (BST)
Author: pvanhoof
Date: Wed May 14 09:29:11 2008
New Revision: 1419
URL: http://svn.gnome.org/viewvc/tracker?rev=1419&view=rev
Log:
* Fixed Xesam error reporting
* Fixed a few warnings
Modified:
branches/xesam-support/ChangeLog
branches/xesam-support/src/trackerd/tracker-db-sqlite.c
branches/xesam-support/src/trackerd/tracker-xesam-live-search.c
branches/xesam-support/src/trackerd/tracker-xesam-session.c
branches/xesam-support/src/trackerd/tracker-xesam.c
branches/xesam-support/src/trackerd/tracker-xesam.h
Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.c (original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.c Wed May 14 09:29:11 2008
@@ -1143,7 +1143,7 @@
load_service_description_file (db_con->db, "image.metadata");
load_service_description_file (db_con->db, "video.metadata");
- load_sql_file (db_con, "sqlite-xesam.sql");
+ load_sql_file (db_con->db, "sqlite-xesam.sql");
tracker_db_load_xesam_service_file (db_con, "xesam.metadata");
tracker_db_load_xesam_service_file (db_con, "xesam-convenience.metadata");
@@ -1509,7 +1509,7 @@
load_service_description_file (db_con->db, "default.service");
- load_sql_file (db_con, "sqlite-xesam.sql");
+ load_sql_file (db_con->db, "sqlite-xesam.sql");
tracker_db_load_xesam_service_file (db_con, "xesam.metadata");
tracker_db_load_xesam_service_file (db_con, "xesam-convenience.metadata");
@@ -3231,7 +3231,7 @@
* FROM LiveSearches as X
* WHERE E.SearchID = ? */
- tracker_exec_proc_no_reply (db_con->cache, "LiveSearchStopSearch", search_id, NULL);
+ tracker_exec_proc_no_reply (db_con->cache->db, "LiveSearchStopSearch", search_id, NULL);
}
@@ -3312,7 +3312,7 @@
tracker_db_delete_handled_events (DBConnection *db_con, TrackerDBResultSet *events)
{
tracker_debug ("DeleteHandledEvents");
- tracker_exec_proc_no_reply (db_con->cache, "DeleteHandledEvents", NULL);
+ tracker_exec_proc_no_reply (db_con->cache->db, "DeleteHandledEvents", NULL);
}
static guint32
Modified: branches/xesam-support/src/trackerd/tracker-xesam-live-search.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-live-search.c (original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-live-search.c Wed May 14 09:29:11 2008
@@ -335,7 +335,7 @@
TrackerXesamLiveSearchPriv *priv = self->priv;
if (priv->closed)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_CLOSED,
"Search was already closed");
else {
@@ -370,7 +370,7 @@
TrackerXesamLiveSearchPriv *priv = self->priv;
if (!priv->active)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_NOT_ACTIVE,
"Search is not active");
else {
@@ -477,7 +477,7 @@
TrackerXesamLiveSearchPriv *priv = self->priv;
if (!priv->active)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_NOT_ACTIVE,
"Search is not active");
else {
@@ -508,7 +508,7 @@
TrackerXesamLiveSearchPriv *priv = self->priv;
if (!priv->active)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_NOT_ACTIVE,
"Search is not active");
else {
@@ -568,7 +568,7 @@
TrackerXesamLiveSearchPriv *priv = self->priv;
if (!priv->active)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_NOT_ACTIVE,
"Search is not active yet");
else {
@@ -602,7 +602,7 @@
TrackerXesamLiveSearchPriv *priv = self->priv;
if (!priv->active)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_NOT_ACTIVE,
"Search is not active yet");
else {
@@ -655,7 +655,7 @@
TrackerXesamLiveSearchPriv *priv = self->priv;
if (priv->closed)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_CLOSED,
"Search is closed");
else {
@@ -733,7 +733,7 @@
tracker_xesam_live_search_parse_query (TrackerXesamLiveSearch *self,
GError **error)
{
- TrackerXesamLiveSearchPriv *priv = self->priv;
+ TrackerXesamLiveSearchPriv *priv = self->priv;
TrackerDBusXesam *proxy = TRACKER_DBUS_XESAM (tracker_dbus_get_object (TRACKER_TYPE_DBUS_XESAM));
DBConnection *db_con = NULL;
GError *parse_error = NULL;
@@ -754,7 +754,7 @@
if (parse_error) {
gchar *str = g_strdup_printf ("Parse error: %s",
parse_error->message);
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_PARSING_FAILED,
str);
g_free (str);
Modified: branches/xesam-support/src/trackerd/tracker-xesam-session.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-session.c (original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-session.c Wed May 14 09:29:11 2008
@@ -303,7 +303,7 @@
property = g_hash_table_lookup (priv->props, prop);
if (!property) {
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_PROPERTY_NOT_SUPPORTED,
"Property not supported");
*new_val = NULL;
@@ -339,7 +339,7 @@
GValue *property = g_hash_table_lookup (priv->props, prop);
if (!property) {
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_PROPERTY_NOT_SUPPORTED,
"Property not supported");
*value = NULL;
Modified: branches/xesam-support/src/trackerd/tracker-xesam.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam.c (original)
+++ branches/xesam-support/src/trackerd/tracker-xesam.c Wed May 14 09:29:11 2008
@@ -29,6 +29,21 @@
extern Tracker *tracker;
+/**
+ * tracker_xesam_get_error_quark:
+ *
+ * Returns: the error domain quark for use with #GError
+ */
+GQuark
+tracker_xesam_get_error_quark (void)
+{
+ static GQuark quark = 0;
+ if (quark == 0)
+ quark = g_quark_from_static_string ("tracker-xesam-error-quark");
+ return quark;
+}
+
+
void
tracker_xesam_init (void)
{
@@ -63,7 +78,7 @@
{
gpointer inst = g_hash_table_lookup (tracker->xesam_sessions, session_id);
if (!inst)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SESSION_ID_NOT_REGISTERED,
"Session ID is not registered");
else
@@ -78,7 +93,7 @@
if (retval)
g_object_ref (retval);
else
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SESSION_ID_NOT_REGISTERED,
"Session ID is not registered");
@@ -110,7 +125,7 @@
g_list_free (sessions);
if (!retval)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_ID_NOT_REGISTERED,
"Search ID is not registered");
@@ -137,7 +152,7 @@
g_list_free (sessions);
if (!retval)
- g_set_error (error, TRACKER_XESAM_ERROR,
+ g_set_error (error, TRACKER_XESAM_ERROR_DOMAIN,
TRACKER_XESAM_ERROR_SEARCH_ID_NOT_REGISTERED,
"Search ID is not registered");
Modified: branches/xesam-support/src/trackerd/tracker-xesam.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam.h (original)
+++ branches/xesam-support/src/trackerd/tracker-xesam.h Wed May 14 09:29:11 2008
@@ -31,10 +31,7 @@
G_BEGIN_DECLS
-
-typedef enum {
- TRACKER_XESAM_ERROR = 1
-} TrackerXesamErrorDomain;
+#define TRACKER_XESAM_ERROR_DOMAIN (tracker_xesam_get_error_quark())
typedef enum {
TRACKER_XESAM_ERROR_SEARCH_ID_NOT_REGISTERED = 1,
@@ -45,6 +42,7 @@
TRACKER_XESAM_ERROR_PARSING_FAILED = 6,
} TrackerXesamError;
+GQuark tracker_xesam_get_error_quark (void);
TrackerXesamSession* tracker_xesam_get_session (const gchar *session_id,
GError **error);
TrackerXesamSession* tracker_xesam_get_session_for_search (const gchar *search_id,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]