summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Meurer <benny@xfce.org>2005-09-22 18:38:36 +0000
committerBenedikt Meurer <benny@xfce.org>2005-09-22 18:38:36 +0000
commitfebc177d81c27ef079984244270a324968909828 (patch)
treee16e8cba2990f883c432c8b876d80337f49e55f3
parent4ebfe7443e945b6f26d85c8f1a24c1146ea5b488 (diff)
downloadthunar-febc177d81c27ef079984244270a324968909828.tar.gz
2005-09-22 Benedikt Meurer <benny@xfce.org>
* thunar-vfs/thunar-vfs-trash.h: Fix typo. * thunar/thunar-chooser-dialog.c(thunar_chooser_dialog_response): Handle absolute paths properly for custom commands. (Old svn revision: 17764)
-rw-r--r--ChangeLog6
-rw-r--r--thunar-vfs/thunar-vfs-trash.h2
-rw-r--r--thunar/thunar-chooser-dialog.c11
3 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f73cd5c..cc675889 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-22 Benedikt Meurer <benny@xfce.org>
+
+ * thunar-vfs/thunar-vfs-trash.h: Fix typo.
+ * thunar/thunar-chooser-dialog.c(thunar_chooser_dialog_response): Handle
+ absolute paths properly for custom commands.
+
2005-09-20 Benedikt Meurer <benny@xfce.org>
* thunar-vfs/thunar-vfs-mime-application.{c,h},
diff --git a/thunar-vfs/thunar-vfs-trash.h b/thunar-vfs/thunar-vfs-trash.h
index 035faa97..0bd4f4f2 100644
--- a/thunar-vfs/thunar-vfs-trash.h
+++ b/thunar-vfs/thunar-vfs-trash.h
@@ -26,7 +26,7 @@ G_BEGIN_DECLS;
typedef struct _ThunarVfsTrashInfo ThunarVfsTrashInfo;
-#define THUNAR_VFS_TRASH_INFO (thunar_vfs_trash_info_get_type ())
+#define THUNAR_VFS_TYPE_TRASH_INFO (thunar_vfs_trash_info_get_type ())
GType thunar_vfs_trash_info_get_type (void) G_GNUC_CONST;
diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c
index e7732806..6232f364 100644
--- a/thunar/thunar-chooser-dialog.c
+++ b/thunar/thunar-chooser-dialog.c
@@ -382,6 +382,7 @@ thunar_chooser_dialog_response (GtkDialog *widget,
GtkWidget *message;
gboolean succeed;
GError *error = NULL;
+ gchar *path;
gchar *name;
gchar *s;
GList list;
@@ -408,12 +409,15 @@ thunar_chooser_dialog_response (GtkDialog *widget,
/* determine the command line for the custom command */
exec = gtk_entry_get_text (GTK_ENTRY (dialog->custom_entry));
- /* determine the name for the custom command */
- name = g_strdup (exec);
- s = strchr (name, ' ');
+ /* determine the path for the custom command */
+ path = g_strdup (exec);
+ s = strchr (path, ' ');
if (G_UNLIKELY (s != NULL))
*s = '\0';
+ /* determine the name from the path of the custom command */
+ name = g_path_get_basename (path);
+
/* try to add an application for the custom command */
application = thunar_vfs_mime_database_add_application (mime_database, mime_info, name, exec, &error);
@@ -433,6 +437,7 @@ thunar_chooser_dialog_response (GtkDialog *widget,
}
/* cleanup */
+ g_free (path);
g_free (name);
}