[tracker/dbus-fd-experiment: 13/13] remove info->query



commit 5733b36eadb69d744661b61a4e9fe5036fcbb58a
Author: Adrien Bustany <abustany gnome org>
Date:   Thu Jun 3 10:26:16 2010 -0400

    remove info->query

 src/tracker-store/tracker-steroids.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/src/tracker-store/tracker-steroids.c b/src/tracker-store/tracker-steroids.c
index 56854be..30485a7 100644
--- a/src/tracker-store/tracker-steroids.c
+++ b/src/tracker-store/tracker-steroids.c
@@ -49,7 +49,6 @@ typedef struct {
 typedef struct {
 	TrackerSteroids *parent;
 	DBusMessage *call_message;
-	char *query;
 	int fd;
 	unsigned int send_buffer_index;
 	char send_buffer[TRACKER_STEROIDS_BUFFER_SIZE];
@@ -98,10 +97,6 @@ destroy_client_info (gpointer user_data)
 	dbus_message_unref (info->call_message);
 	dbus_connection_unref (info->connection);
 
-	if (info->query) {
-		g_free (info->query);
-	}
-
 	if (info->fd) {
 		close (info->fd);
 	}
@@ -410,6 +405,7 @@ tracker_steroids_query (TrackerSteroids *steroids,
 	const gchar *sender;
 	DBusMessage *reply;
 	DBusError    dbus_error;
+	gchar       *query;
 
 	if (g_strcmp0 (dbus_message_get_signature (message), DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_UNIX_FD_AS_STRING)) {
 		reply = dbus_message_new_error_printf (message,
@@ -440,13 +436,13 @@ tracker_steroids_query (TrackerSteroids *steroids,
 
 	dbus_message_get_args (message,
 	                       &dbus_error,
-	                       DBUS_TYPE_STRING, &info->query,
+	                       DBUS_TYPE_STRING, &query,
 	                       DBUS_TYPE_UNIX_FD, &info->fd,
 	                       DBUS_TYPE_INVALID);
 
 	sender = dbus_message_get_sender (message);
 
-	tracker_store_sparql_query (info->query, TRACKER_STORE_PRIORITY_HIGH,
+	tracker_store_sparql_query (query, TRACKER_STORE_PRIORITY_HIGH,
 	                            query_inthread, query_callback, sender,
 	                            info, destroy_client_info);
 }
@@ -463,6 +459,7 @@ tracker_steroids_update (TrackerSteroids *steroids,
 	static char             query_size_buffer[sizeof(int)];
 	int                     query_size;
 	DBusMessage            *reply;
+	gchar                  *query;
 
 	if (g_strcmp0 (dbus_message_get_signature (message), DBUS_TYPE_UNIX_FD_AS_STRING)) {
 		reply = dbus_message_new_error_printf (message,
@@ -503,14 +500,14 @@ tracker_steroids_update (TrackerSteroids *steroids,
 	query_size = buffer_read_int (query_size_buffer);
 
 	/* We malloc one more char to ensure string is 0 terminated */
-	info->query = g_malloc0 ((1 + query_size) * sizeof (char));
+	query = g_malloc0 ((1 + query_size) * sizeof (char));
 
-	buffer_read (info->fd, info->query, query_size);
+	buffer_read (info->fd, query, query_size);
 
 	close (info->fd);
 	info->fd = 0;
 
-	tracker_store_sparql_update (info->query, TRACKER_STORE_PRIORITY_HIGH, FALSE,
+	tracker_store_sparql_update (query, TRACKER_STORE_PRIORITY_HIGH, FALSE,
 	                             update_callback, sender,
 	                             info, destroy_client_info);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]