Commit graph

16844 commits

Author SHA1 Message Date
Cosimo Cecchi 380124b5cf bookmarks: remove unused methods 2012-10-19 15:34:27 -04:00
Cosimo Cecchi 0cd6b88fff bookmark: simplify code
No need for nautilus_bookmark_copy(), when we can just g_object_ref()
the object.
2012-10-19 15:22:54 -04:00
Cosimo Cecchi 9855ddb282 shell-provider: fix an erroneous typo
Didn't mean to remove this line.
2012-10-19 15:18:25 -04:00
Cosimo Cecchi 0177dd24a5 bookmark: avoid sync I/O 2012-10-19 15:14:59 -04:00
Cosimo Cecchi 287182851b shell-provider: make the provider more robust to cancellation
Don't assume there's only one engine running at the time, and avoid
requiring state from the global app singleton in search callbacks.

This fixes a crash where we would dereference NULL in the hits-added
callback, since we would access it through the global app object, and
self->active_search was previously cleared on cancellation.

https://bugzilla.gnome.org/show_bug.cgi?id=686168
2012-10-18 17:33:07 -04:00
Cosimo Cecchi 2b29ab5699 test-search-engine: test cancellation and NautilusSearchEngineModel
Add some code in the search engine test to verify cancellation and
NautilusSearchEngine model work properly.
2012-10-18 15:07:19 -04:00
Cosimo Cecchi a36dc6aefa search-engine-tracker: refactor search completion notification
Keep a ref to the engine while the async search is in progress. This is
what all the other engines do, and not doing it causes problems when
cancelling the operation.

While we're at it, also refactor the completion notification code in a
single function.

https://bugzilla.gnome.org/show_bug.cgi?id=686168
2012-10-18 15:07:18 -04:00
Cosimo Cecchi 546184ca41 search-engine-model: emit finished when cancelled in-flight
If we get stopped while the directory ready callback is pending, make
sure to still emit the finished signal on the provider.
2012-10-18 15:07:17 -04:00
Cosimo Cecchi 632094e066 search-engine: keep a reference to the engine while searching
This way, we can ensure the engine will be alive when the providers
finish.
2012-10-18 15:07:17 -04:00
Cosimo Cecchi cffa0c7091 query: always set a query location URI
It makes sense for a query object to always be relative to a specific
location, so just initialize the query URI to g_get_home_dir().
2012-10-18 15:07:15 -04:00
Cosimo Cecchi d5c4c3c0f3 editable-label: add an input-only window for events
Add another input-only child to the parent GdkWindow's for events and
imcontext. Since we will be painted in a GtkLayout, using only one
input-only window won't work well with scrolling, but this way we can
ensure that whatever GdkWindow the XIM engine will try to ensure native,
it won't be our (floating) drawing window.

https://bugzilla.gnome.org/show_bug.cgi?id=686053
2012-10-17 23:15:29 -04:00
Cosimo Cecchi f149927a48 Revert "editable-label: don't use a input-output window"
This reverts commit b67360316c.

It breaks scrolling, as explained in
https://bugzilla.gnome.org/show_bug.cgi?id=686322
2012-10-17 16:16:20 -04:00
Cosimo Cecchi b67360316c editable-label: don't use a input-output window
Use the same behavior of GtkEntry i.e. create an input only GdkWindow
for the text area. This avoids the text area becoming black when it's
used together with the XIM module.

https://bugzilla.gnome.org/show_bug.cgi?id=686053
2012-10-15 12:57:11 -04:00
Cosimo Cecchi 685d149e09 application: call gtk_init() manually when doing self checks
We used to do this implicitly, but
6b5ffd4e88 made it necessary to call it
manually, since we avoid g_application_register() when we perform self
checks.
2012-10-15 11:15:17 -04:00
Cosimo Cecchi 7666f83777 search: remove unused hits-subtracted signal
Since this is never emitted, keeping the code around just makes it more
complicated.
2012-10-15 10:47:32 -04:00
Cosimo Cecchi 18bf5a4e09 search-directory: use g_hash_table_add() 2012-10-15 10:44:19 -04:00
Cosimo Cecchi 97b616d4f4 tracker-engine: apply basename heuristic to tracker hits too
So that they get the same kind of bonus they would if they matched with
the other engines. The FTS rank that tracker gives us is added as
another bonus.
2012-10-15 09:51:32 -04:00
Cosimo Cecchi a80aa3b842 window-slot: reset floating bar details when setting load status 2012-10-15 09:51:32 -04:00
Cosimo Cecchi a594de07bf search: add debug output 2012-10-15 09:51:32 -04:00
Cosimo Cecchi b610e53b09 search-engine: wait for all engine's completion before starting
When we're getting reloaded, we should wait for the completion of all
engines before triggering a new search. When this happens, set an
internal restart flag and apply it when the last provider returns.
This avoids finished signals from providers that complete the previous
search after a while to being interpreted for the current search.
2012-10-15 09:51:32 -04:00
Cosimo Cecchi c196a6eada search-engine-simple: don't send last batch when cancelled
There's no need to send a last batch of results if we are returning
because of a cancellation.
2012-10-15 09:51:32 -04:00
Cosimo Cecchi cbd5212e39 search-engine-model: clear active search before calling finished
See previous commit.
2012-10-15 09:51:31 -04:00
Cosimo Cecchi 9967669927 search-engine-simple: clear active search before calling finished
So that start() will work if called directly from the finished callback.
2012-10-15 09:51:31 -04:00
Cosimo Cecchi 10c5667fac search-hit: set a limit to FTS weight in matches
We don't want this to become bigger than the proximity bonus.
2012-10-15 09:51:31 -04:00
Cosimo Cecchi 98bcc3ba2b query: move string matching code in NautilusQuery
This also allows us to use a heuristic to evaluate how good the filename
match is.
2012-10-15 09:51:31 -04:00
Cosimo Cecchi a4e65a637c search-directory: fix a FIXME
Using an auxiliary hash table gives us better performance for large
directories, as we avoid constantly walking the list.
2012-10-15 09:51:31 -04:00
Cosimo Cecchi 949af5d713 search-engine: refactor providers status check
Make sure that we emit either finished or error when all the providers
have finished.
2012-10-15 09:51:30 -04:00
Cosimo Cecchi 5a6f9bd61d simple-engine: always emit finished, even when cancelled
Otherwise the search hits hash table won't be cleared when search is
stopped, leading to missing results.
2012-10-15 09:50:11 -04:00
Cosimo Cecchi 9703e67f57 search-directory: set show hidden files on query according to monitors
This ensures the simple engine won't crawl in hidden directories, unless
necessary.
2012-10-15 09:50:11 -04:00
Cosimo Cecchi 27d3f2ba55 query: change raking to always sort closest files first
And among those with the same distance from the search root, add more
bonus for recency and FTS rank. This ensures results don't move too much
when searching recursively.

