r12459 - in /packages/unstable/gossip/debian: changelog patches/01_search-logs.diff

nobse at users.alioth.debian.org nobse at users.alioth.debian.org
Wed Sep 12 09:13:25 UTC 2007


Author: nobse
Date: Wed Sep 12 09:13:25 2007
New Revision: 12459

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=12459
Log:
Added a new patch from svn to fix log search.

Added:
    packages/unstable/gossip/debian/patches/01_search-logs.diff
Modified:
    packages/unstable/gossip/debian/changelog

Modified: packages/unstable/gossip/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/gossip/debian/changelog?rev=12459&op=diff
==============================================================================
--- packages/unstable/gossip/debian/changelog (original)
+++ packages/unstable/gossip/debian/changelog Wed Sep 12 09:13:25 2007
@@ -1,3 +1,9 @@
+gossip (0.27-2) UNRELEASED; urgency=low
+
+  * Added a new patch from svn to fix log search.
+
+ -- Norbert Tretkowski <nobse at debian.org>  Wed, 12 Sep 2007 11:11:28 +0200
+
 gossip (0.27-1) unstable; urgency=low
 
   [ Norbert Tretkowski ]

Added: packages/unstable/gossip/debian/patches/01_search-logs.diff
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/gossip/debian/patches/01_search-logs.diff?rev=12459&op=file
==============================================================================
--- packages/unstable/gossip/debian/patches/01_search-logs.diff (added)
+++ packages/unstable/gossip/debian/patches/01_search-logs.diff Wed Sep 12 09:13:25 2007
@@ -1,0 +1,194 @@
+Index: src/gossip-log-window.c
+===================================================================
+--- src/gossip-log-window.c	(Revision 2594)
++++ src/gossip-log-window.c	(Revision 2595)
+@@ -371,6 +371,8 @@
+ 	GtkListStore       *store;
+ 	GtkTreeIter         iter;
+ 
++	gossip_debug (DEBUG_DOMAIN, "Clearing search results treeview/textview");
++		
+ 	view = GTK_TREE_VIEW (window->treeview_find);
+ 	model = gtk_tree_view_get_model (view);
+ 	selection = gtk_tree_view_get_selection (view);
+@@ -384,11 +386,14 @@
+ 
+ 	if (G_STR_EMPTY (search_criteria)) {
+ 		/* Just clear the search. */
++		gossip_debug (DEBUG_DOMAIN, "No search results found");
+ 		return;
+ 	}
+ 
++	gossip_debug (DEBUG_DOMAIN, "Starting search...");
+ 	hits = gossip_log_search_new (window->log_manager, search_criteria);
+ 
++	gossip_debug (DEBUG_DOMAIN, "Adding %d hits", g_list_length (hits));
+ 	for (l = hits; l; l = l->next) {
+ 		const gchar *date;
+ 		gchar       *date_readable;
+@@ -521,12 +526,14 @@
+ 
+ 	/* Don't find the same crap again */
+ 	if (window->last_find && strcmp (window->last_find, str) == 0) {
++		gossip_debug (DEBUG_DOMAIN, "Not searching for:'%s' in all log files (same as last search)", str);
+ 		return;
+ 	}
+ 
+ 	g_free (window->last_find);
+ 	window->last_find = g_strdup (str);
+ 
++	gossip_debug (DEBUG_DOMAIN, "Searching for:'%s' in all log files", str);
+ 	log_window_find_populate (window, str);
+ }
+ 
+Index: libgossip/gossip-log.c
+===================================================================
+--- libgossip/gossip-log.c	(Revision 2594)
++++ libgossip/gossip-log.c	(Revision 2595)
+@@ -185,8 +185,6 @@
+ 								GList                **files);
+ static void            log_get_all_log_files_for_account_dir   (const gchar           *account_dir,
+ 								GList                **files);
+-static void            log_get_all_log_files_for_type_dir      (const gchar           *type_dir,
+-								GList                **files);
+ static GossipAccount * log_get_account_from_filename           (GossipLogManager      *manager,
+ 								const gchar           *filename);
+ static gchar *         log_get_date_from_filename              (const gchar           *filename);
+@@ -289,11 +287,14 @@
+ 
+ 	/* We only support this when running GNOME. */
+ #ifdef HAVE_GNOME
++
+ 	/* Check for new log protocol version, and if so we fix the
+ 	 * differences here.
+ 	 */
+ 	version = log_check_version ();
+-	if (version == LOG_VERSION_0 || version == LOG_VERSION_1) {
++
++	if (version == LOG_VERSION_0 || 
++	    version == LOG_VERSION_1) {
+ 		GDir        *dir;
+ 		gchar       *log_directory;
+ 		const gchar *basename;
+@@ -694,9 +695,11 @@
+ 		g_chmod (filename, LOG_FILE_CREATE_MODE);
+ 		g_free (filename);
+ 
++
+ 		/* There is a bug with log version 1.0, the version file was
+ 		 * not created when gossip creates a new log directory.
+-		 * Here we try to guess if we have version_0 or version_1 */
++		 * Here we try to guess if we have version_0 or version_1
++		 */
+ 		dir = g_dir_open (log_directory, 0, NULL);
+ 		if (!dir) {
+ 			gossip_debug (DEBUG_DOMAIN, "Could not open directory:'%s'",
+@@ -986,7 +989,8 @@
+ }
+ 
+ static void
+-log_get_all_log_files_in_directory (const gchar *directory, GList **files)
++log_get_all_log_files_in_directory (const gchar  *directory, 
++				    GList       **files)
+ {
+ 	GDir        *dir;
+ 	const gchar *name;
+@@ -1054,36 +1058,6 @@
+ 	g_dir_close (dir);
+ }
+ 
+-static void
+-log_get_all_log_files_for_type_dir (const gchar  *type_dir,
+-				    GList       **files)
+-{
+-	GDir        *dir;
+-	const gchar *name;
+-	gchar       *path;
+-
+-	dir = g_dir_open (type_dir, 0, NULL);
+-	if (!dir) {
+-		gossip_debug (DEBUG_DOMAIN, "Could not open directory:'%s'", type_dir);
+-		return;
+-	}
+-
+-	while ((name = g_dir_read_name (dir)) != NULL) {
+-		path = g_build_filename (type_dir, name, NULL);
+-
+-		if (!g_file_test (path, G_FILE_TEST_IS_DIR)) {
+-			g_free (path);
+-			continue;
+-		}
+-
+-		log_get_all_log_files_for_account_dir (path, files);
+-
+-		g_free (path);
+-	}
+-
+-	g_dir_close (dir);
+-}
+-
+ static gboolean
+ log_get_all_log_files (GList **files)
+ {
+@@ -1110,7 +1084,7 @@
+ 
+ 	while ((name = g_dir_read_name (dir)) != NULL) {
+ 		account_dir = g_build_filename (log_directory, name, NULL);
+-		log_get_all_log_files_for_type_dir (account_dir, files);
++		log_get_all_log_files_for_account_dir (account_dir, files);
+ 		g_free (account_dir);
+ 	}
+ 
+@@ -2172,6 +2146,7 @@
+ 
+ 		/* FIXME: Handle chatrooms */
+ 		if (strstr (filename, LOG_DIR_CHATROOMS)) {
++			gossip_debug (DEBUG_DOMAIN, "Ignoring chatroom filename:'%s'", filename);
+ 			continue;
+ 		}
+ 
+@@ -2190,6 +2165,7 @@
+ 		if (strstr (contents_casefold, text_casefold)) {
+ 			GossipLogSearchHit *hit;
+ 			GossipAccount      *account;
++			GossipContact      *contact;
+ 			gchar              *contact_id;
+ 
+ 			account = log_get_account_from_filename (manager, filename);
+@@ -2202,23 +2178,31 @@
+ 			}
+ 
+ 			contact_id = log_get_contact_id_from_filename (filename);
++			contact = gossip_contact_manager_find (contact_manager, 
++							       account, 
++							       contact_id);
++			g_free (contact_id);
+ 
++			if (!contact) {
++				/* FIXME: What do we do here, do we
++				 * create a new contact explicitly for
++				 * this log entry?
++				 */
++				continue;
++			}
++
+ 			hit = g_new0 (GossipLogSearchHit, 1);
+ 
+ 			hit->date = log_get_date_from_filename (filename);
+ 			hit->filename = g_strdup (filename);
+ 			hit->account = g_object_ref (account);
+-			hit->contact = gossip_contact_manager_find (contact_manager, 
+-								    account,
+-								    contact_id);
++			hit->contact = g_object_ref (contact);
+ 
+ 			hits = g_list_append (hits, hit);
+ 
+ 			gossip_debug (DEBUG_DOMAIN, 
+ 				      "Found text:'%s' in file:'%s' on date:'%s'...",
+ 				      text, hit->filename, hit->date);
+-
+-			g_free (contact_id);
+ 		}
+ 
+ 		g_free (contents_casefold);




More information about the pkg-gnome-commits mailing list