Merge ~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-fix-recursive-engines into ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic
- Git
- lp:~3v1n0/ubuntu/+source/nautilus
- ubuntu/bionic-fix-recursive-engines
- Merge into ubuntu/bionic
Status: | Superseded |
---|---|
Proposed branch: | ~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-fix-recursive-engines |
Merge into: | ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic |
Diff against target: |
1878 lines (+1357/-93) 16 files modified
NEWS (+3/-0) debian/changelog (+24/-0) debian/control.in (+4/-1) debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch (+88/-46) debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch (+20/-14) debian/patches/0018-search-engine-add-locate-based-search-engine.patch (+25/-21) debian/patches/Revert-Revert-files-view-Remove-new-empty-folder-name-sug.patch (+53/-0) debian/patches/Revert-Revert-nautilus-file-Don-t-show-thumbnails-for-the.patch (+25/-0) debian/patches/git_middle_tab.patch (+78/-0) debian/patches/nautilusgtkplacesview-show-error-if-volume-is-not-mounted.patch (+45/-0) debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch (+977/-0) debian/patches/series (+5/-0) meson.build (+1/-1) src/nautilus-file.c (+1/-1) src/nautilus-files-view.c (+7/-8) src/nautilus-trash-monitor.c (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Desktop | Pending | ||
Review via email: mp+349800@code.launchpad.net |
This proposal has been superseded by a proposal from 2018-07-20.
Commit message
* New upstream release: 3.26.3.1
* debian/
debian/
debian/
- Follow nautilus settings to search only in current folder (LP: #1767027).
This doesn't apply to gnome-shell search provider for indexed searches.
* debian/
- Updated to respect upstream requested changes
* debian/
- don't crash if selecting a volume that is not mounted (LP: #1764779)
Description of the change
Amr Ibrahim (amribrahim1987) wrote : | # |
- 034a651... by Marco Trevisan (Treviño)
-
Reverts the reverts introduced in 2.26.3.1 as they are in ubuntu already
Removing these would be a regression from our POV.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Right Amr, I had the same feeling... So pushed a fix for both this and ubuntu/master
Unmerged commits
- 034a651... by Marco Trevisan (Treviño)
-
Reverts the reverts introduced in 2.26.3.1 as they are in ubuntu already
Removing these would be a regression from our POV.
- 6e493a1... by Marco Trevisan (Treviño)
-
recent-
manager- update: Updated to respect upstream requested changes - 0afc1ee... by Marco Trevisan (Treviño)
-
search-engine: respect settings for recursive search
Follow nautilus settings to search only in current folder.
This doesn't apply to gnome-shell search provider for indexed searches.LP: #1767027
- adc5134... by Marco Trevisan (Treviño)
-
nautilusgtkplac
esview: show error if volume is not mounted LP: #1764779
- 92807da... by Marco Trevisan (Treviño)
-
debian/changelog: update to reflect new upstream release version
- 3a32e73... by Marco Trevisan (Treviño)
-
Update upstream source from tag 'upstream/3.26.3.1'
Upstream version 3.26.3.1
- 1c3c422... by Sebastien Bacher
-
* debian/
patches/ git_middle_ tab.patch: - don't close the view when middle clicking on an item in the "other locations" (lp: #1765776) (bzr r574)
- 70d0163... by Marco Trevisan (Treviño)
-
debian/control*: update VCS informations
- 92bfb4c... by Jeremy Bícha
-
New upstream version 3.26.3.1
- 513a3c8... by Display Name
-
release: Prepare for 3.26.3.1
Preview Diff
1 | diff --git a/NEWS b/NEWS |
2 | index 94f1bf4..c78d1d1 100644 |
3 | --- a/NEWS |
4 | +++ b/NEWS |
5 | @@ -1,3 +1,6 @@ |
6 | +Major changes in 3.26.3.1: |
7 | +* Revert accidental backports of behavioral and visual changes |
8 | + |
9 | Major changes in 3.26.3: |
10 | * Don’t strip extension from folders in compress dialog (Rahul Verma) |
11 | * Fix items not being focused when selected in list view (António Fernandes) |
12 | diff --git a/debian/changelog b/debian/changelog |
13 | index 30d5e5b..0ef6111 100644 |
14 | --- a/debian/changelog |
15 | +++ b/debian/changelog |
16 | @@ -1,3 +1,27 @@ |
17 | +nautilus (1:3.26.3.1-0~ubuntu18.04.1) UNRELEASED; urgency=medium |
18 | + |
19 | + [ Sebastien Bacher ] |
20 | + * debian/patches/git_middle_tab.patch: |
21 | + - don't close the view when middle clicking on an item in the |
22 | + "other locations" (lp: #1765776) |
23 | + |
24 | + [ Marco Trevisan (Treviño) ] |
25 | + * New upstream release: 3.26.3.1 |
26 | + * debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch, |
27 | + debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch, |
28 | + debian/patches/0018-search-engine-add-locate-based-search-engine.patch: |
29 | + - Follow nautilus settings to search only in current folder (LP: #1767027). |
30 | + This doesn't apply to gnome-shell search provider for indexed searches. |
31 | + * debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch: |
32 | + - Updated to respect upstream requested changes |
33 | + * debian/patches/nautilusgtkplacesview-show-error-if-volume-is-not-mounted.patch: |
34 | + - don't crash if selecting a volume that is not mounted (LP: #1764779) |
35 | + * debian/patches/Revert-Revert-files-view-Remove-new-empty-folder-name-sug.patch, |
36 | + debian/patches/Revert-Revert-nautilus-file-Don-t-show-thumbnails-for-the.patch: |
37 | + - Reverts the reverts introduced in 2.26.3.1 as they are in ubuntu already |
38 | + |
39 | + -- Sebastien Bacher <seb128@ubuntu.com> Mon, 30 Apr 2018 16:12:53 +0200 |
40 | + |
41 | nautilus (1:3.26.3-0ubuntu4) bionic; urgency=medium |
42 | |
43 | * debian/patches/server_list_segfault.patch, |
44 | diff --git a/debian/control.in b/debian/control.in |
45 | index 0d5ed26..19b2ec4 100644 |
46 | --- a/debian/control.in |
47 | +++ b/debian/control.in |
48 | @@ -33,7 +33,10 @@ Build-Depends: debhelper (>= 10.3), |
49 | libunity-dev (>= 5.0.0), |
50 | libzeitgeist-2.0-dev, |
51 | Homepage: https://wiki.gnome.org/action/show/Apps/Nautilus |
52 | -Vcs-Bzr: http://code.launchpad.net/~ubuntu-desktop/nautilus/ubuntu |
53 | +XS-Debian-Vcs-Browser: https://salsa.debian.org/gnome-team/nautilus |
54 | +XS-Debian-Vcs-Git: https://salsa.debian.org/gnome-team/nautilus.git |
55 | +Vcs-Browser: https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/nautilus |
56 | +Vcs-Git: https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/nautilus -b ubuntu/bionic |
57 | Standards-Version: 3.9.8 |
58 | |
59 | Package: nautilus |
60 | diff --git a/debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch b/debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch |
61 | index 1a4ee1c..0ec13f1 100644 |
62 | --- a/debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch |
63 | +++ b/debian/patches/0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch |
64 | @@ -7,19 +7,19 @@ Using GtkRecent items as search engine source in nautilus |
65 | --- |
66 | src/meson.build | 2 + |
67 | src/nautilus-file.h | 1 + |
68 | - src/nautilus-search-engine-recent.c | 385 ++++++++++++++++++++++++++++++++++++ |
69 | - src/nautilus-search-engine-recent.h | 36 ++++ |
70 | - src/nautilus-search-engine.c | 11 ++ |
71 | - 5 files changed, 435 insertions(+) |
72 | + src/nautilus-search-engine-recent.c | 427 ++++++++++++++++++++++++++++++++++++ |
73 | + src/nautilus-search-engine-recent.h | 36 +++ |
74 | + src/nautilus-search-engine.c | 11 + |
75 | + 5 files changed, 477 insertions(+) |
76 | create mode 100644 src/nautilus-search-engine-recent.c |
77 | create mode 100644 src/nautilus-search-engine-recent.h |
78 | |
79 | diff --git a/src/meson.build b/src/meson.build |
80 | -index a771d12..0ea9165 100644 |
81 | +index 73aafe9..213b35f 100644 |
82 | --- a/src/meson.build |
83 | +++ b/src/meson.build |
84 | -@@ -228,6 +228,8 @@ libnautilus_sources = [ |
85 | - 'nautilus-search-engine.h', |
86 | +@@ -229,6 +229,8 @@ libnautilus_sources = [ |
87 | + 'nautilus-search-engine-private.h', |
88 | 'nautilus-search-engine-model.c', |
89 | 'nautilus-search-engine-model.h', |
90 | + 'nautilus-search-engine-recent.c', |
91 | @@ -28,7 +28,7 @@ index a771d12..0ea9165 100644 |
92 | 'nautilus-search-engine-simple.h', |
93 | 'nautilus-search-hit.c', |
94 | diff --git a/src/nautilus-file.h b/src/nautilus-file.h |
95 | -index 3a83bd4..fd72d7a 100644 |
96 | +index af8c003..20ec6f3 100644 |
97 | --- a/src/nautilus-file.h |
98 | +++ b/src/nautilus-file.h |
99 | @@ -49,6 +49,7 @@ typedef struct NautilusFile NautilusFile; |
100 | @@ -41,10 +41,10 @@ index 3a83bd4..fd72d7a 100644 |
101 | NAUTILUS_FILE_SORT_NONE, |
102 | diff --git a/src/nautilus-search-engine-recent.c b/src/nautilus-search-engine-recent.c |
103 | new file mode 100644 |
104 | -index 0000000..f052e8f |
105 | +index 0000000..bbd0d82 |
106 | --- /dev/null |
107 | +++ b/src/nautilus-search-engine-recent.c |
108 | -@@ -0,0 +1,385 @@ |
109 | +@@ -0,0 +1,427 @@ |
110 | +/* |
111 | + * Copyright (C) 2018 Canonical Ltd |
112 | + * |
113 | @@ -69,6 +69,7 @@ index 0000000..f052e8f |
114 | +#include "nautilus-search-hit.h" |
115 | +#include "nautilus-search-provider.h" |
116 | +#include "nautilus-search-engine-recent.h" |
117 | ++#include "nautilus-search-engine-private.h" |
118 | +#include "nautilus-ui-utilities.h" |
119 | +#define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH |
120 | +#include "nautilus-debug.h" |
121 | @@ -161,6 +162,51 @@ index 0000000..f052e8f |
122 | + return FALSE; |
123 | +} |
124 | + |
125 | ++static gboolean |
126 | ++is_file_valid_recursive (NautilusSearchEngineRecent *self, |
127 | ++ GFile *file, |
128 | ++ GError **error) |
129 | ++{ |
130 | ++ g_autofree gchar *path = NULL; |
131 | ++ g_autoptr (GFileInfo) file_info = NULL; |
132 | ++ |
133 | ++ file_info = g_file_query_info (file, FILE_ATTRIBS, |
134 | ++ G_FILE_QUERY_INFO_NONE, |
135 | ++ self->cancellable, error); |
136 | ++ if (*error != NULL) |
137 | ++ { |
138 | ++ return FALSE; |
139 | ++ } |
140 | ++ |
141 | ++ if (!g_file_info_get_attribute_boolean (file_info, |
142 | ++ G_FILE_ATTRIBUTE_ACCESS_CAN_READ)) |
143 | ++ { |
144 | ++ return FALSE; |
145 | ++ } |
146 | ++ |
147 | ++ path = g_file_get_path (file); |
148 | ++ |
149 | ++ if (!nautilus_query_get_show_hidden_files (self->query)) |
150 | ++ { |
151 | ++ if (!g_file_info_get_is_hidden (file_info) && |
152 | ++ !g_file_info_get_is_backup (file_info)) |
153 | ++ { |
154 | ++ g_autoptr (GFile) parent = g_file_get_parent (file); |
155 | ++ |
156 | ++ if (parent) |
157 | ++ { |
158 | ++ return is_file_valid_recursive (self, parent, error); |
159 | ++ } |
160 | ++ } |
161 | ++ else |
162 | ++ { |
163 | ++ return FALSE; |
164 | ++ } |
165 | ++ } |
166 | ++ |
167 | ++ return TRUE; |
168 | ++} |
169 | ++ |
170 | +static gpointer |
171 | +recent_thread_func (gpointer user_data) |
172 | +{ |
173 | @@ -199,44 +245,24 @@ index 0000000..f052e8f |
174 | + |
175 | + if (gtk_recent_info_is_local (info)) |
176 | + { |
177 | -+ g_autofree gchar *path = NULL; |
178 | -+ g_autoptr (GFileInfo) file_info = NULL; |
179 | + g_autoptr (GError) error = NULL; |
180 | + |
181 | -+ file_info = g_file_query_info (file, FILE_ATTRIBS, |
182 | -+ G_FILE_QUERY_INFO_NONE, |
183 | -+ self->cancellable, &error); |
184 | -+ if (error != NULL) |
185 | ++ if (!is_file_valid_recursive (self, file, &error)) |
186 | + { |
187 | + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) |
188 | + { |
189 | + break; |
190 | + } |
191 | + |
192 | -+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS)) |
193 | ++ if (error != NULL && |
194 | ++ !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS)) |
195 | + { |
196 | -+ g_debug("Impossible to read locate file info: %s", |
197 | ++ g_debug("Impossible to read recent file info: %s", |
198 | + error->message); |
199 | + } |
200 | + |
201 | + continue; |
202 | + } |
203 | -+ |
204 | -+ if (!g_file_info_get_attribute_boolean (file_info, |
205 | -+ G_FILE_ATTRIBUTE_ACCESS_CAN_READ)) |
206 | -+ { |
207 | -+ continue; |
208 | -+ } |
209 | -+ |
210 | -+ path = g_file_get_path (file); |
211 | -+ |
212 | -+ if (!nautilus_query_get_show_hidden_files (self->query) && |
213 | -+ (g_file_info_get_is_hidden (file_info) || |
214 | -+ g_file_info_get_is_backup (file_info) || |
215 | -+ g_strrstr (path, G_DIR_SEPARATOR_S ".") != NULL)) |
216 | -+ { |
217 | -+ continue; |
218 | -+ } |
219 | + } |
220 | + |
221 | + if (g_cancellable_is_cancelled (self->cancellable)) |
222 | @@ -333,6 +359,7 @@ index 0000000..f052e8f |
223 | +nautilus_search_engine_recent_start (NautilusSearchProvider *provider) |
224 | +{ |
225 | + NautilusSearchEngineRecent *self = NAUTILUS_SEARCH_ENGINE_RECENT (provider); |
226 | ++ g_autoptr (GFile) location = NULL; |
227 | + GThread *thread; |
228 | + |
229 | + g_return_if_fail (self->query); |
230 | @@ -340,6 +367,21 @@ index 0000000..f052e8f |
231 | + |
232 | + g_object_ref (self); |
233 | + g_object_ref (self->query); |
234 | ++ |
235 | ++ location = nautilus_query_get_location (self->query); |
236 | ++ |
237 | ++ if (!is_recursive_search (NAUTILUS_SEARCH_ENGINE_TYPE_INDEXED, |
238 | ++ nautilus_query_get_recursive (self->query), |
239 | ++ location)) |
240 | ++ { |
241 | ++ SearchHitsData *search_hits; |
242 | ++ search_hits = g_new0 (SearchHitsData, 1); |
243 | ++ search_hits->recent = self; |
244 | ++ |
245 | ++ g_idle_add (search_thread_add_hits_idle, search_hits); |
246 | ++ return; |
247 | ++ } |
248 | ++ |
249 | + self->cancellable = g_cancellable_new (); |
250 | + |
251 | + thread = g_thread_new ("nautilus-search-recent", recent_thread_func, self); |
252 | @@ -473,18 +515,18 @@ index 0000000..bcd73b9 |
253 | + |
254 | +#endif /* __NAUTILUS_SEARCH_ENGINE_RECENT_H__ */ |
255 | diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c |
256 | -index 209bd4f..aef91b7 100644 |
257 | +index a545160..68b6a4d 100644 |
258 | --- a/src/nautilus-search-engine.c |
259 | +++ b/src/nautilus-search-engine.c |
260 | -@@ -24,6 +24,7 @@ |
261 | - #include <glib/gi18n.h> |
262 | - #include "nautilus-search-provider.h" |
263 | +@@ -21,6 +21,7 @@ |
264 | + |
265 | + #include <config.h> |
266 | #include "nautilus-search-engine.h" |
267 | +#include "nautilus-search-engine-recent.h" |
268 | #include "nautilus-search-engine-simple.h" |
269 | - #include "nautilus-search-engine-model.h" |
270 | - #define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH |
271 | -@@ -33,6 +34,7 @@ |
272 | + #include "nautilus-search-engine-private.h" |
273 | + |
274 | +@@ -35,6 +36,7 @@ |
275 | typedef struct |
276 | { |
277 | NautilusSearchEngineTracker *tracker; |
278 | @@ -492,7 +534,7 @@ index 209bd4f..aef91b7 100644 |
279 | NautilusSearchEngineSimple *simple; |
280 | NautilusSearchEngineModel *model; |
281 | |
282 | -@@ -74,6 +76,7 @@ nautilus_search_engine_set_query (NautilusSearchProvider *provider, |
283 | +@@ -76,6 +78,7 @@ nautilus_search_engine_set_query (NautilusSearchProvider *provider, |
284 | priv = nautilus_search_engine_get_instance_private (engine); |
285 | |
286 | nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->tracker), query); |
287 | @@ -500,7 +542,7 @@ index 209bd4f..aef91b7 100644 |
288 | nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->model), query); |
289 | nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->simple), query); |
290 | } |
291 | -@@ -98,6 +101,9 @@ search_engine_start_real (NautilusSearchEngine *engine) |
292 | +@@ -100,6 +103,9 @@ search_engine_start_real (NautilusSearchEngine *engine) |
293 | nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->tracker)); |
294 | priv->providers_running++; |
295 | |
296 | @@ -510,7 +552,7 @@ index 209bd4f..aef91b7 100644 |
297 | if (nautilus_search_engine_model_get_model (priv->model)) |
298 | { |
299 | nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->model)); |
300 | -@@ -159,6 +165,7 @@ nautilus_search_engine_stop (NautilusSearchProvider *provider) |
301 | +@@ -161,6 +167,7 @@ nautilus_search_engine_stop (NautilusSearchProvider *provider) |
302 | DEBUG ("Search engine stop"); |
303 | |
304 | nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->tracker)); |
305 | @@ -518,7 +560,7 @@ index 209bd4f..aef91b7 100644 |
306 | nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->model)); |
307 | nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->simple)); |
308 | |
309 | -@@ -334,6 +341,7 @@ nautilus_search_engine_finalize (GObject *object) |
310 | +@@ -336,6 +343,7 @@ nautilus_search_engine_finalize (GObject *object) |
311 | g_hash_table_destroy (priv->uris); |
312 | |
313 | g_clear_object (&priv->tracker); |
314 | @@ -526,7 +568,7 @@ index 209bd4f..aef91b7 100644 |
315 | g_clear_object (&priv->model); |
316 | g_clear_object (&priv->simple); |
317 | |
318 | -@@ -395,6 +403,9 @@ nautilus_search_engine_init (NautilusSearchEngine *engine) |
319 | +@@ -397,6 +405,9 @@ nautilus_search_engine_init (NautilusSearchEngine *engine) |
320 | |
321 | priv->simple = nautilus_search_engine_simple_new (); |
322 | connect_provider_signals (engine, NAUTILUS_SEARCH_PROVIDER (priv->simple)); |
323 | diff --git a/debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch b/debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch |
324 | index 99abe37..d0125f5 100644 |
325 | --- a/debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch |
326 | +++ b/debian/patches/0017-recent-add-function-to-update-manager-on-file-rename.patch |
327 | @@ -1,5 +1,5 @@ |
328 | From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net> |
329 | -Date: Wed, 11 Apr 2018 18:51:34 -0400 |
330 | +Date: Thu, 12 Apr 2018 00:51:34 +0200 |
331 | Subject: recent: add function to update manager on file rename or move |
332 | |
333 | When files have been moved or renamed nautilus should inform |
334 | @@ -7,10 +7,10 @@ recent manager about this change for the files that |
335 | are listed there. |
336 | --- |
337 | src/nautilus-directory.c | 8 +++ |
338 | - src/nautilus-file.c | 25 +++++----- |
339 | - src/nautilus-recent.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++ |
340 | + src/nautilus-file.c | 25 +++++---- |
341 | + src/nautilus-recent.c | 132 +++++++++++++++++++++++++++++++++++++++++++++++ |
342 | src/nautilus-recent.h | 8 ++- |
343 | - 4 files changed, 152 insertions(+), 15 deletions(-) |
344 | + 4 files changed, 158 insertions(+), 15 deletions(-) |
345 | |
346 | diff --git a/src/nautilus-directory.c b/src/nautilus-directory.c |
347 | index ad3bb03..f1a3bf8 100644 |
348 | @@ -49,7 +49,7 @@ index ad3bb03..f1a3bf8 100644 |
349 | |
350 | /* Now send out the changed and added signals for existing file objects. */ |
351 | diff --git a/src/nautilus-file.c b/src/nautilus-file.c |
352 | -index 2135801..15e5d05 100644 |
353 | +index e862c13..21846d0 100644 |
354 | --- a/src/nautilus-file.c |
355 | +++ b/src/nautilus-file.c |
356 | @@ -34,6 +34,7 @@ |
357 | @@ -128,17 +128,18 @@ index 2135801..15e5d05 100644 |
358 | |
359 | static void |
360 | diff --git a/src/nautilus-recent.c b/src/nautilus-recent.c |
361 | -index ab50fef..c69a3a7 100644 |
362 | +index ab50fef..6676465 100644 |
363 | --- a/src/nautilus-recent.c |
364 | +++ b/src/nautilus-recent.c |
365 | -@@ -1,5 +1,6 @@ |
366 | +@@ -1,5 +1,7 @@ |
367 | /* |
368 | * Copyright (C) 2002 James Willcox |
369 | + * Copyright (C) 2018 Canonical Ltd |
370 | ++ * Copyright (C) 2018 Marco Trevisan |
371 | * |
372 | * This program is free software; you can redistribute it and/or modify |
373 | * it under the terms of the GNU General Public License as published by |
374 | -@@ -17,6 +18,7 @@ |
375 | +@@ -17,6 +19,7 @@ |
376 | |
377 | #include "config.h" |
378 | #include "nautilus-recent.h" |
379 | @@ -146,16 +147,16 @@ index ab50fef..c69a3a7 100644 |
380 | |
381 | #include <eel/eel-vfs-extensions.h> |
382 | |
383 | -@@ -85,3 +87,127 @@ nautilus_recent_add_file (NautilusFile *file, |
384 | +@@ -85,3 +88,132 @@ nautilus_recent_add_file (NautilusFile *file, |
385 | |
386 | g_free (uri); |
387 | } |
388 | + |
389 | +void |
390 | -+nautilus_recent_update_file_moved (const gchar *old_uri, |
391 | -+ const gchar *new_uri, |
392 | -+ const gchar *old_display_name, |
393 | -+ const gchar *new_display_name) |
394 | ++nautilus_recent_update_file_moved (const gchar *old_uri, |
395 | ++ const gchar *new_uri, |
396 | ++ const gchar *old_display_name, |
397 | ++ const gchar *new_display_name) |
398 | +{ |
399 | + GtkRecentManager *recent_manager = nautilus_recent_get_manager (); |
400 | + g_autoptr (NautilusFile) file = NULL; |
401 | @@ -191,9 +192,11 @@ index ab50fef..c69a3a7 100644 |
402 | + |
403 | + if (nautilus_file_is_directory (file)) |
404 | + { |
405 | ++ g_autoptr (GFile) location = NULL; |
406 | + GList *recent_items; |
407 | + GList *l; |
408 | + |
409 | ++ location = g_file_new_for_uri (old_uri); |
410 | + recent_items = gtk_recent_manager_get_items (recent_manager); |
411 | + |
412 | + for (l = recent_items; l; l = l->next) |
413 | @@ -203,9 +206,12 @@ index ab50fef..c69a3a7 100644 |
414 | + |
415 | + if (g_str_has_prefix (item_uri, old_uri)) |
416 | + { |
417 | -+ const gchar *relative_path = item_uri + strlen (old_uri); |
418 | ++ g_autoptr (GFile) item_file = NULL; |
419 | ++ g_autofree gchar *relative_path = NULL; |
420 | + g_autofree gchar *new_item_uri = NULL; |
421 | + |
422 | ++ item_file = g_file_new_for_uri (item_uri); |
423 | ++ relative_path = g_file_get_relative_path (location, item_file); |
424 | + new_item_uri = g_build_filename (new_uri, relative_path, NULL); |
425 | + |
426 | + gtk_recent_manager_move_item (recent_manager, |
427 | diff --git a/debian/patches/0018-search-engine-add-locate-based-search-engine.patch b/debian/patches/0018-search-engine-add-locate-based-search-engine.patch |
428 | index 5140963..c0d37b9 100644 |
429 | --- a/debian/patches/0018-search-engine-add-locate-based-search-engine.patch |
430 | +++ b/debian/patches/0018-search-engine-add-locate-based-search-engine.patch |
431 | @@ -7,19 +7,19 @@ command line and parsing output to provide more and |
432 | quicker results to the shell and nautilus |
433 | --- |
434 | src/meson.build | 2 + |
435 | - src/nautilus-search-engine-locate.c | 597 ++++++++++++++++++++++++++++++++++++ |
436 | + src/nautilus-search-engine-locate.c | 601 ++++++++++++++++++++++++++++++++++++ |
437 | src/nautilus-search-engine-locate.h | 37 +++ |
438 | src/nautilus-search-engine.c | 11 + |
439 | - 4 files changed, 647 insertions(+) |
440 | + 4 files changed, 651 insertions(+) |
441 | create mode 100644 src/nautilus-search-engine-locate.c |
442 | create mode 100644 src/nautilus-search-engine-locate.h |
443 | |
444 | diff --git a/src/meson.build b/src/meson.build |
445 | -index 0ea9165..06e6633 100644 |
446 | +index 213b35f..a0bf109 100644 |
447 | --- a/src/meson.build |
448 | +++ b/src/meson.build |
449 | -@@ -228,6 +228,8 @@ libnautilus_sources = [ |
450 | - 'nautilus-search-engine.h', |
451 | +@@ -229,6 +229,8 @@ libnautilus_sources = [ |
452 | + 'nautilus-search-engine-private.h', |
453 | 'nautilus-search-engine-model.c', |
454 | 'nautilus-search-engine-model.h', |
455 | + 'nautilus-search-engine-locate.c', |
456 | @@ -29,10 +29,10 @@ index 0ea9165..06e6633 100644 |
457 | 'nautilus-search-engine-simple.c', |
458 | diff --git a/src/nautilus-search-engine-locate.c b/src/nautilus-search-engine-locate.c |
459 | new file mode 100644 |
460 | -index 0000000..16f9f21 |
461 | +index 0000000..d152a23 |
462 | --- /dev/null |
463 | +++ b/src/nautilus-search-engine-locate.c |
464 | -@@ -0,0 +1,597 @@ |
465 | +@@ -0,0 +1,601 @@ |
466 | +/* |
467 | + * Copyright (C) 2018 Canonical Ltd |
468 | + * |
469 | @@ -57,6 +57,7 @@ index 0000000..16f9f21 |
470 | +#include "nautilus-search-hit.h" |
471 | +#include "nautilus-search-provider.h" |
472 | +#include "nautilus-search-engine-locate.h" |
473 | ++#include "nautilus-search-engine-private.h" |
474 | +#include "nautilus-ui-utilities.h" |
475 | +#define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH |
476 | +#include "nautilus-debug.h" |
477 | @@ -452,7 +453,12 @@ index 0000000..16f9f21 |
478 | + sdata = g_new0 (LocateSearchData, 1); |
479 | + sdata->locate = g_object_ref (self); |
480 | + |
481 | -+ if (!(self->locate_features & LOCATE_INSTALLED)) |
482 | ++ query_location = nautilus_query_get_location (self->query); |
483 | ++ |
484 | ++ if (!(self->locate_features & LOCATE_INSTALLED) || |
485 | ++ !is_recursive_search (NAUTILUS_SEARCH_ENGINE_TYPE_INDEXED, |
486 | ++ nautilus_query_get_recursive (self->query), |
487 | ++ query_location)) |
488 | + { |
489 | + g_idle_add ((GSourceFunc) submit_results, sdata); |
490 | + return; |
491 | @@ -493,8 +499,6 @@ index 0000000..16f9f21 |
492 | + return; |
493 | + } |
494 | + |
495 | -+ query_location = nautilus_query_get_location (self->query); |
496 | -+ |
497 | + sdata->query = g_object_ref (self->query); |
498 | + sdata->date_range = nautilus_query_get_date_range (self->query); |
499 | + sdata->mime_types = nautilus_query_get_mime_types (self->query); |
500 | @@ -674,18 +678,18 @@ index 0000000..ac5e3fc |
501 | + |
502 | +#endif /* __NAUTILUS_SEARCH_ENGINE_LOCATE_H__ */ |
503 | diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c |
504 | -index aef91b7..bf0e85d 100644 |
505 | +index 68b6a4d..84a88fa 100644 |
506 | --- a/src/nautilus-search-engine.c |
507 | +++ b/src/nautilus-search-engine.c |
508 | -@@ -25,6 +25,7 @@ |
509 | - #include "nautilus-search-provider.h" |
510 | +@@ -22,6 +22,7 @@ |
511 | + #include <config.h> |
512 | #include "nautilus-search-engine.h" |
513 | #include "nautilus-search-engine-recent.h" |
514 | +#include "nautilus-search-engine-locate.h" |
515 | #include "nautilus-search-engine-simple.h" |
516 | - #include "nautilus-search-engine-model.h" |
517 | - #define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH |
518 | -@@ -35,6 +36,7 @@ typedef struct |
519 | + #include "nautilus-search-engine-private.h" |
520 | + |
521 | +@@ -37,6 +38,7 @@ typedef struct |
522 | { |
523 | NautilusSearchEngineTracker *tracker; |
524 | NautilusSearchEngineRecent *recent; |
525 | @@ -693,7 +697,7 @@ index aef91b7..bf0e85d 100644 |
526 | NautilusSearchEngineSimple *simple; |
527 | NautilusSearchEngineModel *model; |
528 | |
529 | -@@ -77,6 +79,7 @@ nautilus_search_engine_set_query (NautilusSearchProvider *provider, |
530 | +@@ -79,6 +81,7 @@ nautilus_search_engine_set_query (NautilusSearchProvider *provider, |
531 | |
532 | nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->tracker), query); |
533 | nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->recent), query); |
534 | @@ -701,7 +705,7 @@ index aef91b7..bf0e85d 100644 |
535 | nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->model), query); |
536 | nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (priv->simple), query); |
537 | } |
538 | -@@ -104,6 +107,9 @@ search_engine_start_real (NautilusSearchEngine *engine) |
539 | +@@ -106,6 +109,9 @@ search_engine_start_real (NautilusSearchEngine *engine) |
540 | priv->providers_running++; |
541 | nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->recent)); |
542 | |
543 | @@ -711,7 +715,7 @@ index aef91b7..bf0e85d 100644 |
544 | if (nautilus_search_engine_model_get_model (priv->model)) |
545 | { |
546 | nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (priv->model)); |
547 | -@@ -166,6 +172,7 @@ nautilus_search_engine_stop (NautilusSearchProvider *provider) |
548 | +@@ -168,6 +174,7 @@ nautilus_search_engine_stop (NautilusSearchProvider *provider) |
549 | |
550 | nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->tracker)); |
551 | nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->recent)); |
552 | @@ -719,7 +723,7 @@ index aef91b7..bf0e85d 100644 |
553 | nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->model)); |
554 | nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (priv->simple)); |
555 | |
556 | -@@ -342,6 +349,7 @@ nautilus_search_engine_finalize (GObject *object) |
557 | +@@ -344,6 +351,7 @@ nautilus_search_engine_finalize (GObject *object) |
558 | |
559 | g_clear_object (&priv->tracker); |
560 | g_clear_object (&priv->recent); |
561 | @@ -727,7 +731,7 @@ index aef91b7..bf0e85d 100644 |
562 | g_clear_object (&priv->model); |
563 | g_clear_object (&priv->simple); |
564 | |
565 | -@@ -406,6 +414,9 @@ nautilus_search_engine_init (NautilusSearchEngine *engine) |
566 | +@@ -408,6 +416,9 @@ nautilus_search_engine_init (NautilusSearchEngine *engine) |
567 | |
568 | priv->recent = nautilus_search_engine_recent_new (); |
569 | connect_provider_signals (engine, NAUTILUS_SEARCH_PROVIDER (priv->recent)); |
570 | diff --git a/debian/patches/Revert-Revert-files-view-Remove-new-empty-folder-name-sug.patch b/debian/patches/Revert-Revert-files-view-Remove-new-empty-folder-name-sug.patch |
571 | new file mode 100644 |
572 | index 0000000..46660e5 |
573 | --- /dev/null |
574 | +++ b/debian/patches/Revert-Revert-files-view-Remove-new-empty-folder-name-sug.patch |
575 | @@ -0,0 +1,53 @@ |
576 | +From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net> |
577 | +Date: Wed, 18 Jul 2018 18:46:28 +0200 |
578 | +Subject: Revert "Revert "files-view: Remove new empty folder name |
579 | + suggestion"" |
580 | + |
581 | +This reverts commit 945c32dec747855047aa9b380d53588c5fcfb57a. |
582 | + |
583 | +This feature was already provided in Ubuntu, so would be a regression if we drop it |
584 | +--- |
585 | + src/nautilus-files-view.c | 15 ++++++++------- |
586 | + 1 file changed, 8 insertions(+), 7 deletions(-) |
587 | + |
588 | +diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c |
589 | +index 46a11bd..f916b05 100644 |
590 | +--- a/src/nautilus-files-view.c |
591 | ++++ b/src/nautilus-files-view.c |
592 | +@@ -2077,9 +2077,8 @@ static void |
593 | + nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, |
594 | + gboolean with_selection) |
595 | + { |
596 | +- NautilusDirectory *containing_directory; |
597 | ++ g_autoptr (NautilusDirectory) containing_directory = NULL; |
598 | + NautilusFilesViewPrivate *priv; |
599 | +- GList *selection; |
600 | + g_autofree char *uri = NULL; |
601 | + g_autofree char *common_prefix = NULL; |
602 | + |
603 | +@@ -2093,8 +2092,13 @@ nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, |
604 | + uri = nautilus_files_view_get_backing_uri (view); |
605 | + containing_directory = nautilus_directory_get_by_uri (uri); |
606 | + |
607 | +- selection = nautilus_view_get_selection (NAUTILUS_VIEW (view)); |
608 | +- common_prefix = nautilus_get_common_filename_prefix (selection, MIN_COMMON_FILENAME_PREFIX_LENGTH); |
609 | ++ if (with_selection) |
610 | ++ { |
611 | ++ GList *selection; |
612 | ++ selection = nautilus_view_get_selection (NAUTILUS_VIEW (view)); |
613 | ++ common_prefix = nautilus_get_common_filename_prefix (selection, MIN_COMMON_FILENAME_PREFIX_LENGTH); |
614 | ++ nautilus_file_list_free (selection); |
615 | ++ } |
616 | + |
617 | + priv->new_folder_controller = |
618 | + nautilus_new_folder_dialog_controller_new (nautilus_files_view_get_containing_window (view), |
619 | +@@ -2110,9 +2114,6 @@ nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, |
620 | + "cancelled", |
621 | + (GCallback) new_folder_dialog_controller_on_cancelled, |
622 | + view); |
623 | +- |
624 | +- nautilus_file_list_free (selection); |
625 | +- nautilus_directory_unref (containing_directory); |
626 | + } |
627 | + |
628 | + typedef struct |
629 | diff --git a/debian/patches/Revert-Revert-nautilus-file-Don-t-show-thumbnails-for-the.patch b/debian/patches/Revert-Revert-nautilus-file-Don-t-show-thumbnails-for-the.patch |
630 | new file mode 100644 |
631 | index 0000000..90cbfe1 |
632 | --- /dev/null |
633 | +++ b/debian/patches/Revert-Revert-nautilus-file-Don-t-show-thumbnails-for-the.patch |
634 | @@ -0,0 +1,25 @@ |
635 | +From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net> |
636 | +Date: Wed, 18 Jul 2018 18:46:16 +0200 |
637 | +Subject: Revert "Revert "nautilus-file: Don't show thumbnails for the first 2 |
638 | + zoom levels"" |
639 | + |
640 | +This reverts commit d62c0899f34665bdc4752ce8b6844328889f4638. |
641 | + |
642 | +This feature was already provided in Ubuntu, so would be a regression if we drop it |
643 | +--- |
644 | + src/nautilus-file.c | 2 +- |
645 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
646 | + |
647 | +diff --git a/src/nautilus-file.c b/src/nautilus-file.c |
648 | +index 21846d0..ede9c46 100644 |
649 | +--- a/src/nautilus-file.c |
650 | ++++ b/src/nautilus-file.c |
651 | +@@ -5554,7 +5554,7 @@ nautilus_thumbnail_is_limited_by_zoom (int size, |
652 | + |
653 | + zoom_level = size * scale; |
654 | + |
655 | +- if (zoom_level <= NAUTILUS_LIST_ICON_SIZE_SMALL) |
656 | ++ if (zoom_level <= NAUTILUS_LIST_ICON_SIZE_STANDARD) |
657 | + { |
658 | + return TRUE; |
659 | + } |
660 | diff --git a/debian/patches/git_middle_tab.patch b/debian/patches/git_middle_tab.patch |
661 | new file mode 100644 |
662 | index 0000000..28d7bce |
663 | --- /dev/null |
664 | +++ b/debian/patches/git_middle_tab.patch |
665 | @@ -0,0 +1,78 @@ |
666 | +Subject: [PATCH] notebook: Fix tab lookup by coordinates |
667 | + |
668 | +The current code only checks one coordinate, depending on the tab |
669 | +orientation. |
670 | + |
671 | +Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/342 |
672 | + |
673 | + |
674 | +(cherry picked from commit 7ca2197ae3f0df527e27cf58188b1f83216e3cdb) |
675 | +--- |
676 | + src/nautilus-notebook.c | 22 ++++++++-------------- |
677 | + 1 file changed, 8 insertions(+), 14 deletions(-) |
678 | + |
679 | +diff --git a/src/nautilus-notebook.c b/src/nautilus-notebook.c |
680 | +index f2b3fbd..6e1db52 100644 |
681 | +--- a/src/nautilus-notebook.c |
682 | ++++ b/src/nautilus-notebook.c |
683 | +@@ -88,14 +88,11 @@ find_tab_num_at_pos (NautilusNotebook *notebook, |
684 | + gint abs_x, |
685 | + gint abs_y) |
686 | + { |
687 | +- GtkPositionType tab_pos; |
688 | + int page_num = 0; |
689 | + GtkNotebook *nb = GTK_NOTEBOOK (notebook); |
690 | + GtkWidget *page; |
691 | + GtkAllocation allocation; |
692 | + |
693 | +- tab_pos = gtk_notebook_get_tab_pos (GTK_NOTEBOOK (notebook)); |
694 | +- |
695 | + while ((page = gtk_notebook_get_nth_page (nb, page_num))) |
696 | + { |
697 | + GtkWidget *tab; |
698 | +@@ -118,15 +115,7 @@ find_tab_num_at_pos (NautilusNotebook *notebook, |
699 | + max_x = x_root + allocation.x + allocation.width; |
700 | + max_y = y_root + allocation.y + allocation.height; |
701 | + |
702 | +- if (((tab_pos == GTK_POS_TOP) |
703 | +- || (tab_pos == GTK_POS_BOTTOM)) |
704 | +- && (abs_x <= max_x)) |
705 | +- { |
706 | +- return page_num; |
707 | +- } |
708 | +- else if (((tab_pos == GTK_POS_LEFT) |
709 | +- || (tab_pos == GTK_POS_RIGHT)) |
710 | +- && (abs_y <= max_y)) |
711 | ++ if (abs_x <= max_x && abs_y <= max_y) |
712 | + { |
713 | + return page_num; |
714 | + } |
715 | +@@ -154,7 +143,7 @@ button_press_cb (NautilusNotebook *notebook, |
716 | + /* consume event, so that we don't pop up the context menu when |
717 | + * the mouse if not over a tab label |
718 | + */ |
719 | +- return TRUE; |
720 | ++ return GDK_EVENT_STOP; |
721 | + } |
722 | + |
723 | + /* switch to the page the mouse is over, but don't consume the event */ |
724 | +@@ -165,11 +154,16 @@ button_press_cb (NautilusNotebook *notebook, |
725 | + { |
726 | + GtkWidget *slot; |
727 | + |
728 | ++ if (tab_clicked == -1) |
729 | ++ { |
730 | ++ return GDK_EVENT_PROPAGATE; |
731 | ++ } |
732 | ++ |
733 | + slot = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), tab_clicked); |
734 | + g_signal_emit (notebook, signals[TAB_CLOSE_REQUEST], 0, slot); |
735 | + } |
736 | + |
737 | +- return FALSE; |
738 | ++ return GDK_EVENT_PROPAGATE; |
739 | + } |
740 | + |
741 | + static void |
742 | +-- |
743 | + |
744 | diff --git a/debian/patches/nautilusgtkplacesview-show-error-if-volume-is-not-mounted.patch b/debian/patches/nautilusgtkplacesview-show-error-if-volume-is-not-mounted.patch |
745 | new file mode 100644 |
746 | index 0000000..37081f7 |
747 | --- /dev/null |
748 | +++ b/debian/patches/nautilusgtkplacesview-show-error-if-volume-is-not-mounted.patch |
749 | @@ -0,0 +1,45 @@ |
750 | +From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net> |
751 | +Date: Tue, 17 Jul 2018 04:23:58 +0200 |
752 | +Subject: nautilusgtkplacesview: show error if volume is not mounted |
753 | + |
754 | +Fixes crash as location would be NULL afterwards. |
755 | + |
756 | +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1764779 |
757 | +Forwarded: not-needed |
758 | +--- |
759 | + src/gtk/nautilusgtkplacesview.c | 20 +++++++++++++++----- |
760 | + 1 file changed, 15 insertions(+), 5 deletions(-) |
761 | + |
762 | +diff --git a/src/gtk/nautilusgtkplacesview.c b/src/gtk/nautilusgtkplacesview.c |
763 | +index 041849f..e13c313 100644 |
764 | +--- a/src/gtk/nautilusgtkplacesview.c |
765 | ++++ b/src/gtk/nautilusgtkplacesview.c |
766 | +@@ -1330,13 +1330,23 @@ volume_mount_ready_cb (GObject *source_volume, |
767 | + GFile *root; |
768 | + |
769 | + mount = g_volume_get_mount (volume); |
770 | +- root = g_mount_get_default_location (mount); |
771 | + |
772 | +- if (priv->should_open_location) |
773 | +- emit_open_location (NAUTILUS_GTK_PLACES_VIEW (user_data), root, priv->open_flags); |
774 | ++ if (G_IS_MOUNT (mount)) |
775 | ++ { |
776 | ++ root = g_mount_get_default_location (mount); |
777 | + |
778 | +- g_object_unref (mount); |
779 | +- g_object_unref (root); |
780 | ++ if (priv->should_open_location) |
781 | ++ emit_open_location (NAUTILUS_GTK_PLACES_VIEW (user_data), root, priv->open_flags); |
782 | ++ |
783 | ++ g_object_unref (mount); |
784 | ++ g_object_unref (root); |
785 | ++ } |
786 | ++ else |
787 | ++ { |
788 | ++ emit_show_error_message (NAUTILUS_GTK_PLACES_VIEW(user_data), |
789 | ++ _("Unable to access location"), |
790 | ++ _("volume not mounted")); |
791 | ++ } |
792 | + } |
793 | + |
794 | + update_places (view); |
795 | diff --git a/debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch b/debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch |
796 | new file mode 100644 |
797 | index 0000000..c1ee4a7 |
798 | --- /dev/null |
799 | +++ b/debian/patches/query-add-recursive-flags-and-use-it-in-search-engines.patch |
800 | @@ -0,0 +1,977 @@ |
801 | +From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net> |
802 | +Date: Tue, 17 Jul 2018 02:35:20 +0200 |
803 | +Subject: query: add recursive flags and use it in search-engines |
804 | + |
805 | +Forwarded: yes, https://gitlab.gnome.org/GNOME/nautilus/merge_requests/249 |
806 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1767027 |
807 | +--- |
808 | + src/meson.build | 1 + |
809 | + src/nautilus-application.c | 11 ++---- |
810 | + src/nautilus-application.h | 3 +- |
811 | + src/nautilus-directory-async.c | 5 ++- |
812 | + src/nautilus-file-private.h | 3 +- |
813 | + src/nautilus-file.c | 28 ++++++++++++++ |
814 | + src/nautilus-file.h | 2 + |
815 | + src/nautilus-query-editor.c | 61 +++++++++++++++++------------- |
816 | + src/nautilus-query.c | 28 +++++++------- |
817 | + src/nautilus-query.h | 14 +++++-- |
818 | + src/nautilus-search-directory.c | 6 --- |
819 | + src/nautilus-search-engine-private.h | 34 +++++++++++++++++ |
820 | + src/nautilus-search-engine-simple.c | 72 ++++++++---------------------------- |
821 | + src/nautilus-search-engine-tracker.c | 16 ++++---- |
822 | + src/nautilus-search-engine.c | 36 ++++++++++++++---- |
823 | + src/nautilus-search-engine.h | 2 - |
824 | + src/nautilus-shell-search-provider.c | 40 +++++++++++--------- |
825 | + src/nautilus-window-slot.c | 19 ++++------ |
826 | + src/nautilus-window-slot.h | 2 +- |
827 | + src/nautilus-window.c | 4 +- |
828 | + src/nautilus-window.h | 2 +- |
829 | + 21 files changed, 222 insertions(+), 167 deletions(-) |
830 | + create mode 100644 src/nautilus-search-engine-private.h |
831 | + |
832 | +diff --git a/src/meson.build b/src/meson.build |
833 | +index a771d12..73aafe9 100644 |
834 | +--- a/src/meson.build |
835 | ++++ b/src/meson.build |
836 | +@@ -226,6 +226,7 @@ libnautilus_sources = [ |
837 | + 'nautilus-search-provider.h', |
838 | + 'nautilus-search-engine.c', |
839 | + 'nautilus-search-engine.h', |
840 | ++ 'nautilus-search-engine-private.h', |
841 | + 'nautilus-search-engine-model.c', |
842 | + 'nautilus-search-engine-model.h', |
843 | + 'nautilus-search-engine-simple.c', |
844 | +diff --git a/src/nautilus-application.c b/src/nautilus-application.c |
845 | +index 6293a89..13753a5 100644 |
846 | +--- a/src/nautilus-application.c |
847 | ++++ b/src/nautilus-application.c |
848 | +@@ -1621,15 +1621,12 @@ nautilus_application_new (void) |
849 | + |
850 | + void |
851 | + nautilus_application_search (NautilusApplication *self, |
852 | +- const gchar *uri, |
853 | +- const gchar *text) |
854 | ++ NautilusQuery *query) |
855 | + { |
856 | ++ g_autoptr (GFile) location = NULL; |
857 | + NautilusWindow *window; |
858 | +- GFile *location; |
859 | + |
860 | +- location = g_file_new_for_uri (uri); |
861 | ++ location = nautilus_query_get_location (query); |
862 | + window = open_window (self, location); |
863 | +- nautilus_window_search (window, text); |
864 | +- |
865 | +- g_object_unref (location); |
866 | ++ nautilus_window_search (window, query); |
867 | + } |
868 | +diff --git a/src/nautilus-application.h b/src/nautilus-application.h |
869 | +index 9cb32c8..47adcc4 100644 |
870 | +--- a/src/nautilus-application.h |
871 | ++++ b/src/nautilus-application.h |
872 | +@@ -86,8 +86,7 @@ GtkWidget * nautilus_application_connect_server (NautilusApplication *applicatio |
873 | + NautilusWindow *window); |
874 | + |
875 | + void nautilus_application_search (NautilusApplication *application, |
876 | +- const gchar *uri, |
877 | +- const gchar *text); |
878 | ++ NautilusQuery *query); |
879 | + void nautilus_application_startup_common (NautilusApplication *application); |
880 | + |
881 | + void nautilus_application_update_dbus_opened_locations (NautilusApplication *app); |
882 | +diff --git a/src/nautilus-directory-async.c b/src/nautilus-directory-async.c |
883 | +index 05a87e3..b519e20 100644 |
884 | +--- a/src/nautilus-directory-async.c |
885 | ++++ b/src/nautilus-directory-async.c |
886 | +@@ -4383,6 +4383,8 @@ got_filesystem_info (FilesystemInfoState *state, |
887 | + file->details->filesystem_readonly = |
888 | + g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY); |
889 | + filesystem_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE); |
890 | ++ file->details->filesystem_remote = |
891 | ++ g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE); |
892 | + if (g_strcmp0 (eel_ref_str_peek (file->details->filesystem_type), filesystem_type) != 0) |
893 | + { |
894 | + eel_ref_str_unref (file->details->filesystem_type); |
895 | +@@ -4465,7 +4467,8 @@ filesystem_info_start (NautilusDirectory *directory, |
896 | + g_file_query_filesystem_info_async (location, |
897 | + G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "," |
898 | + G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "," |
899 | +- G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, |
900 | ++ G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "," |
901 | ++ G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, |
902 | + G_PRIORITY_DEFAULT, |
903 | + state->cancellable, |
904 | + query_filesystem_info_callback, |
905 | +diff --git a/src/nautilus-file-private.h b/src/nautilus-file-private.h |
906 | +index adcfacf..1566589 100644 |
907 | +--- a/src/nautilus-file-private.h |
908 | ++++ b/src/nautilus-file-private.h |
909 | +@@ -202,7 +202,8 @@ struct NautilusFileDetails |
910 | + eel_boolean_bit filesystem_readonly : 1; |
911 | + eel_boolean_bit filesystem_use_preview : 2; /* GFilesystemPreviewType */ |
912 | + eel_boolean_bit filesystem_info_is_up_to_date : 1; |
913 | +- eel_ref_str filesystem_type; |
914 | ++ eel_boolean_bit filesystem_remote : 1; |
915 | ++ eel_ref_str filesystem_type; |
916 | + |
917 | + time_t trash_time; /* 0 is unknown */ |
918 | + time_t recency; /* 0 is unknown */ |
919 | +diff --git a/src/nautilus-file.c b/src/nautilus-file.c |
920 | +index 2135801..6a28229 100644 |
921 | +--- a/src/nautilus-file.c |
922 | ++++ b/src/nautilus-file.c |
923 | +@@ -4960,6 +4960,29 @@ nautilus_file_get_filesystem_type (NautilusFile *file) |
924 | + return filesystem_type; |
925 | + } |
926 | + |
927 | ++gboolean |
928 | ++nautilus_file_get_filesystem_remote (NautilusFile *file) |
929 | ++{ |
930 | ++ NautilusFile *parent; |
931 | ++ |
932 | ++ g_assert (NAUTILUS_IS_FILE (file)); |
933 | ++ |
934 | ++ if (nautilus_file_is_directory (file)) |
935 | ++ { |
936 | ++ return file->details->filesystem_remote; |
937 | ++ } |
938 | ++ else |
939 | ++ { |
940 | ++ parent = nautilus_file_get_parent (file); |
941 | ++ if (parent != NULL) |
942 | ++ { |
943 | ++ return parent->details->filesystem_remote; |
944 | ++ } |
945 | ++ } |
946 | ++ |
947 | ++ return FALSE; |
948 | ++} |
949 | ++ |
950 | + gboolean |
951 | + nautilus_file_should_show_thumbnail (NautilusFile *file) |
952 | + { |
953 | +@@ -8361,6 +8384,11 @@ nautilus_file_is_remote (NautilusFile *file) |
954 | + |
955 | + g_assert (NAUTILUS_IS_FILE (file)); |
956 | + |
957 | ++ if (nautilus_file_get_filesystem_remote (file)) |
958 | ++ { |
959 | ++ return TRUE; |
960 | ++ } |
961 | ++ |
962 | + filesystem_type = nautilus_file_get_filesystem_type (file); |
963 | + |
964 | + return filesystem_type != NULL && g_strv_contains (remote_types, filesystem_type); |
965 | +diff --git a/src/nautilus-file.h b/src/nautilus-file.h |
966 | +index 3a83bd4..af8c003 100644 |
967 | +--- a/src/nautilus-file.h |
968 | ++++ b/src/nautilus-file.h |
969 | +@@ -251,6 +251,8 @@ char * nautilus_file_get_filesystem_id (Nautilu |
970 | + |
971 | + char * nautilus_file_get_filesystem_type (NautilusFile *file); |
972 | + |
973 | ++gboolean nautilus_file_get_filesystem_remote (NautilusFile *file); |
974 | ++ |
975 | + NautilusFile * nautilus_file_get_trash_original_file (NautilusFile *file); |
976 | + |
977 | + /* Permissions. */ |
978 | +diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c |
979 | +index 94b9c4d..f5260c9 100644 |
980 | +--- a/src/nautilus-query-editor.c |
981 | ++++ b/src/nautilus-query-editor.c |
982 | +@@ -80,33 +80,47 @@ static void nautilus_query_editor_changed (NautilusQueryEditor *editor); |
983 | + |
984 | + G_DEFINE_TYPE_WITH_PRIVATE (NautilusQueryEditor, nautilus_query_editor, GTK_TYPE_SEARCH_BAR); |
985 | + |
986 | +-static gboolean |
987 | +-settings_search_is_recursive (NautilusQueryEditor *editor) |
988 | ++static NautilusQueryRecursive |
989 | ++settings_search_get_recursive (void) |
990 | ++{ |
991 | ++ switch (g_settings_get_enum (nautilus_preferences, "recursive-search")) |
992 | ++ { |
993 | ++ case NAUTILUS_SPEED_TRADEOFF_ALWAYS: |
994 | ++ return NAUTILUS_QUERY_RECURSIVE_ALWAYS; |
995 | ++ case NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY: |
996 | ++ return NAUTILUS_QUERY_RECURSIVE_LOCAL_ONLY; |
997 | ++ case NAUTILUS_SPEED_TRADEOFF_NEVER: |
998 | ++ return NAUTILUS_QUERY_RECURSIVE_NEVER; |
999 | ++ } |
1000 | ++ |
1001 | ++ return NAUTILUS_QUERY_RECURSIVE_ALWAYS; |
1002 | ++} |
1003 | ++ |
1004 | ++static NautilusQueryRecursive |
1005 | ++settings_search_get_recursive_for_location (NautilusQueryEditor *editor) |
1006 | + { |
1007 | + NautilusQueryEditorPrivate *priv; |
1008 | +- NautilusFile *file; |
1009 | +- gboolean recursive; |
1010 | ++ NautilusQueryRecursive recursive; |
1011 | + |
1012 | + priv = nautilus_query_editor_get_instance_private (editor); |
1013 | ++ recursive = settings_search_get_recursive (); |
1014 | + |
1015 | +- if (!priv->location) |
1016 | ++ if (priv->location == NULL) |
1017 | + { |
1018 | +- return TRUE; |
1019 | ++ return recursive; |
1020 | + } |
1021 | + |
1022 | +- file = nautilus_file_get (priv->location); |
1023 | +- |
1024 | +- if (nautilus_file_is_remote (file)) |
1025 | ++ if (recursive == NAUTILUS_QUERY_RECURSIVE_LOCAL_ONLY) |
1026 | + { |
1027 | +- recursive = g_settings_get_enum (nautilus_preferences, "recursive-search") == NAUTILUS_SPEED_TRADEOFF_ALWAYS; |
1028 | +- } |
1029 | +- else |
1030 | +- { |
1031 | +- recursive = g_settings_get_enum (nautilus_preferences, "recursive-search") == NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY || |
1032 | +- g_settings_get_enum (nautilus_preferences, "recursive-search") == NAUTILUS_SPEED_TRADEOFF_ALWAYS; |
1033 | +- } |
1034 | ++ NautilusFile *file = nautilus_file_get (priv->location); |
1035 | + |
1036 | +- nautilus_file_unref (file); |
1037 | ++ if (nautilus_file_is_remote (file)) |
1038 | ++ { |
1039 | ++ recursive = NAUTILUS_QUERY_RECURSIVE_NEVER; |
1040 | ++ } |
1041 | ++ |
1042 | ++ nautilus_file_unref (file); |
1043 | ++ } |
1044 | + |
1045 | + return recursive; |
1046 | + } |
1047 | +@@ -144,12 +158,12 @@ update_information_label (NautilusQueryEditor *editor) |
1048 | + fts_sensitive = FALSE; |
1049 | + } |
1050 | + else if (nautilus_file_is_remote (file) && |
1051 | +- !settings_search_is_recursive (editor)) |
1052 | ++ settings_search_get_recursive_for_location (editor) == NAUTILUS_QUERY_RECURSIVE_NEVER) |
1053 | + { |
1054 | + label = _("Remote location — only searching the current folder"); |
1055 | + fts_sensitive = FALSE; |
1056 | + } |
1057 | +- else if (!settings_search_is_recursive (editor)) |
1058 | ++ else if (settings_search_get_recursive_for_location (editor) == NAUTILUS_QUERY_RECURSIVE_NEVER) |
1059 | + { |
1060 | + label = _("Only searching the current folder"); |
1061 | + } |
1062 | +@@ -171,7 +185,7 @@ recursive_search_preferences_changed (GSettings *settings, |
1063 | + NautilusQueryEditor *editor) |
1064 | + { |
1065 | + NautilusQueryEditorPrivate *priv; |
1066 | +- gboolean recursive; |
1067 | ++ NautilusQueryRecursive recursive; |
1068 | + |
1069 | + priv = nautilus_query_editor_get_instance_private (editor); |
1070 | + |
1071 | +@@ -180,7 +194,7 @@ recursive_search_preferences_changed (GSettings *settings, |
1072 | + return; |
1073 | + } |
1074 | + |
1075 | +- recursive = settings_search_is_recursive (editor); |
1076 | ++ recursive = settings_search_get_recursive (); |
1077 | + if (recursive != nautilus_query_get_recursive (priv->query)) |
1078 | + { |
1079 | + nautilus_query_set_recursive (priv->query, recursive); |
1080 | +@@ -382,7 +396,6 @@ create_query (NautilusQueryEditor *editor) |
1081 | + NautilusQueryEditorPrivate *priv; |
1082 | + NautilusQuery *query; |
1083 | + NautilusFile *file; |
1084 | +- gboolean recursive; |
1085 | + gboolean fts_enabled; |
1086 | + |
1087 | + priv = nautilus_query_editor_get_instance_private (editor); |
1088 | +@@ -396,11 +409,9 @@ create_query (NautilusQueryEditor *editor) |
1089 | + |
1090 | + nautilus_query_set_search_content (query, fts_enabled); |
1091 | + |
1092 | +- recursive = settings_search_is_recursive (editor); |
1093 | +- |
1094 | + nautilus_query_set_text (query, gtk_entry_get_text (GTK_ENTRY (priv->entry))); |
1095 | + nautilus_query_set_location (query, priv->location); |
1096 | +- nautilus_query_set_recursive (query, recursive); |
1097 | ++ nautilus_query_set_recursive (query, settings_search_get_recursive ()); |
1098 | + |
1099 | + nautilus_query_editor_set_query (editor, query); |
1100 | + |
1101 | +diff --git a/src/nautilus-query.c b/src/nautilus-query.c |
1102 | +index 59600d1..c3e4ef4 100644 |
1103 | +--- a/src/nautilus-query.c |
1104 | ++++ b/src/nautilus-query.c |
1105 | +@@ -44,11 +44,11 @@ struct _NautilusQuery |
1106 | + GList *mime_types; |
1107 | + gboolean show_hidden; |
1108 | + GPtrArray *date_range; |
1109 | ++ NautilusQueryRecursive recursive; |
1110 | + NautilusQuerySearchType search_type; |
1111 | + NautilusQuerySearchContent search_content; |
1112 | + |
1113 | + gboolean searching; |
1114 | +- gboolean recursive; |
1115 | + char **prepared_words; |
1116 | + GMutex prepared_words_mutex; |
1117 | + }; |
1118 | +@@ -118,7 +118,7 @@ nautilus_query_get_property (GObject *object, |
1119 | + |
1120 | + case PROP_RECURSIVE: |
1121 | + { |
1122 | +- g_value_set_boolean (value, self->recursive); |
1123 | ++ g_value_set_enum (value, self->recursive); |
1124 | + } |
1125 | + break; |
1126 | + |
1127 | +@@ -181,7 +181,7 @@ nautilus_query_set_property (GObject *object, |
1128 | + |
1129 | + case PROP_RECURSIVE: |
1130 | + { |
1131 | +- nautilus_query_set_recursive (self, g_value_get_boolean (value)); |
1132 | ++ nautilus_query_set_recursive (self, g_value_get_enum (value)); |
1133 | + } |
1134 | + break; |
1135 | + |
1136 | +@@ -272,11 +272,12 @@ nautilus_query_class_init (NautilusQueryClass *class) |
1137 | + */ |
1138 | + g_object_class_install_property (gobject_class, |
1139 | + PROP_RECURSIVE, |
1140 | +- g_param_spec_boolean ("recursive", |
1141 | +- "Whether the query is being performed on subdirectories", |
1142 | +- "Whether the query is being performed on subdirectories or not", |
1143 | +- FALSE, |
1144 | +- G_PARAM_READWRITE)); |
1145 | ++ g_param_spec_enum ("recursive", |
1146 | ++ "Whether the query is being performed on subdirectories", |
1147 | ++ "Whether the query is being performed on subdirectories or not", |
1148 | ++ NAUTILUS_TYPE_QUERY_RECURSIVE, |
1149 | ++ NAUTILUS_QUERY_RECURSIVE_ALWAYS, |
1150 | ++ G_PARAM_READWRITE)); |
1151 | + |
1152 | + /** |
1153 | + * NautilusQuery::search-type: |
1154 | +@@ -636,22 +637,21 @@ nautilus_query_set_searching (NautilusQuery *query, |
1155 | + } |
1156 | + } |
1157 | + |
1158 | +-gboolean |
1159 | ++NautilusQueryRecursive |
1160 | + nautilus_query_get_recursive (NautilusQuery *query) |
1161 | + { |
1162 | +- g_return_val_if_fail (NAUTILUS_IS_QUERY (query), FALSE); |
1163 | ++ g_return_val_if_fail (NAUTILUS_IS_QUERY (query), |
1164 | ++ NAUTILUS_QUERY_RECURSIVE_ALWAYS); |
1165 | + |
1166 | + return query->recursive; |
1167 | + } |
1168 | + |
1169 | + void |
1170 | +-nautilus_query_set_recursive (NautilusQuery *query, |
1171 | +- gboolean recursive) |
1172 | ++nautilus_query_set_recursive (NautilusQuery *query, |
1173 | ++ NautilusQueryRecursive recursive) |
1174 | + { |
1175 | + g_return_if_fail (NAUTILUS_IS_QUERY (query)); |
1176 | + |
1177 | +- recursive = !!recursive; |
1178 | +- |
1179 | + if (query->recursive != recursive) |
1180 | + { |
1181 | + query->recursive = recursive; |
1182 | +diff --git a/src/nautilus-query.h b/src/nautilus-query.h |
1183 | +index 2264f50..0e04061 100644 |
1184 | +--- a/src/nautilus-query.h |
1185 | ++++ b/src/nautilus-query.h |
1186 | +@@ -35,6 +35,13 @@ typedef enum { |
1187 | + NAUTILUS_QUERY_SEARCH_CONTENT_FULL_TEXT, |
1188 | + } NautilusQuerySearchContent; |
1189 | + |
1190 | ++typedef enum { |
1191 | ++ NAUTILUS_QUERY_RECURSIVE_NEVER, |
1192 | ++ NAUTILUS_QUERY_RECURSIVE_ALWAYS, |
1193 | ++ NAUTILUS_QUERY_RECURSIVE_LOCAL_ONLY, |
1194 | ++ NAUTILUS_QUERY_RECURSIVE_INDEXED_ONLY, |
1195 | ++} NautilusQueryRecursive; |
1196 | ++ |
1197 | + #define NAUTILUS_TYPE_QUERY (nautilus_query_get_type ()) |
1198 | + |
1199 | + G_DECLARE_FINAL_TYPE (NautilusQuery, nautilus_query, NAUTILUS, QUERY, GObject) |
1200 | +@@ -67,10 +74,9 @@ GPtrArray* nautilus_query_get_date_range (NautilusQuery *query); |
1201 | + void nautilus_query_set_date_range (NautilusQuery *query, |
1202 | + GPtrArray *date_range); |
1203 | + |
1204 | +-gboolean nautilus_query_get_recursive (NautilusQuery *query); |
1205 | +- |
1206 | +-void nautilus_query_set_recursive (NautilusQuery *query, |
1207 | +- gboolean recursive); |
1208 | ++NautilusQueryRecursive nautilus_query_get_recursive (NautilusQuery *query); |
1209 | ++void nautilus_query_set_recursive (NautilusQuery *query, |
1210 | ++ NautilusQueryRecursive recursive); |
1211 | + |
1212 | + gboolean nautilus_query_get_searching (NautilusQuery *query); |
1213 | + |
1214 | +diff --git a/src/nautilus-search-directory.c b/src/nautilus-search-directory.c |
1215 | +index ae710f3..d86fda2 100644 |
1216 | +--- a/src/nautilus-search-directory.c |
1217 | ++++ b/src/nautilus-search-directory.c |
1218 | +@@ -176,8 +176,6 @@ static void |
1219 | + start_search (NautilusSearchDirectory *self) |
1220 | + { |
1221 | + NautilusSearchEngineModel *model_provider; |
1222 | +- NautilusSearchEngineSimple *simple_provider; |
1223 | +- gboolean recursive; |
1224 | + |
1225 | + if (!self->query) |
1226 | + { |
1227 | +@@ -205,10 +203,6 @@ start_search (NautilusSearchDirectory *self) |
1228 | + model_provider = nautilus_search_engine_get_model_provider (self->engine); |
1229 | + nautilus_search_engine_model_set_model (model_provider, self->base_model); |
1230 | + |
1231 | +- simple_provider = nautilus_search_engine_get_simple_provider (self->engine); |
1232 | +- recursive = nautilus_query_get_recursive (self->query); |
1233 | +- g_object_set (simple_provider, "recursive", recursive, NULL); |
1234 | +- |
1235 | + reset_file_list (self); |
1236 | + |
1237 | + nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (self->engine)); |
1238 | +diff --git a/src/nautilus-search-engine-private.h b/src/nautilus-search-engine-private.h |
1239 | +new file mode 100644 |
1240 | +index 0000000..8e28ad7 |
1241 | +--- /dev/null |
1242 | ++++ b/src/nautilus-search-engine-private.h |
1243 | +@@ -0,0 +1,34 @@ |
1244 | ++/* |
1245 | ++ * Copyright (C) 2018 Canonical Ltd. |
1246 | ++ * |
1247 | ++ * Nautilus is free software; you can redistribute it and/or |
1248 | ++ * modify it under the terms of the GNU General Public License as |
1249 | ++ * published by the Free Software Foundation; either version 2 of the |
1250 | ++ * License, or (at your option) any later version. |
1251 | ++ * |
1252 | ++ * Nautilus is distributed in the hope that it will be useful, |
1253 | ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1254 | ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1255 | ++ * General Public License for more details. |
1256 | ++ * |
1257 | ++ * You should have received a copy of the GNU General Public |
1258 | ++ * License along with this program; see the file COPYING. If not, |
1259 | ++ * see <http://www.gnu.org/licenses/>. |
1260 | ++ * |
1261 | ++ * Author: Marco Trevisan <marco@ubuntu.com> |
1262 | ++ * |
1263 | ++ */ |
1264 | ++ |
1265 | ++#ifndef NAUTILUS_SEARCH_ENGINE_PRIVATE_H |
1266 | ++#define NAUTILUS_SEARCH_ENGINE_PRIVATE_H |
1267 | ++ |
1268 | ++#include "nautilus-query.h" |
1269 | ++ |
1270 | ++typedef enum { |
1271 | ++ NAUTILUS_SEARCH_ENGINE_TYPE_NON_INDEXED, |
1272 | ++ NAUTILUS_SEARCH_ENGINE_TYPE_INDEXED, |
1273 | ++} NautilusSearchEngineType; |
1274 | ++ |
1275 | ++gboolean is_recursive_search (NautilusSearchEngineType engine_type, NautilusQueryRecursive recursive, GFile *location); |
1276 | ++ |
1277 | ++#endif /* NAUTILUS_SEARCH_ENGINE_PRIVATE_H */ |
1278 | +diff --git a/src/nautilus-search-engine-simple.c b/src/nautilus-search-engine-simple.c |
1279 | +index 3ec9eb3..0c9ea81 100644 |
1280 | +--- a/src/nautilus-search-engine-simple.c |
1281 | ++++ b/src/nautilus-search-engine-simple.c |
1282 | +@@ -20,9 +20,11 @@ |
1283 | + */ |
1284 | + |
1285 | + #include <config.h> |
1286 | ++ |
1287 | + #include "nautilus-search-hit.h" |
1288 | + #include "nautilus-search-provider.h" |
1289 | + #include "nautilus-search-engine-simple.h" |
1290 | ++#include "nautilus-search-engine-private.h" |
1291 | + #include "nautilus-ui-utilities.h" |
1292 | + #define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH |
1293 | + #include "nautilus-debug.h" |
1294 | +@@ -35,7 +37,7 @@ |
1295 | + |
1296 | + enum |
1297 | + { |
1298 | +- PROP_RECURSIVE = 1, |
1299 | ++ PROP_0, |
1300 | + PROP_RUNNING, |
1301 | + NUM_PROPERTIES |
1302 | + }; |
1303 | +@@ -52,7 +54,6 @@ typedef struct |
1304 | + |
1305 | + GHashTable *visited; |
1306 | + |
1307 | +- gboolean recursive; |
1308 | + gint n_processed_files; |
1309 | + GList *hits; |
1310 | + |
1311 | +@@ -66,8 +67,6 @@ struct _NautilusSearchEngineSimple |
1312 | + NautilusQuery *query; |
1313 | + |
1314 | + SearchThreadData *active_search; |
1315 | +- |
1316 | +- gboolean recursive; |
1317 | + }; |
1318 | + |
1319 | + static void nautilus_search_provider_init (NautilusSearchProviderInterface *iface); |
1320 | +@@ -208,6 +207,9 @@ static void |
1321 | + visit_directory (GFile *dir, |
1322 | + SearchThreadData *data) |
1323 | + { |
1324 | ++ g_autoptr (GPtrArray) date_range = NULL; |
1325 | ++ NautilusQuerySearchType type; |
1326 | ++ NautilusQueryRecursive recursive; |
1327 | + GFileEnumerator *enumerator; |
1328 | + GFileInfo *info; |
1329 | + GFile *child; |
1330 | +@@ -238,10 +240,12 @@ visit_directory (GFile *dir, |
1331 | + return; |
1332 | + } |
1333 | + |
1334 | ++ type = nautilus_query_get_search_type (data->query); |
1335 | ++ recursive = nautilus_query_get_recursive (data->query); |
1336 | ++ date_range = nautilus_query_get_date_range (data->query); |
1337 | ++ |
1338 | + while ((info = g_file_enumerator_next_file (enumerator, data->cancellable, NULL)) != NULL) |
1339 | + { |
1340 | +- g_autoptr (GPtrArray) date_range = NULL; |
1341 | +- |
1342 | + display_name = g_file_info_get_display_name (info); |
1343 | + if (display_name == NULL) |
1344 | + { |
1345 | +@@ -276,15 +280,12 @@ visit_directory (GFile *dir, |
1346 | + mtime = g_file_info_get_attribute_uint64 (info, "time::modified"); |
1347 | + atime = g_file_info_get_attribute_uint64 (info, "time::access"); |
1348 | + |
1349 | +- date_range = nautilus_query_get_date_range (data->query); |
1350 | + if (found && date_range != NULL) |
1351 | + { |
1352 | +- NautilusQuerySearchType type; |
1353 | + guint64 current_file_time; |
1354 | + |
1355 | + initial_date = g_ptr_array_index (date_range, 0); |
1356 | + end_date = g_ptr_array_index (date_range, 1); |
1357 | +- type = nautilus_query_get_search_type (data->query); |
1358 | + |
1359 | + if (type == NAUTILUS_QUERY_SEARCH_TYPE_LAST_ACCESS) |
1360 | + { |
1361 | +@@ -322,7 +323,10 @@ visit_directory (GFile *dir, |
1362 | + send_batch (data); |
1363 | + } |
1364 | + |
1365 | +- if (data->engine->recursive && g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) |
1366 | ++ if (recursive != NAUTILUS_QUERY_RECURSIVE_NEVER && |
1367 | ++ g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY && |
1368 | ++ is_recursive_search (NAUTILUS_SEARCH_ENGINE_TYPE_NON_INDEXED, |
1369 | ++ recursive, child)) |
1370 | + { |
1371 | + id = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_ID_FILE); |
1372 | + visited = FALSE; |
1373 | +@@ -438,9 +442,9 @@ nautilus_search_engine_simple_set_query (NautilusSearchProvider *provider, |
1374 | + { |
1375 | + NautilusSearchEngineSimple *simple = NAUTILUS_SEARCH_ENGINE_SIMPLE (provider); |
1376 | + |
1377 | +- g_object_ref (query); |
1378 | + g_clear_object (&simple->query); |
1379 | +- simple->query = query; |
1380 | ++ |
1381 | ++ simple->query = g_object_ref (query); |
1382 | + } |
1383 | + |
1384 | + static gboolean |
1385 | +@@ -453,30 +457,6 @@ nautilus_search_engine_simple_is_running (NautilusSearchProvider *provider) |
1386 | + return simple->active_search != NULL; |
1387 | + } |
1388 | + |
1389 | +-static void |
1390 | +-nautilus_search_engine_simple_set_property (GObject *object, |
1391 | +- guint arg_id, |
1392 | +- const GValue *value, |
1393 | +- GParamSpec *pspec) |
1394 | +-{ |
1395 | +- NautilusSearchEngineSimple *engine = NAUTILUS_SEARCH_ENGINE_SIMPLE (object); |
1396 | +- |
1397 | +- switch (arg_id) |
1398 | +- { |
1399 | +- case PROP_RECURSIVE: |
1400 | +- { |
1401 | +- engine->recursive = g_value_get_boolean (value); |
1402 | +- } |
1403 | +- break; |
1404 | +- |
1405 | +- default: |
1406 | +- { |
1407 | +- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, arg_id, pspec); |
1408 | +- } |
1409 | +- break; |
1410 | +- } |
1411 | +-} |
1412 | +- |
1413 | + static void |
1414 | + nautilus_search_engine_simple_get_property (GObject *object, |
1415 | + guint arg_id, |
1416 | +@@ -492,12 +472,6 @@ nautilus_search_engine_simple_get_property (GObject *object, |
1417 | + g_value_set_boolean (value, nautilus_search_engine_simple_is_running (NAUTILUS_SEARCH_PROVIDER (engine))); |
1418 | + } |
1419 | + break; |
1420 | +- |
1421 | +- case PROP_RECURSIVE: |
1422 | +- { |
1423 | +- g_value_set_boolean (value, engine->recursive); |
1424 | +- } |
1425 | +- break; |
1426 | + } |
1427 | + } |
1428 | + |
1429 | +@@ -518,20 +492,6 @@ nautilus_search_engine_simple_class_init (NautilusSearchEngineSimpleClass *class |
1430 | + gobject_class = G_OBJECT_CLASS (class); |
1431 | + gobject_class->finalize = finalize; |
1432 | + gobject_class->get_property = nautilus_search_engine_simple_get_property; |
1433 | +- gobject_class->set_property = nautilus_search_engine_simple_set_property; |
1434 | +- |
1435 | +- /** |
1436 | +- * NautilusSearchEngineSimple::recursive: |
1437 | +- * |
1438 | +- * Whether the search is recursive or not. |
1439 | +- */ |
1440 | +- g_object_class_install_property (gobject_class, |
1441 | +- PROP_RECURSIVE, |
1442 | +- g_param_spec_boolean ("recursive", |
1443 | +- "recursive", |
1444 | +- "recursive", |
1445 | +- FALSE, |
1446 | +- G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); |
1447 | + |
1448 | + /** |
1449 | + * NautilusSearchEngine::running: |
1450 | +diff --git a/src/nautilus-search-engine-tracker.c b/src/nautilus-search-engine-tracker.c |
1451 | +index 8218ea3..98f3c79 100644 |
1452 | +--- a/src/nautilus-search-engine-tracker.c |
1453 | ++++ b/src/nautilus-search-engine-tracker.c |
1454 | +@@ -22,7 +22,7 @@ |
1455 | + #include <config.h> |
1456 | + #include "nautilus-search-engine-tracker.h" |
1457 | + |
1458 | +-#include "nautilus-global-preferences.h" |
1459 | ++#include "nautilus-search-engine-private.h" |
1460 | + #include "nautilus-search-hit.h" |
1461 | + #include "nautilus-search-provider.h" |
1462 | + #define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH |
1463 | +@@ -296,7 +296,6 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider) |
1464 | + GString *sparql; |
1465 | + GList *mimetypes, *l; |
1466 | + gint mime_count; |
1467 | +- gboolean recursive; |
1468 | + GPtrArray *date_range; |
1469 | + |
1470 | + tracker = NAUTILUS_SEARCH_ENGINE_TRACKER (provider); |
1471 | +@@ -325,10 +324,6 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider) |
1472 | + return; |
1473 | + } |
1474 | + |
1475 | +- recursive = g_settings_get_enum (nautilus_preferences, "recursive-search") == NAUTILUS_SPEED_TRADEOFF_LOCAL_ONLY || |
1476 | +- g_settings_get_enum (nautilus_preferences, "recursive-search") == NAUTILUS_SPEED_TRADEOFF_ALWAYS; |
1477 | +- tracker->recursive = recursive; |
1478 | +- |
1479 | + tracker->fts_enabled = nautilus_query_get_search_content (tracker->query); |
1480 | + |
1481 | + query_text = nautilus_query_get_text (tracker->query); |
1482 | +@@ -476,16 +471,21 @@ static void |
1483 | + nautilus_search_engine_tracker_set_query (NautilusSearchProvider *provider, |
1484 | + NautilusQuery *query) |
1485 | + { |
1486 | ++ g_autoptr(GFile) location = NULL; |
1487 | + NautilusSearchEngineTracker *tracker; |
1488 | + |
1489 | + tracker = NAUTILUS_SEARCH_ENGINE_TRACKER (provider); |
1490 | ++ location = nautilus_query_get_location (query); |
1491 | + |
1492 | + if (!tracker->available) |
1493 | + return; |
1494 | + |
1495 | +- g_object_ref (query); |
1496 | + g_clear_object (&tracker->query); |
1497 | +- tracker->query = query; |
1498 | ++ |
1499 | ++ tracker->query = g_object_ref (query); |
1500 | ++ tracker->recursive = is_recursive_search (NAUTILUS_SEARCH_ENGINE_TYPE_INDEXED, |
1501 | ++ nautilus_query_get_recursive (query), |
1502 | ++ location); |
1503 | + } |
1504 | + |
1505 | + static gboolean |
1506 | +diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c |
1507 | +index 209bd4f..a545160 100644 |
1508 | +--- a/src/nautilus-search-engine.c |
1509 | ++++ b/src/nautilus-search-engine.c |
1510 | +@@ -20,12 +20,14 @@ |
1511 | + */ |
1512 | + |
1513 | + #include <config.h> |
1514 | +- |
1515 | +-#include <glib/gi18n.h> |
1516 | +-#include "nautilus-search-provider.h" |
1517 | + #include "nautilus-search-engine.h" |
1518 | + #include "nautilus-search-engine-simple.h" |
1519 | ++#include "nautilus-search-engine-private.h" |
1520 | ++ |
1521 | + #include "nautilus-search-engine-model.h" |
1522 | ++#include "nautilus-search-provider.h" |
1523 | ++#include "nautilus-file.h" |
1524 | ++#include <glib/gi18n.h> |
1525 | + #define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH |
1526 | + #include "nautilus-debug.h" |
1527 | + #include "nautilus-search-engine-tracker.h" |
1528 | +@@ -417,12 +419,30 @@ nautilus_search_engine_get_model_provider (NautilusSearchEngine *engine) |
1529 | + return priv->model; |
1530 | + } |
1531 | + |
1532 | +-NautilusSearchEngineSimple * |
1533 | +-nautilus_search_engine_get_simple_provider (NautilusSearchEngine *engine) |
1534 | ++gboolean |
1535 | ++is_recursive_search (NautilusSearchEngineType engine_type, |
1536 | ++ NautilusQueryRecursive recursive, |
1537 | ++ GFile *location) |
1538 | + { |
1539 | +- NautilusSearchEnginePrivate *priv; |
1540 | ++ switch (recursive) |
1541 | ++ { |
1542 | ++ case NAUTILUS_QUERY_RECURSIVE_NEVER: |
1543 | ++ return FALSE; |
1544 | + |
1545 | +- priv = nautilus_search_engine_get_instance_private (engine); |
1546 | ++ case NAUTILUS_QUERY_RECURSIVE_ALWAYS: |
1547 | ++ return TRUE; |
1548 | ++ |
1549 | ++ case NAUTILUS_QUERY_RECURSIVE_INDEXED_ONLY: |
1550 | ++ return engine_type == NAUTILUS_SEARCH_ENGINE_TYPE_INDEXED; |
1551 | ++ |
1552 | ++ case NAUTILUS_QUERY_RECURSIVE_LOCAL_ONLY: |
1553 | ++ { |
1554 | ++ NautilusFile *file = nautilus_file_get (location); |
1555 | ++ gboolean remote = !nautilus_file_is_remote (file); |
1556 | ++ nautilus_file_unref (file); |
1557 | ++ return remote; |
1558 | ++ } |
1559 | ++ } |
1560 | + |
1561 | +- return priv->simple; |
1562 | ++ return TRUE; |
1563 | + } |
1564 | +diff --git a/src/nautilus-search-engine.h b/src/nautilus-search-engine.h |
1565 | +index 0416e83..435908a 100644 |
1566 | +--- a/src/nautilus-search-engine.h |
1567 | ++++ b/src/nautilus-search-engine.h |
1568 | +@@ -42,8 +42,6 @@ struct _NautilusSearchEngineClass |
1569 | + NautilusSearchEngine *nautilus_search_engine_new (void); |
1570 | + NautilusSearchEngineModel * |
1571 | + nautilus_search_engine_get_model_provider (NautilusSearchEngine *engine); |
1572 | +-NautilusSearchEngineSimple * |
1573 | +- nautilus_search_engine_get_simple_provider (NautilusSearchEngine *engine); |
1574 | + |
1575 | + G_END_DECLS |
1576 | + |
1577 | +diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c |
1578 | +index cdadc08..b95babf 100644 |
1579 | +--- a/src/nautilus-shell-search-provider.c |
1580 | ++++ b/src/nautilus-shell-search-provider.c |
1581 | +@@ -426,15 +426,32 @@ search_add_volumes_and_bookmarks (PendingSearch *search) |
1582 | + g_object_unref (volume_monitor); |
1583 | + } |
1584 | + |
1585 | ++static NautilusQuery* |
1586 | ++shell_query_new (gchar **terms) |
1587 | ++{ |
1588 | ++ NautilusQuery *query; |
1589 | ++ g_autoptr (GFile) home = NULL; |
1590 | ++ g_autofree gchar *terms_joined = NULL; |
1591 | ++ |
1592 | ++ terms_joined = g_strjoinv (" ", terms); |
1593 | ++ home = g_file_new_for_path (g_get_home_dir ()); |
1594 | ++ |
1595 | ++ query = nautilus_query_new (); |
1596 | ++ nautilus_query_set_show_hidden_files (query, FALSE); |
1597 | ++ nautilus_query_set_recursive (query, NAUTILUS_QUERY_RECURSIVE_INDEXED_ONLY); |
1598 | ++ nautilus_query_set_text (query, terms_joined); |
1599 | ++ nautilus_query_set_location (query, home); |
1600 | ++ |
1601 | ++ return query; |
1602 | ++} |
1603 | ++ |
1604 | + static void |
1605 | + execute_search (NautilusShellSearchProvider *self, |
1606 | + GDBusMethodInvocation *invocation, |
1607 | + gchar **terms) |
1608 | + { |
1609 | +- gchar *terms_joined; |
1610 | + NautilusQuery *query; |
1611 | + PendingSearch *pending_search; |
1612 | +- GFile *home; |
1613 | + |
1614 | + cancel_current_search (self); |
1615 | + |
1616 | +@@ -446,13 +463,7 @@ execute_search (NautilusShellSearchProvider *self, |
1617 | + return; |
1618 | + } |
1619 | + |
1620 | +- terms_joined = g_strjoinv (" ", terms); |
1621 | +- home = g_file_new_for_path (g_get_home_dir ()); |
1622 | +- |
1623 | +- query = nautilus_query_new (); |
1624 | +- nautilus_query_set_show_hidden_files (query, FALSE); |
1625 | +- nautilus_query_set_text (query, terms_joined); |
1626 | +- nautilus_query_set_location (query, home); |
1627 | ++ query = shell_query_new (terms); |
1628 | + |
1629 | + pending_search = g_slice_new0 (PendingSearch); |
1630 | + pending_search->invocation = g_object_ref (invocation); |
1631 | +@@ -479,9 +490,6 @@ execute_search (NautilusShellSearchProvider *self, |
1632 | + nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (pending_search->engine), |
1633 | + query); |
1634 | + nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (pending_search->engine)); |
1635 | +- |
1636 | +- g_clear_object (&home); |
1637 | +- g_free (terms_joined); |
1638 | + } |
1639 | + |
1640 | + static gboolean |
1641 | +@@ -713,13 +721,9 @@ handle_launch_search (NautilusShellSearchProvider2 *skeleton, |
1642 | + gpointer user_data) |
1643 | + { |
1644 | + GApplication *app = g_application_get_default (); |
1645 | +- gchar *string = g_strjoinv (" ", terms); |
1646 | +- gchar *uri = nautilus_get_home_directory_uri (); |
1647 | ++ g_autoptr (NautilusQuery) query = shell_query_new (terms); |
1648 | + |
1649 | +- nautilus_application_search (NAUTILUS_APPLICATION (app), uri, string); |
1650 | +- |
1651 | +- g_free (string); |
1652 | +- g_free (uri); |
1653 | ++ nautilus_application_search (NAUTILUS_APPLICATION (app), query); |
1654 | + |
1655 | + nautilus_shell_search_provider2_complete_launch_search (skeleton, invocation); |
1656 | + return TRUE; |
1657 | +diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c |
1658 | +index a9911ee..6935de3 100644 |
1659 | +--- a/src/nautilus-window-slot.c |
1660 | ++++ b/src/nautilus-window-slot.c |
1661 | +@@ -100,6 +100,7 @@ typedef struct |
1662 | + |
1663 | + /* Query editor */ |
1664 | + NautilusQueryEditor *query_editor; |
1665 | ++ NautilusQuery *pending_search_query; |
1666 | + gulong qe_changed_id; |
1667 | + gulong qe_cancel_id; |
1668 | + gulong qe_activated_id; |
1669 | +@@ -110,7 +111,6 @@ typedef struct |
1670 | + * finish. Used for showing a spinner to provide feedback to the user. */ |
1671 | + gboolean allow_stop; |
1672 | + gboolean needs_reload; |
1673 | +- gchar *pending_search_text; |
1674 | + |
1675 | + /* New location. */ |
1676 | + GFile *pending_location; |
1677 | +@@ -361,9 +361,9 @@ update_search_visible (NautilusWindowSlot *self) |
1678 | + g_object_unref (query); |
1679 | + } |
1680 | + |
1681 | +- if (priv->pending_search_text) |
1682 | ++ if (priv->pending_search_query) |
1683 | + { |
1684 | +- nautilus_window_slot_search (self, g_strdup (priv->pending_search_text)); |
1685 | ++ nautilus_window_slot_search (self, g_object_ref (priv->pending_search_query)); |
1686 | + } |
1687 | + } |
1688 | + |
1689 | +@@ -589,17 +589,13 @@ nautilus_window_slot_get_search_visible (NautilusWindowSlot *self) |
1690 | + |
1691 | + void |
1692 | + nautilus_window_slot_search (NautilusWindowSlot *self, |
1693 | +- const gchar *text) |
1694 | ++ NautilusQuery *query) |
1695 | + { |
1696 | + NautilusWindowSlotPrivate *priv; |
1697 | + NautilusView *view; |
1698 | + |
1699 | + priv = nautilus_window_slot_get_instance_private (self); |
1700 | +- if (priv->pending_search_text) |
1701 | +- { |
1702 | +- g_free (priv->pending_search_text); |
1703 | +- priv->pending_search_text = NULL; |
1704 | +- } |
1705 | ++ g_clear_object (&priv->pending_search_query); |
1706 | + |
1707 | + view = nautilus_window_slot_get_current_view (self); |
1708 | + /* We could call this when the location is still being checked in the |
1709 | +@@ -608,11 +604,11 @@ nautilus_window_slot_search (NautilusWindowSlot *self, |
1710 | + if (view) |
1711 | + { |
1712 | + nautilus_window_slot_set_search_visible (self, TRUE); |
1713 | +- nautilus_query_editor_set_text (priv->query_editor, text); |
1714 | ++ nautilus_query_editor_set_query (priv->query_editor, query); |
1715 | + } |
1716 | + else |
1717 | + { |
1718 | +- priv->pending_search_text = g_strdup (text); |
1719 | ++ priv->pending_search_query = g_object_ref (query); |
1720 | + } |
1721 | + } |
1722 | + |
1723 | +@@ -2814,6 +2810,7 @@ nautilus_window_slot_dispose (GObject *object) |
1724 | + g_clear_object (&priv->current_location_bookmark); |
1725 | + g_clear_object (&priv->last_location_bookmark); |
1726 | + g_clear_object (&priv->slot_action_group); |
1727 | ++ g_clear_object (&priv->pending_search_query); |
1728 | + |
1729 | + g_clear_pointer (&priv->find_mount_cancellable, g_cancellable_cancel); |
1730 | + |
1731 | +diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h |
1732 | +index 573357d..f67b6ab 100644 |
1733 | +--- a/src/nautilus-window-slot.h |
1734 | ++++ b/src/nautilus-window-slot.h |
1735 | +@@ -112,7 +112,7 @@ void nautilus_window_slot_set_active (NautilusWindowSlot * |
1736 | + gboolean nautilus_window_slot_get_loading (NautilusWindowSlot *slot); |
1737 | + |
1738 | + void nautilus_window_slot_search (NautilusWindowSlot *slot, |
1739 | +- const gchar *text); |
1740 | ++ NautilusQuery *query); |
1741 | + |
1742 | + gboolean nautilus_window_slot_handles_location (NautilusWindowSlot *self, |
1743 | + GFile *location); |
1744 | +diff --git a/src/nautilus-window.c b/src/nautilus-window.c |
1745 | +index a23d515..8eab985 100644 |
1746 | +--- a/src/nautilus-window.c |
1747 | ++++ b/src/nautilus-window.c |
1748 | +@@ -3100,14 +3100,14 @@ nautilus_window_show_about_dialog (NautilusWindow *window) |
1749 | + |
1750 | + void |
1751 | + nautilus_window_search (NautilusWindow *window, |
1752 | +- const gchar *text) |
1753 | ++ NautilusQuery *query) |
1754 | + { |
1755 | + NautilusWindowSlot *active_slot; |
1756 | + |
1757 | + active_slot = nautilus_window_get_active_slot (window); |
1758 | + if (active_slot) |
1759 | + { |
1760 | +- nautilus_window_slot_search (active_slot, text); |
1761 | ++ nautilus_window_slot_search (active_slot, query); |
1762 | + } |
1763 | + else |
1764 | + { |
1765 | +diff --git a/src/nautilus-window.h b/src/nautilus-window.h |
1766 | +index 39b16e7..c1196d3 100644 |
1767 | +--- a/src/nautilus-window.h |
1768 | ++++ b/src/nautilus-window.h |
1769 | +@@ -135,7 +135,7 @@ void nautilus_window_end_dnd (NautilusWindow *window, |
1770 | + GdkDragContext *context); |
1771 | + |
1772 | + void nautilus_window_search (NautilusWindow *window, |
1773 | +- const gchar *text); |
1774 | ++ NautilusQuery *query); |
1775 | + |
1776 | + void nautilus_window_initialize_slot (NautilusWindow *window, |
1777 | + NautilusWindowSlot *slot, |
1778 | diff --git a/debian/patches/series b/debian/patches/series |
1779 | index d6c50a8..be13b9e 100644 |
1780 | --- a/debian/patches/series |
1781 | +++ b/debian/patches/series |
1782 | @@ -1,3 +1,5 @@ |
1783 | +Revert-Revert-nautilus-file-Don-t-show-thumbnails-for-the.patch |
1784 | +Revert-Revert-files-view-Remove-new-empty-folder-name-sug.patch |
1785 | multiarch_fallback.patch |
1786 | 03_translations_list_update.patch |
1787 | 04_suppress_umount_in_ltsp.patch |
1788 | @@ -15,9 +17,12 @@ ubuntu_backspace_behaviour.patch |
1789 | #Needs updating |
1790 | #16_unity_new_documents.patch |
1791 | 0015-tracker-search-engine-don-t-start-it-if-not-availabl.patch |
1792 | +query-add-recursive-flags-and-use-it-in-search-engines.patch |
1793 | 0016-search-engine-add-a-recent-search-engine-listing-Gtk.patch |
1794 | 0017-recent-add-function-to-update-manager-on-file-rename.patch |
1795 | 0018-search-engine-add-locate-based-search-engine.patch |
1796 | appstream-compulsory.patch |
1797 | server_list_segfault.patch |
1798 | clear_pending_selection.patch |
1799 | +git_middle_tab.patch |
1800 | +nautilusgtkplacesview-show-error-if-volume-is-not-mounted.patch |
1801 | diff --git a/meson.build b/meson.build |
1802 | index 18e645a..6256193 100644 |
1803 | --- a/meson.build |
1804 | +++ b/meson.build |
1805 | @@ -1,5 +1,5 @@ |
1806 | project ('nautilus', 'c', |
1807 | - version: '3.26.3', |
1808 | + version: '3.26.3.1', |
1809 | meson_version: '>=0.40.0', |
1810 | license: 'GPL3+') |
1811 | |
1812 | diff --git a/src/nautilus-file.c b/src/nautilus-file.c |
1813 | index fc765be..d6ac35a 100644 |
1814 | --- a/src/nautilus-file.c |
1815 | +++ b/src/nautilus-file.c |
1816 | @@ -5496,7 +5496,7 @@ nautilus_thumbnail_is_limited_by_zoom (int size, |
1817 | |
1818 | zoom_level = size * scale; |
1819 | |
1820 | - if (zoom_level <= NAUTILUS_LIST_ICON_SIZE_STANDARD) |
1821 | + if (zoom_level <= NAUTILUS_LIST_ICON_SIZE_SMALL) |
1822 | { |
1823 | return TRUE; |
1824 | } |
1825 | diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c |
1826 | index 9b7b9b9..8784f63 100644 |
1827 | --- a/src/nautilus-files-view.c |
1828 | +++ b/src/nautilus-files-view.c |
1829 | @@ -2047,8 +2047,9 @@ static void |
1830 | nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, |
1831 | gboolean with_selection) |
1832 | { |
1833 | - g_autoptr (NautilusDirectory) containing_directory = NULL; |
1834 | + NautilusDirectory *containing_directory; |
1835 | NautilusFilesViewPrivate *priv; |
1836 | + GList *selection; |
1837 | g_autofree char *uri = NULL; |
1838 | g_autofree char *common_prefix = NULL; |
1839 | |
1840 | @@ -2062,13 +2063,8 @@ nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, |
1841 | uri = nautilus_files_view_get_backing_uri (view); |
1842 | containing_directory = nautilus_directory_get_by_uri (uri); |
1843 | |
1844 | - if (with_selection) |
1845 | - { |
1846 | - GList *selection; |
1847 | - selection = nautilus_view_get_selection (NAUTILUS_VIEW (view)); |
1848 | - common_prefix = nautilus_get_common_filename_prefix (selection, MIN_COMMON_FILENAME_PREFIX_LENGTH); |
1849 | - nautilus_file_list_free (selection); |
1850 | - } |
1851 | + selection = nautilus_view_get_selection (NAUTILUS_VIEW (view)); |
1852 | + common_prefix = nautilus_get_common_filename_prefix (selection, MIN_COMMON_FILENAME_PREFIX_LENGTH); |
1853 | |
1854 | priv->new_folder_controller = |
1855 | nautilus_new_folder_dialog_controller_new (nautilus_files_view_get_containing_window (view), |
1856 | @@ -2084,6 +2080,9 @@ nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view, |
1857 | "cancelled", |
1858 | (GCallback) new_folder_dialog_controller_on_cancelled, |
1859 | view); |
1860 | + |
1861 | + nautilus_file_list_free (selection); |
1862 | + nautilus_directory_unref (containing_directory); |
1863 | } |
1864 | |
1865 | typedef struct |
1866 | diff --git a/src/nautilus-trash-monitor.c b/src/nautilus-trash-monitor.c |
1867 | index 97f4874..1e156e1 100644 |
1868 | --- a/src/nautilus-trash-monitor.c |
1869 | +++ b/src/nautilus-trash-monitor.c |
1870 | @@ -29,7 +29,7 @@ |
1871 | #include <gio/gio.h> |
1872 | #include <string.h> |
1873 | |
1874 | -#define UPDATE_RATE_SECONDS 5 |
1875 | +#define UPDATE_RATE_SECONDS 1 |
1876 | |
1877 | struct NautilusTrashMonitorDetails |
1878 | { |
I just have a comment on what upstream did for 3.26.3.1. They reverted two commits, which they see as behavioural changes in a stable release, and that makes sense upstream.
Revert "files-view: Remove new empty folder name suggestion" /gitlab. gnome.org/ GNOME/nautilus/ commit/ 945c32dec747855 047aa9b380d5358 8c5fcfb57a
https:/
Revert "nautilus-file: Don't show thumbnails for the first 2 zoom levels" /gitlab. gnome.org/ GNOME/nautilus/ commit/ d62c0899f34665b dc4752ce8b68443 28889f4638
https:/
But downstream here in Ubuntu, those behaviours were released as part of 18.04 in nautilus 3.26.3 and removing them might be considered a regression in Ubuntu itself. The changes had been introduced in 3.26.3 during the development cycle of Bionic, so technically that counts as an improvement, not as a behavioural change in stable Ubuntu.