Also, while we're at it, change the code to use GFile instead of simple
string comparisons.
2012-10-15 09:50:11 -04:00
Cosimo Cecchi 9c695bcaa8 file: don't check nautilus_file_is_in_search() when getting relevance
This checks the URI, so it will always return FALSE, since files in
NautilusSearchDirectory have the real URI of the location.
2012-10-15 09:50:11 -04:00
Cosimo Cecchi dc0572d7c9 search-directory: simplify start/stop search code
Keep code to start and stop the search engine in a single place, create
it together with the directory and simplify start/stop invariants.
2012-10-15 09:50:09 -04:00
Cosimo Cecchi 4e9ac72518 Remove unused NautilusMergedDirectory
This is completely unused now.
2012-10-15 09:43:19 -04:00
Ask H. Larsen c13671857c Updated Danish translation 2012-10-15 06:39:26 +02:00
Ivan Masár 3040a55e2d Updated Slovak translation 2012-10-12 10:16:57 +01:00
Cosimo Cecchi c6510979aa shell-provider: make the shell search provider follow show-hidden
Add a query property we can set to false from the shell provider, and
use it in the simple search engine to exclude hidden files. Note that by
default the query sets it to TRUE, so the behavior in Nautilus is
unchanged.
2012-10-11 21:48:43 -04:00
Kjartan Maraas d1f53906bb Updated Norwegian bokmål translation. 2012-10-11 20:59:02 +02:00
Takayuki KUSANO 547c56c618 Updated Japanese translation 2012-10-11 22:50:23 +09:00
Cosimo Cecchi 2d72365cb5 list-view: don't call parent when the row has been selected
This is a regression from commit
0b9ddf8826, which broke dragging multiple
rows.

https://bugzilla.gnome.org/show_bug.cgi?id=683751
2012-10-10 17:05:33 -04:00
Cosimo Cecchi b1abb52610 pathbar: consistently use symbolic icons for root elements in pathbar
We were still using non-symbolic icons for mount roots.
2012-10-10 09:47:19 -04:00
Yuri Myasoedov c650a3cf28 Fixed Russian translation 2012-10-09 22:57:17 +04:00
Arash Mousavi 1031e9b626 l10n: Updated Persian translation 2012-10-07 18:25:19 +03:30
Marek Černocký 35a8c88994 Updated Czech translation 2012-10-07 12:57:41 +02:00
Yaron Shahrabani 24c29866c8 Updated Hebrew translation. 2012-10-05 10:43:58 +02:00
Cosimo Cecchi d6c89019d4 canvas-container: remove NautilusCanvasLayoutMode
Since we use the vertical layout only for the desktop these days, remove
NautilusCanvasLayoutMode completely, and just return TRUE from
nautilus_canvas_container_layout_is_vertical() if we're a desktop
container.
This allows to remove a lot of unused layouting code.
2012-10-04 17:03:29 -04:00
Cosimo Cecchi da6b814f7c desktop-canvas-view: remove an obsolete hack for BonoboPlug 2012-10-04 17:02:17 -04:00
Cosimo Cecchi 1292610b87 desktop-canvas: set margins according to the primary workarea
This ensures desktop icons are pinned to the primary monitor, instead of
moving around when plugging in a new display.
There's also a slight change in behavior introduced by this patch - that
is for multihead configurations where the first monitor in visible order
is not the primary one, it won't be possible to move desktop icons to
monitors to the left, or to the top, of the primary monitor - in other
words, desktop icons layout starts from the primary monitor and expands
rightwards/downwards.

https://bugzilla.gnome.org/show_bug.cgi?id=420624
2012-10-04 16:18:03 -04:00
Cosimo Cecchi ce80131177 list-view: clear the renaming file when stopping cell editing
If the renaming_file member sticks around, we will ignore activation of
new files. Instead, make sure to clear it out when the model is cleared.

https://bugzilla.gnome.org/show_bug.cgi?id=685109
2012-10-02 17:08:45 -04:00
Cosimo Cecchi 86fde912f3 slot: refactor some code
Factor out two functions, to show and hide the query editor, and use
them from nautilus_window_slot_set_query_editor_visible()
2012-10-02 15:50:23 -04:00
Cosimo Cecchi c3c81737ca slot: use the pending location when creating a query editor in loading
Or we'll segfault calling nautilus_directory_get() on a NULL location.

https://bugzilla.gnome.org/show_bug.cgi?id=685293
2012-10-02 15:46:14 -04:00