updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / thunar-notrash / Ability_to_disable_trash_on_Thunar_1.3.0.patch
blob9fce395c8bf5337c22e0ecb348d3c19d9ced8feb
1 Only in src: Ability_to_disable_trash_on_Thunar_1.1.6.patch
2 Only in src2: Ability_to_disable_trash_on_Thunar.patch
3 diff -ru src/Thunar-1.1.6/thunar/thunar-application.c src2/Thunar-1.1.6/thunar/thunar-application.c
4 --- src/Thunar-1.1.6/thunar/thunar-application.c 2011-01-02 14:35:27.000000000 +0100
5 +++ src2/Thunar-1.1.6/thunar/thunar-application.c 2011-01-06 16:42:52.000000000 +0100
6 @@ -1639,10 +1639,14 @@
7 gchar *message;
8 guint n_path_list = 0;
9 gint response;
10 + gboolean isTrashEnabled;
12 _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent));
13 _thunar_return_if_fail (THUNAR_IS_APPLICATION (application));
15 + g_object_get (G_OBJECT (application->preferences), "misc-enable-trash", &isTrashEnabled, NULL);
16 + if (!isTrashEnabled)
17 + permanently = TRUE;
18 if (!permanently)
20 /* check if we should permanently delete the files (user holds shift) */
21 @@ -1669,8 +1673,8 @@
22 if (G_UNLIKELY (permanently))
24 /* parse the parent pointer */
25 - screen = thunar_util_parse_parent (parent, &window);
27 + screen = thunar_util_parse_parent (parent, &window);
29 /* generate the question to confirm the delete operation */
30 if (G_LIKELY (n_path_list == 1))
32 Only in src2/Thunar-1.1.6/thunar: thunar-application.c.orig
33 Only in src2/Thunar-1.1.6/thunar: thunar-application.c.rej
34 Only in src2/Thunar-1.1.6/thunar: .thunar-application.c.un~
35 diff -ru src/Thunar-1.1.6/thunar/thunar-preferences.c src2/Thunar-1.1.6/thunar/thunar-preferences.c
36 --- src/Thunar-1.1.6/thunar/thunar-preferences.c 2011-01-02 14:35:27.000000000 +0100
37 +++ src2/Thunar-1.1.6/thunar/thunar-preferences.c 2011-01-06 16:29:57.000000000 +0100
38 @@ -71,6 +71,7 @@
39 PROP_MISC_VOLUME_MANAGEMENT,
40 PROP_MISC_CASE_SENSITIVE,
41 PROP_MISC_DATE_STYLE,
42 + PROP_MISC_ENABLE_TRASH,
43 PROP_MISC_FOLDERS_FIRST,
44 PROP_MISC_HORIZONTAL_WHEEL_NAVIGATES,
45 PROP_MISC_RECURSIVE_PERMISSIONS,
46 @@ -642,6 +643,19 @@
47 THUNAR_TYPE_ICON_SIZE,
48 THUNAR_ICON_SIZE_SMALLEST,
49 EXO_PARAM_READWRITE));
51 + /**
52 + * ThunarPreferences:misc-enable-trash:
53 + *
54 + * If trash is disabled, files will be deleted permanently
55 + **/
56 + g_object_class_install_property (gobject_class,
57 + PROP_MISC_ENABLE_TRASH,
58 + g_param_spec_boolean ("misc-enable-trash",
59 + "misc-enable-trash",
60 + "misc-enable-trash",
61 + TRUE,
62 + EXO_PARAM_READWRITE));
66 Only in src2/Thunar-1.1.6/thunar: thunar-preferences.c.orig
67 Only in src2/Thunar-1.1.6/thunar: .thunar-preferences.c.un~
68 diff -ru src/Thunar-1.1.6/thunar/thunar-preferences-dialog.c src2/Thunar-1.1.6/thunar/thunar-preferences-dialog.c
69 --- src/Thunar-1.1.6/thunar/thunar-preferences-dialog.c 2011-01-02 14:35:27.000000000 +0100
70 +++ src2/Thunar-1.1.6/thunar/thunar-preferences-dialog.c 2011-01-06 17:17:54.000000000 +0100
71 @@ -374,7 +374,7 @@
72 gtk_frame_set_label_widget (GTK_FRAME (frame), label);
73 gtk_widget_show (label);
75 - table = gtk_table_new (2, 2, FALSE);
76 + table = gtk_table_new (3, 2, FALSE);
77 gtk_table_set_row_spacings (GTK_TABLE (table), 6);
78 gtk_table_set_col_spacings (GTK_TABLE (table), 12);
79 gtk_container_set_border_width (GTK_CONTAINER (table), 12);
80 @@ -526,7 +526,7 @@
81 gtk_frame_set_label_widget (GTK_FRAME (frame), label);
82 gtk_widget_show (label);
84 - table = gtk_table_new (2, 2, FALSE);
85 + table = gtk_table_new (3, 2, FALSE);
86 gtk_table_set_row_spacings (GTK_TABLE (table), 6);
87 gtk_table_set_col_spacings (GTK_TABLE (table), 12);
88 gtk_container_set_border_width (GTK_CONTAINER (table), 12);
89 @@ -553,12 +553,18 @@
90 gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
91 gtk_widget_show (frame);
93 + button = gtk_check_button_new_with_mnemonic (_("Move items to Trash on _deletion."));
94 + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-enable-trash", G_OBJECT (button), "active");
95 + thunar_gtk_widget_set_tooltip (button, _( "By default, items are sent to the Trash on deletion. By disabling this option, items will be removed on deletion and will be lost forever. (DANGEROUS)" ) );
96 + gtk_table_attach (GTK_TABLE (table), button, 0,1,2,3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
97 + gtk_widget_show (button);
99 label = gtk_label_new (_("Volume Management"));
100 gtk_label_set_attributes (GTK_LABEL (label), thunar_pango_attr_list_bold ());
101 gtk_frame_set_label_widget (GTK_FRAME (frame), label);
102 gtk_widget_show (label);
104 - table = gtk_table_new (2, 2, FALSE);
105 + table = gtk_table_new (3, 2, FALSE);
106 gtk_table_set_row_spacings (GTK_TABLE (table), 6);
107 gtk_table_set_col_spacings (GTK_TABLE (table), 12);
108 gtk_container_set_border_width (GTK_CONTAINER (table), 12);
109 Only in src2/Thunar-1.1.6/thunar: thunar-preferences-dialog.c.orig
110 Only in src2/Thunar-1.1.6/thunar: thunar-preferences-dialog.c.rej
111 Only in src2/Thunar-1.1.6/thunar: .thunar-preferences-dialog.c.un~
112 diff -ru src/Thunar-1.1.6/thunar/thunar-shortcuts-model.c src2/Thunar-1.1.6/thunar/thunar-shortcuts-model.c
113 --- src/Thunar-1.1.6/thunar/thunar-shortcuts-model.c 2011-01-02 14:35:27.000000000 +0100
114 +++ src2/Thunar-1.1.6/thunar/thunar-shortcuts-model.c 2011-01-06 16:41:44.000000000 +0100
115 @@ -38,6 +38,7 @@
116 #include <glib.h>
117 #include <glib/gstdio.h>
119 +#include <thunar/thunar-preferences.h>
120 #include <thunar/thunar-file.h>
121 #include <thunar/thunar-shortcuts-model.h>
122 #include <thunar/thunar-private.h>
123 @@ -230,11 +231,14 @@
124 GList *system_paths = NULL;
125 GList *volumes;
126 GList *lp;
127 + gboolean isTrashEnabled;
129 #ifndef NDEBUG
130 model->stamp = g_random_int ();
131 #endif
133 + g_object_get (G_OBJECT (thunar_preferences_get ()), "misc-enable-trash", &isTrashEnabled, NULL);
135 /* connect to the volume monitor */
136 model->volume_monitor = g_volume_monitor_get ();
137 g_signal_connect (model->volume_monitor, "volume-added", G_CALLBACK (thunar_shortcuts_model_volume_added), model);
138 @@ -253,7 +257,7 @@
139 g_object_unref (desktop);
141 /* append the trash icon if the trash is supported */
142 - if (thunar_g_vfs_is_uri_scheme_supported ("trash"))
143 + if (isTrashEnabled && thunar_g_vfs_is_uri_scheme_supported ("trash"))
144 system_paths = g_list_append (system_paths, thunar_g_file_new_for_trash ());
146 /* append the root file system */
147 Only in src2/Thunar-1.1.6/thunar: thunar-shortcuts-model.c.orig
148 Only in src2/Thunar-1.1.6/thunar: thunar-shortcuts-model.c.rej
149 Only in src2/Thunar-1.1.6/thunar: .thunar-shortcuts-model.c.un~
150 diff -ru src/Thunar-1.1.6/thunar/thunar-tree-model.c src2/Thunar-1.1.6/thunar/thunar-tree-model.c
151 --- src/Thunar-1.1.6/thunar/thunar-tree-model.c 2011-01-02 14:35:27.000000000 +0100
152 +++ src2/Thunar-1.1.6/thunar/thunar-tree-model.c 2011-01-06 16:41:54.000000000 +0100
153 @@ -282,12 +282,15 @@
154 GList *volumes;
155 GList *lp;
156 GNode *node;
157 + gboolean isTrashEnabled;
159 /* generate a unique stamp if we're in debug mode */
160 #ifndef NDEBUG
161 model->stamp = g_random_int ();
162 #endif
164 + g_object_get (G_OBJECT (thunar_preferences_get ()), "misc-enable-trash", &isTrashEnabled, NULL);
166 /* initialize the model data */
167 model->sort_case_sensitive = TRUE;
168 model->visible_func = (ThunarTreeModelVisibleFunc) exo_noop_true;
169 @@ -320,7 +323,7 @@
170 g_object_unref (desktop);
172 /* append the trash icon if the trash is supported */
173 - if (thunar_g_vfs_is_uri_scheme_supported ("trash"))
174 + if (isTrashEnabled && thunar_g_vfs_is_uri_scheme_supported ("trash"))
175 system_paths = g_list_append (system_paths, thunar_g_file_new_for_trash ());
177 /* append the root file system */
178 Only in src2/Thunar-1.1.6/thunar: .thunar-tree-model.c.un~