diff options
author | Iain Holmes <iain@src.gnome.org> | 2001-09-05 05:42:45 +0800 |
---|---|---|
committer | Iain Holmes <iain@src.gnome.org> | 2001-09-05 05:42:45 +0800 |
commit | 00164176ef0d698a508156fd6bda3597e04bafe9 (patch) | |
tree | d64f9cb0f36eb93785a285654789c27070966f6e | |
parent | ca52e80ea86b2d7b542c9a5d825edd91d627f837 (diff) | |
download | gsoc2013-evolution-00164176ef0d698a508156fd6bda3597e04bafe9.tar.gz gsoc2013-evolution-00164176ef0d698a508156fd6bda3597e04bafe9.tar.zst gsoc2013-evolution-00164176ef0d698a508156fd6bda3597e04bafe9.zip |
Check the file exists before trying to import it
svn path=/trunk/; revision=12603
-rw-r--r-- | shell/ChangeLog | 5 | ||||
-rw-r--r-- | shell/e-shell-importer.c | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 5a35a8243f..18ffd79923 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,10 @@ 2001-09-04 Iain Holmes <iain@ximian.com> + * e-shell-importer.c (start_import): Check the file exists before trying + to do anything. + +2001-09-04 Iain Holmes <iain@ximian.com> + * e-shell.c (e_shell_construct): Make the other components shut down correctly when the first time dialog is cancelled. diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c index ff0600ab98..e28a339191 100644 --- a/shell/e-shell-importer.c +++ b/shell/e-shell-importer.c @@ -25,6 +25,10 @@ #include <config.h> #endif +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + #include <glib.h> #include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> @@ -336,7 +340,18 @@ start_import (const char *folderpath, ImporterComponentData *icd; char *label; char *real_iid; + struct stat buf; + if (stat (filename, &buf) == -1) { + char *message; + + message = g_strdup_printf (_("File %s does not exist"), filename); + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, message); + g_free (message); + + return; + } + if (iid == NULL || strcmp (iid, "Automatic") == 0) { /* Work out the component to use */ real_iid = get_iid_for_filetype (filename); |