[Commits] [SCM] claws branch, master, updated. 3.11.1-155-g568eed6

mones at claws-mail.org mones at claws-mail.org
Mon Jun 22 13:49:39 CEST 2015


The branch, master has been updated
       via  568eed69504b569c89ac8a55d673d2ee212b3da4 (commit)
       via  8aa14edcbfddf3d152eb4b9ac78d24629194fed1 (commit)
      from  63f3f4f846256f015d1cf1c76f0cc1555173a7e9 (commit)

Summary of changes:
 po/es.po           |    2 +-
 src/common/utils.c |   70 +++++++++++++++++++++++++++-------------------------
 src/mh.c           |    5 ++--
 src/mh_gtk.c       |    6 +++--
 4 files changed, 44 insertions(+), 39 deletions(-)


- Log -----------------------------------------------------------------
commit 568eed69504b569c89ac8a55d673d2ee212b3da4
Author: Ricardo Mones <ricardo at mones.org>
Date:   Mon Jun 22 13:46:09 2015 +0200

    Fix incorrect HTML preventing label from appearing
    
    Error on console under Spanish locales was:
    
    sys:1: GtkWarning: Failed to set text from markup due to error parsing
    markup: Error en la línea 1, carácter 155: Se cerró el elemento «a»,
    pero el elemento que está abierto actualmente es «span»

diff --git a/po/es.po b/po/es.po
index 6b560be..c7032a8 100644
--- a/po/es.po
+++ b/po/es.po
@@ -5447,7 +5447,7 @@ msgid ""
 "\"none\">Claws Mail website</span></a>."
 msgstr ""
 "Para más información sobre los módulos vea el <a href=\"%s\"><span underline="
-"\"none\">sitio web de Claws Mail</a>."
+"\"none\">sitio web de Claws Mail</span></a>."
 
 #: ../src/gtk/pluginwindow.c:414
 msgid "Click here to load one or more plugins"

commit 8aa14edcbfddf3d152eb4b9ac78d24629194fed1
Author: Ricardo Mones <ricardo at mones.org>
Date:   Fri May 29 12:20:12 2015 +0200

    Fix bug #1901 ‘More descriptive error msgs when attempting to delete a folder’
    
    Original patch by Paweł Pękala; added additional info on some
    g_warning calls and removed trailing '\n' as they're already
    appended by glib's default handler.

diff --git a/src/common/utils.c b/src/common/utils.c
index 27a02f4..17e839d 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -1713,7 +1713,7 @@ gint scan_mailto_url(const gchar *mailto, gchar **from, gchar **to, gchar **cc,
 		} else if (body && !*body && !g_ascii_strcasecmp(field, "insert")) {
 			gchar *tmp = decode_uri_gdup(value);
 			if (!g_file_get_contents(tmp, body, NULL, NULL)) {
-				g_warning("Error: couldn't set insert file '%s' in body\n", value);
+				g_warning("couldn't set insert file '%s' in body", value);
 			}
 			g_free(tmp);
 			tmp = NULL;
@@ -2330,7 +2330,7 @@ gint remove_all_files(const gchar *dir)
 	}
 
 	if ((dp = g_dir_open(".", 0, NULL)) == NULL) {
-		g_warning("failed to open directory: %s\n", dir);
+		g_warning("failed to open directory: %s", dir);
 		g_free(prev_dir);
 		return -1;
 	}
@@ -2387,7 +2387,7 @@ gint remove_numbered_files(const gchar *dir, guint first, guint last)
 	}
 
 	if ((dp = g_dir_open(".", 0, NULL)) == NULL) {
-		g_warning("failed to open directory: %s\n", dir);
+		g_warning("failed to open directory: %s", dir);
 		g_free(prev_dir);
 		return -1;
 	}
@@ -2501,13 +2501,13 @@ gint remove_dir_recursive(const gchar *dir)
 	if (g_stat(dir, &s) < 0) {
 		FILE_OP_ERROR(dir, "stat");
 		if (ENOENT == errno) return 0;
-		return -1;
+		return -(errno);
 	}
 
 	if (!S_ISDIR(s.st_mode)) {
 		if (claws_unlink(dir) < 0) {
 			FILE_OP_ERROR(dir, "unlink");
-			return -1;
+			return -(errno);
 		}
 
 		return 0;
@@ -2520,7 +2520,7 @@ gint remove_dir_recursive(const gchar *dir)
 		g_free(prev_dir);
 		if (g_chdir("..") < 0) {
 			FILE_OP_ERROR(dir, "chdir");
-			return -1;
+			return -(errno);
 		}
 		prev_dir = g_get_current_dir();
 	}
@@ -2528,14 +2528,14 @@ gint remove_dir_recursive(const gchar *dir)
 	if (g_chdir(dir) < 0) {
 		FILE_OP_ERROR(dir, "chdir");
 		g_free(prev_dir);
-		return -1;
+		return -(errno);
 	}
 
 	if ((dp = g_dir_open(".", 0, NULL)) == NULL) {
-		g_warning("failed to open directory: %s\n", dir);
+		g_warning("failed to open directory: %s", dir);
 		g_chdir(prev_dir);
 		g_free(prev_dir);
-		return -1;
+		return -(errno);
 	}
 
 	/* remove all files in the directory */
@@ -2543,9 +2543,11 @@ gint remove_dir_recursive(const gchar *dir)
 		/* g_print("removing %s\n", dir_name); */
 
 		if (is_dir_exist(dir_name)) {
-			if (remove_dir_recursive(dir_name) < 0) {
-				g_warning("can't remove directory\n");
-				return -1;
+			gint ret;
+
+			if ((ret = remove_dir_recursive(dir_name)) < 0) {
+				g_warning("can't remove directory: %s", dir_name);
+				return ret;
 			}
 		} else {
 			if (claws_unlink(dir_name) < 0)
@@ -2558,14 +2560,14 @@ gint remove_dir_recursive(const gchar *dir)
 	if (g_chdir(prev_dir) < 0) {
 		FILE_OP_ERROR(prev_dir, "chdir");
 		g_free(prev_dir);
-		return -1;
+		return -(errno);
 	}
 
 	g_free(prev_dir);
 
 	if (g_rmdir(dir) < 0) {
 		FILE_OP_ERROR(dir, "rmdir");
-		return -1;
+		return -(errno);
 	}
 
 	return 0;
@@ -2611,14 +2613,14 @@ gint append_file(const gchar *src, const gchar *dest, gboolean keep_backup)
 
 	if (change_file_mode_rw(dest_fp, dest) < 0) {
 		FILE_OP_ERROR(dest, "chmod");
-		g_warning("can't change file mode\n");
+		g_warning("can't change file mode: %s", dest);
 	}
 
 	while ((n_read = fread(buf, sizeof(gchar), sizeof(buf), src_fp)) > 0) {
 		if (n_read < sizeof(buf) && ferror(src_fp))
 			break;
 		if (fwrite(buf, 1, n_read, dest_fp) < n_read) {
-			g_warning("writing to %s failed.\n", dest);
+			g_warning("writing to %s failed.", dest);
 			fclose(dest_fp);
 			fclose(src_fp);
 			claws_unlink(dest);
@@ -2679,14 +2681,14 @@ gint copy_file(const gchar *src, const gchar *dest, gboolean keep_backup)
 
 	if (change_file_mode_rw(dest_fp, dest) < 0) {
 		FILE_OP_ERROR(dest, "chmod");
-		g_warning("can't change file mode\n");
+		g_warning("can't change file mode: %s", dest);
 	}
 
 	while ((n_read = fread(buf, sizeof(gchar), sizeof(buf), src_fp)) > 0) {
 		if (n_read < sizeof(buf) && ferror(src_fp))
 			break;
 		if (fwrite(buf, 1, n_read, dest_fp) < n_read) {
-			g_warning("writing to %s failed.\n", dest);
+			g_warning("writing to %s failed.", dest);
 			fclose(dest_fp);
 			fclose(src_fp);
 			claws_unlink(dest);
@@ -2794,7 +2796,7 @@ gint copy_file_part(FILE *fp, off_t offset, size_t length, const gchar *dest)
 
 	if (change_file_mode_rw(dest_fp, dest) < 0) {
 		FILE_OP_ERROR(dest, "chmod");
-		g_warning("can't change file mode\n");
+		g_warning("can't change file mode: %s", dest);
 	}
 
 	if (copy_file_part_to_fp(fp, offset, length, dest_fp) < 0)
@@ -2806,7 +2808,7 @@ gint copy_file_part(FILE *fp, off_t offset, size_t length, const gchar *dest)
 	}
 
 	if (err) {
-		g_warning("writing to %s failed.\n", dest);
+		g_warning("writing to %s failed.", dest);
 		claws_unlink(dest);
 		return -1;
 	}
@@ -2874,7 +2876,7 @@ gint canonicalize_file(const gchar *src, const gchar *dest)
 
 	if (change_file_mode_rw(dest_fp, dest) < 0) {
 		FILE_OP_ERROR(dest, "chmod");
-		g_warning("can't change file mode\n");
+		g_warning("can't change file mode: %s", dest);
 	}
 
 	while (fgets(buf, sizeof(buf), src_fp) != NULL) {
@@ -2900,7 +2902,7 @@ gint canonicalize_file(const gchar *src, const gchar *dest)
 		}
 
 		if (r == EOF) {
-			g_warning("writing to %s failed.\n", dest);
+			g_warning("writing to %s failed.", dest);
 			fclose(dest_fp);
 			fclose(src_fp);
 			claws_unlink(dest);
@@ -2943,7 +2945,7 @@ gint canonicalize_file_replace(const gchar *file)
 	}
 
 	if (move_file(tmp_file, file, TRUE) < 0) {
-		g_warning("can't replace %s .\n", file);
+		g_warning("can't replace file: %s", file);
 		claws_unlink(tmp_file);
 		g_free(tmp_file);
 		return -1;
@@ -3257,7 +3259,7 @@ static gchar *file_read_to_str_full(const gchar *file, gboolean recode)
 		return NULL;
 	}
 	if (S_ISDIR(s.st_mode)) {
-		g_warning("%s: is a directory\n", file);
+		g_warning("%s: is a directory", file);
 		return NULL;
 	}
 
@@ -3284,7 +3286,7 @@ static gchar *file_read_to_str_full(const gchar *file, gboolean recode)
 		if (err < 0) {
 			FILE_OP_ERROR(file, "select");
 		} else {
-			g_warning("%s: doesn't seem readable\n", file);
+			g_warning("%s: doesn't seem readable", file);
 		}
 		close(fd);
 		return NULL;
@@ -3374,7 +3376,7 @@ static gint execute_async(gchar *const argv[])
 
 	if (g_spawn_async(NULL, (gchar **)argv, NULL, G_SPAWN_SEARCH_PATH,
 			  NULL, NULL, NULL, FALSE) == FALSE) {
-		g_warning("Couldn't execute command: %s\n", argv[0]);
+		g_warning("couldn't execute command: %s", argv[0]);
 		return -1;
 	}
 
@@ -3390,7 +3392,7 @@ static gint execute_sync(gchar *const argv[])
 #ifdef G_OS_UNIX
 	if (g_spawn_sync(NULL, (gchar **)argv, NULL, G_SPAWN_SEARCH_PATH,
 			 NULL, NULL, NULL, NULL, &status, NULL) == FALSE) {
-		g_warning("Couldn't execute command: %s\n", argv[0]);
+		g_warning("couldn't execute command: %s", argv[0]);
 		return -1;
 	}
 
@@ -3402,7 +3404,7 @@ static gint execute_sync(gchar *const argv[])
 	if (g_spawn_sync(NULL, (gchar **)argv, NULL, G_SPAWN_SEARCH_PATH| 
 			 G_SPAWN_CHILD_INHERITS_STDIN|G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
 			 NULL, NULL, NULL, NULL, &status, NULL) == FALSE) {
-		g_warning("Couldn't execute command: %s\n", argv[0]);
+		g_warning("couldn't execute command: %s", argv[0]);
 		return -1;
 	}
 
@@ -3440,7 +3442,7 @@ gchar *get_command_output(const gchar *cmdline)
 
 	if (g_spawn_command_line_sync(cmdline, &child_stdout, NULL, &status,
 				      NULL) == FALSE) {
-		g_warning("Couldn't execute command: %s\n", cmdline);
+		g_warning("couldn't execute command: %s", cmdline);
 		return NULL;
 	}
 
@@ -4814,14 +4816,14 @@ void mailcap_update_default(const gchar *type, const gchar *command)
 	if (!fp) {
 		fp = g_fopen(path, "a");
 		if (!fp) {
-			g_warning("failed to create file %s\n", path);
+			g_warning("failed to create file %s", path);
 			g_free(path);
 			g_free(outpath);
 			return;
 		}
 		fp = g_freopen(path, "rb", fp);
 		if (!fp) {
-			g_warning("failed to reopen file %s\n", path);
+			g_warning("failed to reopen file %s", path);
 			g_free(path);
 			g_free(outpath);
 			return;
@@ -4830,7 +4832,7 @@ void mailcap_update_default(const gchar *type, const gchar *command)
 
 	outfp = g_fopen(outpath, "wb");
 	if (!outfp) {
-		g_warning("failed to create file %s\n", outpath);
+		g_warning("failed to create file %s", outpath);
 		g_free(path);
 		g_free(outpath);
 		fclose(fp);
@@ -4878,7 +4880,7 @@ gint copy_dir(const gchar *src, const gchar *dst)
 	const gchar *name;
 
 	if ((dir = g_dir_open(src, 0, NULL)) == NULL) {
-		g_warning("failed to open directory: %s\n", src);
+		g_warning("failed to open directory: %s", src);
 		return -1;
 	}
 
@@ -5361,7 +5363,7 @@ int claws_unlink(const gchar *filename)
 					debug_print("%s %s exited with status %d\n",
 						args[0], filename, WEXITSTATUS(status));
 					if (truncate(filename, 0) < 0)
-						g_warning("couln't truncate");
+						g_warning("couln't truncate: %s", filename);
 				}
 			}
 		}
diff --git a/src/mh.c b/src/mh.c
index d1f4410..53e43a5 100644
--- a/src/mh.c
+++ b/src/mh.c
@@ -1018,16 +1018,17 @@ static gint mh_rename_folder(Folder *folder, FolderItem *item,
 static gint mh_remove_folder(Folder *folder, FolderItem *item)
 {
 	gchar *path;
+	gint ret;
 
 	cm_return_val_if_fail(folder != NULL, -1);
 	cm_return_val_if_fail(item != NULL, -1);
 	cm_return_val_if_fail(item->path != NULL, -1);
 
 	path = folder_item_get_path(item);
-	if (remove_dir_recursive(path) < 0) {
+	if ((ret = remove_dir_recursive(path)) < 0) {
 		g_warning("can't remove directory `%s'\n", path);
 		g_free(path);
-		return -1;
+		return ret;
 	}
 
 	g_free(path);
diff --git a/src/mh_gtk.c b/src/mh_gtk.c
index 81bf4c6..2995f01 100644
--- a/src/mh_gtk.c
+++ b/src/mh_gtk.c
@@ -187,6 +187,7 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
 	gchar *message, *name;
 	AlertValue avalue;
 	gchar *old_id;
+	gint ret;
 
 	item = folderview_get_selected_item(folderview);
 	cm_return_if_fail(item != NULL);
@@ -215,9 +216,10 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
 		folderview->opened = NULL;
 	}
 
-	if (item->folder->klass->remove_folder(item->folder, item) < 0) {
+	if ((ret = item->folder->klass->remove_folder(item->folder, item)) < 0) {
 		folder_item_scan(item);
-		alertpanel_error(_("Can't remove the folder '%s'."), name);
+		alertpanel_error(_("Can't remove the folder '%s'\n\n%s."),
+				 name, g_strerror(-ret));
 		g_free(old_id);
 		return;
 	}

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list