changeset 16641:2b12b143a529

merge of '061bc994c90d4a6c96166ce1b6df5ce39c5f7825' and '8f7c67720e5712f4a88ea92a2fed9d902b961335'
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 29 Apr 2007 03:50:11 +0000
parents 2a12915d957a (current diff) 36a87fb00a22 (diff)
children c028fc690b5d
files
diffstat 2 files changed, 31 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/buddyicon.c	Sun Apr 29 03:49:09 2007 +0000
+++ b/libpurple/buddyicon.c	Sun Apr 29 03:50:11 2007 +0000
@@ -212,6 +212,10 @@
 {
 	const char *filename = purple_imgstore_get_filename(img);
 
+	/* If there's no filename, it can't be one of our images. */
+	if (filename == NULL)
+		return;
+
 	if (img == g_hash_table_lookup(icon_data_cache, filename))
 	{
 		purple_buddy_icon_data_uncache_file(filename);
@@ -908,9 +912,19 @@
 		FILE *file;
 		char *new_filename;
 
-		if (!read_icon_file(path, &icon_data, &icon_len) ||
-		    icon_data == NULL || icon_len <= 0)
+		if (!read_icon_file(path, &icon_data, &icon_len))
 		{
+			g_free(path);
+			delete_buddy_icon_settings(node, setting_name);
+			return;
+		}
+
+		if (icon_data == NULL || icon_len <= 0)
+		{
+			/* This really applies to the icon_len check.
+			 * icon_data should never be NULL if
+			 * read_icon_file() returns TRUE. */
+			purple_debug_error("buddyicon", "Empty buddy icon file: %s\n", path);
 			delete_buddy_icon_settings(node, setting_name);
 			g_free(path);
 			return;
@@ -921,8 +935,11 @@
 		new_filename = purple_buddy_icon_data_calculate_filename(icon_data, icon_len);
 		if (new_filename == NULL)
 		{
+			purple_debug_error("buddyicon",
+				"New icon filename is NULL. This should never happen! "
+				"The old filename was: %s\n", path);
 			delete_buddy_icon_settings(node, setting_name);
-			return;
+			g_return_if_reached();
 		}
 
 		path = g_build_filename(dirname, new_filename, NULL);
@@ -988,7 +1005,7 @@
 	}
 	else
 	{
-		/* If the icon is gone, drop the setting... */
+		purple_debug_error("buddyicon", "Old icon file doesn't exist: %s\n", path);
 		delete_buddy_icon_settings(node, setting_name);
 		g_free(path);
 	}
--- a/pidgin/gtkrequest.c	Sun Apr 29 03:49:09 2007 +0000
+++ b/pidgin/gtkrequest.c	Sun Apr 29 03:50:11 2007 +0000
@@ -472,7 +472,9 @@
 
 	if (title != NULL)
 		gtk_window_set_title(GTK_WINDOW(dialog), title);
-
+#ifdef _WIN32
+		gtk_window_set_title(GTK_WINDOW(dialog), PIDGIN_ALERT_TITLE);
+#endif
 
 	gtk_dialog_add_button(GTK_DIALOG(dialog),
 			      text_to_stock(cancel_text), 0);
@@ -580,6 +582,9 @@
 
 	if (title != NULL)
 		gtk_window_set_title(GTK_WINDOW(dialog), title);
+#ifdef _WIN32
+		gtk_window_set_title(GTK_WINDOW(dialog), PIDGIN_ALERT_TITLE);
+#endif
 
 	for (i = 0; i < action_count; i++) {
 		gtk_dialog_add_button(GTK_DIALOG(dialog),
@@ -1068,6 +1073,9 @@
 
 	if (title != NULL)
 		gtk_window_set_title(GTK_WINDOW(win), title);
+#ifdef _WIN32
+		gtk_window_set_title(GTK_WINDOW(win), PIDGIN_ALERT_TITLE);
+#endif
 
 	gtk_window_set_role(GTK_WINDOW(win), "multifield");
 	gtk_container_set_border_width(GTK_CONTAINER(win), PIDGIN_HIG_BORDER);
@@ -1609,7 +1617,7 @@
 	data->cbs[0] = cancel_cb;
 	data->cbs[1] = ok_cb;
 	data->u.file.savedialog = FALSE;
-	
+
 #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */
 	dirsel = gtk_file_chooser_dialog_new(
 						title ? title : _("Select Folder..."),