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