summaryrefslogtreecommitdiff
path: root/src/xfdesktop-file-icon-manager.c
diff options
context:
space:
mode:
authorBrian Tarricone <brian@tarricone.org>2006-05-20 23:28:37 +0000
committerBrian Tarricone <brian@tarricone.org>2006-05-20 23:28:37 +0000
commit47ab34662bdfe47d83ff485f22280969fc05e7ce (patch)
tree96c5a401de5c3b9143a19d4fd5fc42b6e0c7c616 /src/xfdesktop-file-icon-manager.c
parent63c12bcae7d96a0430114f2a2ce24e014f418cf4 (diff)
downloadxfdesktop-47ab34662bdfe47d83ff485f22280969fc05e7ce.tar.gz
don't ignore GError return from thunar_vfs_copy_file() or
thunar_vfs_create_file() when creating a file from a template (Old svn revision: 21741)
Diffstat (limited to 'src/xfdesktop-file-icon-manager.c')
-rw-r--r--src/xfdesktop-file-icon-manager.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index 87f5bb66..3f8b4a29 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -1715,10 +1715,12 @@ xfdesktop_file_icon_template_item_activated(GtkWidget *mi,
gchar *name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
ThunarVfsPath *path = thunar_vfs_path_relative(fmanager->priv->folder,
name);
+ GError *error = NULL;
+
if(info)
- job = thunar_vfs_copy_file(info->path, path, NULL);
+ job = thunar_vfs_copy_file(info->path, path, &error);
else
- job = thunar_vfs_create_file(path, NULL);
+ job = thunar_vfs_create_file(path, &error);
if(job) {
g_object_set_data_full(G_OBJECT(job), "xfdesktop-file-name",
@@ -1729,8 +1731,18 @@ xfdesktop_file_icon_template_item_activated(GtkWidget *mi,
g_signal_connect(G_OBJECT(job), "finished",
G_CALLBACK(g_object_unref), NULL);
/* don't free |name|, GObject will do it */
- } else
+ } else {
+ if(error) {
+ gchar *primary = g_strdup_printf(_("Unable to create file \"%s\":"), name);
+ xfce_message_dialog(GTK_WINDOW(toplevel), _("Create Error"),
+ GTK_STOCK_DIALOG_ERROR, primary,
+ error->message, GTK_STOCK_CLOSE,
+ GTK_RESPONSE_ACCEPT, NULL);
+ g_free(primary);
+ g_error_free(error);
+ }
g_free(name);
+ }
thunar_vfs_path_unref(path);
}