aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-12-01 06:44:00 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-12-01 06:44:00 +0800
commit8fa85c39e57e7a4a71fd8beaac0fec733c328ae1 (patch)
tree0652961f25c721e9b664c459f7547b5dca3809bf /mail
parentbe13fec34348b896b22543dd6f4693ec19d1ac02 (diff)
downloadgsoc2013-evolution-8fa85c39e57e7a4a71fd8beaac0fec733c328ae1.tar
gsoc2013-evolution-8fa85c39e57e7a4a71fd8beaac0fec733c328ae1.tar.gz
gsoc2013-evolution-8fa85c39e57e7a4a71fd8beaac0fec733c328ae1.tar.bz2
gsoc2013-evolution-8fa85c39e57e7a4a71fd8beaac0fec733c328ae1.tar.lz
gsoc2013-evolution-8fa85c39e57e7a4a71fd8beaac0fec733c328ae1.tar.xz
gsoc2013-evolution-8fa85c39e57e7a4a71fd8beaac0fec733c328ae1.tar.zst
gsoc2013-evolution-8fa85c39e57e7a4a71fd8beaac0fec733c328ae1.zip
Don't display a dialog, instead inform the user that there was no new mail
2000-11-30 Jeffrey Stedfast <fejj@helixcode.com> * mail-ops.c (cleanup_fetch_mail): Don't display a dialog, instead inform the user that there was no new mail by setting a status message. * message-list.c (message_list_drag_data_get): Use the new e_str_make_safe function. * mail-display.c (make_safe_filename): And here. * mail-config.c (mail_config_folder_to_cachename): Here too. svn path=/trunk/; revision=6745
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/mail-config.c10
-rw-r--r--mail/mail-display.c12
-rw-r--r--mail/mail-ops.c15
-rw-r--r--mail/message-list.c25
5 files changed, 47 insertions, 28 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 90325a1c56..bd6c125047 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,16 @@
+2000-11-30 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * mail-ops.c (cleanup_fetch_mail): Don't display a dialog, instead
+ inform the user that there was no new mail by setting a status
+ message.
+
+ * message-list.c (message_list_drag_data_get): Use the new
+ e_str_make_safe function.
+
+ * mail-display.c (make_safe_filename): And here.
+
+ * mail-config.c (mail_config_folder_to_cachename): Here too.
+
2000-11-30 Not Zed <NotZed@HelixCode.com>
* mail-ops.c (cleanup_load_folder): Set threaded view before
diff --git a/mail/mail-config.c b/mail/mail-config.c
index df8d7bc0a3..2bbd9194f3 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -33,6 +33,7 @@
#include <gtkhtml/gtkhtml.h>
#include <glade/glade.h>
+#include <gal/util/e-util.h>
#include "e-util/e-html-utils.h"
#include "mail.h"
#include "mail-config.h"
@@ -567,13 +568,10 @@ mail_config_add_news (MailConfigService *news)
char *
mail_config_folder_to_cachename(CamelFolder *folder, const char *prefix)
{
- char *url, *p, *filename;
-
+ char *url, *filename;
+
url = camel_url_to_string(CAMEL_SERVICE(folder->parent_store)->url, FALSE);
- for (p = url; *p; p++) {
- if (!isprint((unsigned char)*p) || strchr(" /'\"`&();|<>${}!", *p))
- *p = '_';
- }
+ e_str_make_safe (url);
filename = g_strdup_printf("%s/config/%s%s", evolution_dir, prefix, url);
g_free(url);
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 2fd4f83175..0d1f205559 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -123,13 +123,11 @@ make_safe_filename (const char *prefix, CamelMimePart *part)
safe = g_strdup_printf ("%s%s", prefix, p);
else
safe = g_strdup_printf ("%s/%s", prefix, name);
-
- for (p = strrchr (safe, '/') + 1; *p; p++) {
- if (!isascii ((unsigned char)*p) ||
- strchr (" /'\"`&();|<>${}!", *p))
- *p = '_';
- }
-
+
+ p = strrchr (safe, '/') + 1;
+ if (p)
+ e_str_make_safe (p);
+
return safe;
}
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index ee269f91b9..9052eaed3b 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -326,17 +326,10 @@ cleanup_fetch_mail (gpointer in_data, gpointer op_data, CamelException *ex)
fetch_mail_input_t *input = (fetch_mail_input_t *) in_data;
fetch_mail_data_t *data = (fetch_mail_data_t *) op_data;
- if (data->empty && !camel_exception_is_set (ex)) {
- GtkWidget *dialog;
- gchar *str;
-
- str = g_strdup_printf (_("There is no new mail at %s."),
- input->source_url);
- dialog = gnome_ok_dialog (str);
- g_free (str);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- }
-
+ if (data->empty && !camel_exception_is_set (ex))
+ mail_op_set_message (_("There is no new mail at %s."),
+ input->source_url);
+
if (data->update_infos) {
int i;
diff --git a/mail/message-list.c b/mail/message-list.c
index 41477fc8c9..9cc69daac4 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -390,14 +390,30 @@ message_list_drag_data_get (ETable *table,
MessageList *mlist = (MessageList *) user_data;
const CamelMessageInfo *minfo = get_message_info (mlist, row);
GPtrArray *uids = NULL;
- char *dirname = "/tmp/ev-XXXXXXXXXX";
- char *filename;
+ char *tmpl, *tmpdir, *filename, *subject, *p;
switch (info) {
case DND_TARGET_LIST_TYPE_URI:
/* drag & drop into nautilus */
- mktemp (dirname);
- filename = g_strdup_printf ("%s/%s.eml", dirname, camel_message_info_subject(minfo));
+ tmpl = g_strdup ("/tmp/evolution.XXXXXX");
+#ifdef HAVE_MKDTEMP
+ tmpdir = mkdtemp (tmpl);
+#else
+ tmpdir = mktemp (tmpl);
+ if (tmpdir) {
+ if (mkdir (tmpdir, S_IRWXU) == -1)
+ tmpdir = NULL;
+ }
+#endif
+ if (!tmpdir) {
+ g_free (tmpl);
+ return;
+ }
+
+ subject = g_strdup (camel_message_info_subject (minfo));
+ e_str_make_safe (subject);
+ filename = g_strdup_printf ("%s/%s.eml", tmpdir, subject);
+ g_free (subject);
uids = g_ptr_array_new ();
g_ptr_array_add (uids, g_strdup (mlist->cursor_uid));
@@ -407,6 +423,7 @@ message_list_drag_data_get (ETable *table,
gtk_selection_data_set (selection_data, selection_data->target, 8,
(guchar *) filename, strlen (filename));
+ g_free (tmpl);
g_free (filename);
break;
default: