+2007-01-30 [colin] 2.7.2cvs7
+
+ * src/main.c
+ * src/compose.c
+ Handle local URIs to attach files (file:///...)
+ Fixes attaching files from Thunar for example
+
2007-01-30 [colin] 2.7.2cvs6
* src/prefs_ext_prog.c
( cvs diff -u -r 1.274.2.168 -r 1.274.2.169 src/mainwindow.c; cvs diff -u -r 1.39.2.31 -r 1.39.2.32 src/mainwindow.h; cvs diff -u -r 1.14.2.48 -r 1.14.2.49 src/plugins/trayicon/trayicon.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/plugins/trayicon/trayicon_prefs.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/plugins/trayicon/trayicon_prefs.h; ) > 2.7.2cvs4.patchset
( cvs diff -u -r 1.53.2.22 -r 1.53.2.23 po/POTFILES.in; cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/plugins/trayicon/trayicon_prefs.c; ) > 2.7.2cvs5.patchset
( cvs diff -u -r 1.3.2.13 -r 1.3.2.14 src/prefs_ext_prog.c; ) > 2.7.2cvs6.patchset
+( cvs diff -u -r 1.115.2.130 -r 1.115.2.131 src/main.c; cvs diff -u -r 1.382.2.355 -r 1.382.2.356 src/compose.c; ) > 2.7.2cvs7.patchset
MICRO_VERSION=2
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=6
+EXTRA_VERSION=7
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
gboolean has_binary = FALSE;
if (!is_file_exist(file)) {
+ gchar *file_from_uri = g_filename_from_uri(file, NULL, NULL);
+ gboolean result = FALSE;
+ if (file_from_uri && is_file_exist(file_from_uri)) {
+ result = compose_attach_append(
+ compose, file_from_uri,
+ filename,
+ content_type);
+ }
+ g_free(file_from_uri);
+ if (result)
+ return TRUE;
alertpanel_error("File %s doesn't exist\n", filename);
return FALSE;
}
}
} else if (!strncmp(argv[i], "--attach", 8)) {
const gchar *p = argv[i + 1];
- gchar *file;
+ gchar *file = NULL;
while (p && *p != '\0' && *p != '-') {
if (!cmd.attach_files) {
cmd.attach_files = g_ptr_array_new();
}
- if (*p != G_DIR_SEPARATOR) {
+ if ((file = g_filename_from_uri(p, NULL, NULL)) != NULL) {
+ if (!is_file_exist(file)) {
+ g_free(file);
+ file = NULL;
+ }
+ }
+ if (file == NULL && *p != G_DIR_SEPARATOR) {
file = g_strconcat(claws_get_startup_dir(),
G_DIR_SEPARATOR_S,
p, NULL);
- } else {
+ } else if (file == NULL) {
file = g_strdup(p);
}
g_ptr_array_add(cmd.attach_files, file);