The posibilito to not use trash at all was lost with implementation of
system trash.
However, usually one does not want the system to keep megabytes of trash
lying around. That option allows to switch trash of completely.
The implementation, however, is a bit dirty, maybe someone else has a
better Idea to do it.
options->file_ops.safe_delete_enable = TRUE;
options->file_ops.safe_delete_folder_maxsize = 128;
options->file_ops.safe_delete_path = NULL;
options->file_ops.safe_delete_enable = TRUE;
options->file_ops.safe_delete_folder_maxsize = 128;
options->file_ops.safe_delete_path = NULL;
+ options->file_ops.no_trash = FALSE;
options->file_sort.ascending = TRUE;
options->file_sort.case_sensitive = FALSE;
options->file_sort.ascending = TRUE;
options->file_sort.case_sensitive = FALSE;
gboolean use_system_trash;
gchar *safe_delete_path;
gint safe_delete_folder_maxsize;
gboolean use_system_trash;
gchar *safe_delete_path;
gint safe_delete_folder_maxsize;
options->file_ops.enable_delete_key = c_options->file_ops.enable_delete_key;
options->file_ops.confirm_move_to_trash = c_options->file_ops.confirm_move_to_trash;
options->file_ops.use_system_trash = c_options->file_ops.use_system_trash;
options->file_ops.enable_delete_key = c_options->file_ops.enable_delete_key;
options->file_ops.confirm_move_to_trash = c_options->file_ops.confirm_move_to_trash;
options->file_ops.use_system_trash = c_options->file_ops.use_system_trash;
+ options->file_ops.no_trash = c_options->file_ops.no_trash;
options->file_ops.safe_delete_folder_maxsize = c_options->file_ops.safe_delete_folder_maxsize;
options->tools_restore_state = c_options->tools_restore_state;
options->save_window_positions = c_options->save_window_positions;
options->file_ops.safe_delete_folder_maxsize = c_options->file_ops.safe_delete_folder_maxsize;
options->tools_restore_state = c_options->tools_restore_state;
options->save_window_positions = c_options->save_window_positions;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
{
c_options->file_ops.use_system_trash = FALSE;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
{
c_options->file_ops.use_system_trash = FALSE;
+ c_options->file_ops.no_trash = FALSE;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
{
c_options->file_ops.use_system_trash = TRUE;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
{
c_options->file_ops.use_system_trash = TRUE;
+ c_options->file_ops.no_trash = FALSE;
+ }
+}
+
+static void use_no_cache_cb(GtkWidget *widget, gpointer data)
+{
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+ {
+ c_options->file_ops.no_trash = TRUE;
options->file_ops.enable_delete_key, &c_options->file_ops.enable_delete_key);
ct_button = pref_radiobutton_new(group, NULL, _("Use Geeqie trash location"),
options->file_ops.enable_delete_key, &c_options->file_ops.enable_delete_key);
ct_button = pref_radiobutton_new(group, NULL, _("Use Geeqie trash location"),
- !options->file_ops.use_system_trash, G_CALLBACK(use_geeqie_trash_cb),NULL);
+ !options->file_ops.use_system_trash && !options->file_ops.no_trash, G_CALLBACK(use_geeqie_trash_cb),NULL);
hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
pref_checkbox_link_sensitivity(ct_button, hbox);
hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
pref_checkbox_link_sensitivity(ct_button, hbox);
G_CALLBACK(safe_delete_clear_cb), NULL);
gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
pref_radiobutton_new(group, ct_button, _("Use system Trash bin"),
G_CALLBACK(safe_delete_clear_cb), NULL);
gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
pref_radiobutton_new(group, ct_button, _("Use system Trash bin"),
- options->file_ops.use_system_trash, G_CALLBACK(use_system_trash_cb), NULL);
+ options->file_ops.use_system_trash && !options->file_ops.no_trash, G_CALLBACK(use_system_trash_cb), NULL);
+
+ pref_radiobutton_new(group, ct_button, _("Use no trash at all"),
+ options->file_ops.no_trash, G_CALLBACK(use_no_cache_cb), NULL);
+
gtk_widget_show(button);
pref_spacer(group, PREF_PAD_GROUP);
gtk_widget_show(button);
pref_spacer(group, PREF_PAD_GROUP);
WRITE_NL(); WRITE_BOOL(*options, file_ops.safe_delete_enable);
WRITE_NL(); WRITE_CHAR(*options, file_ops.safe_delete_path);
WRITE_NL(); WRITE_INT(*options, file_ops.safe_delete_folder_maxsize);
WRITE_NL(); WRITE_BOOL(*options, file_ops.safe_delete_enable);
WRITE_NL(); WRITE_CHAR(*options, file_ops.safe_delete_path);
WRITE_NL(); WRITE_INT(*options, file_ops.safe_delete_folder_maxsize);
+ WRITE_NL(); WRITE_BOOL(*options, file_ops.no_trash);
/* Properties dialog Options */
WRITE_NL(); WRITE_CHAR(*options, properties.tabs_order);
/* Properties dialog Options */
WRITE_NL(); WRITE_CHAR(*options, properties.tabs_order);
if (READ_BOOL(*options, file_ops.safe_delete_enable)) continue;
if (READ_CHAR(*options, file_ops.safe_delete_path)) continue;
if (READ_INT(*options, file_ops.safe_delete_folder_maxsize)) continue;
if (READ_BOOL(*options, file_ops.safe_delete_enable)) continue;
if (READ_CHAR(*options, file_ops.safe_delete_path)) continue;
if (READ_INT(*options, file_ops.safe_delete_folder_maxsize)) continue;
+ if (READ_BOOL(*options, file_ops.no_trash)) continue;
/* Fullscreen options */
if (READ_INT(*options, fullscreen.screen)) continue;
/* Fullscreen options */
if (READ_INT(*options, fullscreen.screen)) continue;
if (!isfile(path)) return FALSE;
if (!isfile(path)) return FALSE;
- if (!options->file_ops.use_system_trash)
+ if (options->file_ops.no_trash)
+ {
+ if (!unlink_file(path))
+ {
+ file_util_warning_dialog(_("Delete failed"),
+ _("Unable to remove file"),
+ GTK_STOCK_DIALOG_WARNING, NULL);
+ success = FALSE;
+ }
+ }
+ else if (!options->file_ops.use_system_trash)
{
if (!isdir(options->file_ops.safe_delete_path))
{
{
if (!isdir(options->file_ops.safe_delete_path))
{
{
buf = g_strdup(_("Deletion by external command"));
}
{
buf = g_strdup(_("Deletion by external command"));
}
+ else if (options->file_ops.no_trash)
+ {
+ buf = g_strdup(_("Deleting without trash"));
+ }
+ else if (options->file_ops.safe_delete_enable)
- if (options->file_ops.safe_delete_enable)
+ if (!options->file_ops.use_system_trash)
- if (!options->file_ops.use_system_trash)
- {
- gchar *buf2;
- if (options->file_ops.safe_delete_folder_maxsize > 0)
- buf2 = g_strdup_printf(_(" (max. %d MB)"), options->file_ops.safe_delete_folder_maxsize);
- else
- buf2 = g_strdup("");
-
- buf = g_strdup_printf(_("Using Geeqie Trash bin\n%s"), buf2);
- g_free(buf2);
- }
+ gchar *buf2;
+ if (options->file_ops.safe_delete_folder_maxsize > 0)
+ buf2 = g_strdup_printf(_(" (max. %d MB)"), options->file_ops.safe_delete_folder_maxsize);
- {
- buf = g_strdup(_("Using system Trash bin"));
- }
+ buf2 = g_strdup("");
+
+ buf = g_strdup_printf(_("Using Geeqie Trash bin\n%s"), buf2);
+ g_free(buf2);
+ }
+ else
+ {
+ buf = g_strdup(_("Using system Trash bin"));