summaryrefslogtreecommitdiff
path: root/src/nautilus-search-engine-simple.c
Commit message (Collapse)AuthorAgeFilesLines
* general: Fix indentation nitpicksAntónio Fernandes2023-04-231-9/+9
| | | | Pass new uncrustify criteria. No logic changes.
* Add fast-content-type fallback to all placesOndrej Holy2023-03-291-1/+8
| | | | | | | | | The `G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE` attribute doesn't have to be always set. The commit 0e597803 added the `G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE` fallback inside the `NautilusFile` class, but not for other places. Let's fix this oversight. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2862
* search-engine-simple: Handle case when mime type is NULLOndrej Holy2023-03-091-1/+1
| | | | | | | | The `G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE` attribute doesn't have to be always set. This case is not handled by the `NautilusSearchEngineSimple` class and the `NULL` pointer can be passed in the `g_content_type_is_a` function currently. This is an error. Let's check the returned pointer to prevent this situation.
* Use generic helpers for obtaining file attributesOndrej Holy2023-03-091-2/+6
| | | | | | | | | | | | | | | | | | | | It is not guaranteed that all `GFileInfo` attributes are always set when requested. They used to be silently set to `NULL`, `FALSE`, or `0` earlier when they were not provided by their implementations. However, some of the helper functions now print critical errors when the attributes are not set by their implementations even though they were requested. See the https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3261 merge request for more details. So Nautilus now prints tons of critical errors when started. The unset attributes can be detected over the `g_file_info_has_attribute` function. But Nautilus doesn't care in most cases about the reason why the attribute is `NULL`, `FALSE`, or `0`. There are also more generic helper functions that don't print these critical errors. Let's use them for the attributes that may not always be set to get rid of those critical errors. I suppose that the `name`, `display_name`, `size`, `icon`, and `file_type` attributes don't need this special handling, although it is not clearly stated anywhere... Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2861
* nautilus-search-engine: Explicitely initialize variablesOndrej Holy2022-03-051-10/+23
| | | | | | | | Currently, build warning is shown about the potential usage of uninitalized variable. This is false-positive, but let's explicitly initialize the variables using switch to get rid of the warning. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2152
* nautilus-search-engine: Use GDateTime everywhereOndrej Holy2022-03-051-7/+8
| | | | | | | The search providers convert dates from unix time to `GDateTime` and vice versa. Let's use `GDateTime` everywhere. Relates: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2152
* nautilus-search-engine: Propagate dates to calculate rankOndrej Holy2022-03-051-13/+13
| | | | | | | The access and modification dates are used to calculate rank, but are not propagated from all providers. Let's propagate them from all providers. Relates: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2152
* nautilus-search-engine: search by creation timeNishit Patel2021-11-271-1/+8
| | | | | | | this will let user search for the files using the crtime (creation time) of the files Closes #1761
* general: Run uncrustify scriptOndrej Holy2020-04-051-18/+21
| | | | | There are some style issue since the last run. Let's run it again before enabling style-check CI job.
* search-engine-simple: Make some modifications to previous commitCarlos Soriano2019-02-221-69/+62
| | | | | | * Cleaner separation of phases * Avoid some races * Fix some leaks
* nautilus-search-engine-simple: Only spawn one idle each timeXiang Fan2019-02-221-23/+103
| | | | To avoid clogging up the main loop.
* query: Port MIME type filter to GPtrArrayAntónio Fernandes2018-12-121-7/+6
| | | | | | | | | | We have been using doubly-linked lists to store MIME type names strings. But this is not a great container for strings, and we are copying the lists multiple times. So, use GPtrArray instead. This avoids copies thanks to reference counting, and enables autocleanup thanks to built-in data freeing.
* search-engine: add is_recursive_search function and use itMarco Trevisan (Treviño)2018-07-261-19/+7
| | | | | | | Returns whether the search should be recursive given the location and the search engine type. Using this both in tracker and simple search engines.
* search-engine: use nautilus_file_is_remote to check remote filesMarco Trevisan (Treviño)2018-07-261-4/+12
|
* search-engine-simple: respect recursive setting for non local childrenMarco Trevisan (Treviño)2018-07-261-5/+12
|
* search-engine-simple: get query parameters just once in a cycleMarco Trevisan (Treviño)2018-07-261-5/+5
|
* search-engine-simple: remove recursive property using query flag insteadMarco Trevisan (Treviño)2018-07-261-47/+4
| | | | | | | | | | | | Compute the recursive parameter depending on the query flag for recursivity, enabling it only if the query recursive flag is NAUTILUS_QUERY_RECURSIVE_ALWAYS, while should be disabled otherwise. At this point the "recursive" property that was set only for this search engine doesn't make any sense anymore and we can safely drop it, together with the calls that were done at search-engine level to handle this special case. We move now the responsibility to to the engine itself, more than to the model.
* query: Remove unused propertyAntónio Fernandes2018-03-131-16/+0
| | | | | | | | | search_starred is always FALSE, because we don't provide UI to filter search for starred files. Remove it and any related code. Doing so, we are dropping the only uses of hardcoded tag ids outside src/nautilus-tag-manager.c, which makes it possible to set the tag id as a private constant next commit.
* search-engine-simple: don't leak DateRange array if not matchingMarco Trevisan (Treviño)2018-03-011-2/+2
|
* general: Rename from 'favorite' to 'starred'Carlos Soriano2018-02-131-2/+2
| | | | | | | | It was a mix of both terms, given that tracker uses 'favorite' but we use 'starred' in the UI. Since the part that interact with tracker is minimal, is better to be consistent with the UI. This renames 'favorite' to 'starred' except the tracker queries.
* Add favorite filesAlexandru Pandelea2017-11-051-2/+17
| | | | | | | Add option to make files Favorite, by either toggling a star in the list view, or from the context menu. https://bugzilla.gnome.org/show_bug.cgi?id=786039
* Revert "search-engine: fix search providers handling"Alexandru Pandelea2017-08-171-11/+0
| | | | | | This reverts commit 37693c427941d60634bad80dd7c2d0b3a8523cea. The patch was pushed by accident.
* search-engine: fix search providers handlingAlexandru Pandelea2017-08-151-0/+11
| | | | | | | | | | | | When starting the search providers, some provider might finish before all providers are started, so a wrong value of providers_running will be used, making Nautilus crash. To fix this, keep a queue of the started providers and whenever the value of the finised/running providers is needed, check the status of each provider. https://bugzilla.gnome.org/show_bug.cgi?id=785723
* search-engine-simple: port to G_DECLARE* type declarationNeha Yadav2016-10-081-35/+22
| | | | | | | | | | | | | Currently we are using the old GObject class declarations, which have two problems. One problem is that we cannot use smart pointers like g_autoptr. The other problem is the boilerplate code generated that makes the code less readable, so harder to understand. To fix this use G_DECLARE* type. https://bugzilla.gnome.org/show_bug.cgi?id=771929
* general: run uncrustifyCarlos Soriano2016-08-291-356/+403
| | | | | | | | And make the style of Nautilus the same for all files. Hopefully we can fix all the style issues we can find in the next days, so expect a little of movement on this. https://bugzilla.gnome.org/show_bug.cgi?id=770564
* general: merge libnautilus-private to srcwip/csoriano/private-to-srcCarlos Soriano2016-04-251-0/+525
And fix make distcheck. Although libnautilus-private seem self contained, it was actually depending on the files on src/ for dnd. Not only that, but files in libnautilus-private also were depending on dnd files, which you can guess it's wrong. Before the desktop split, this was working because the files were distributed, but now was a problem since we reestructured the code, and now nautilus being a library make distcheck stop working. First solution was try to fix this inter dependency of files, but at some point I realized that there was no real point on splitting some of those files, because for example, is perfectly fine for dnd to need to access the window functions, and it's perfectly fine for the widgets in the private library to need to access to all dnd functions. So seems to me the private library of nautilus is somehow an artificial split, which provides more problems than solutions. We needed libnautilus-private to have a private library that we could isolate from extensions, but I don't think it worth given the problems it provides, and also, this not so good logical split. Right now, since with the desktop split we created a libnautilus to be used by the desktop part of nautilus, extensions have access to all the API of nautilus. We will think in future how this can be handled if we want. So for now, merge the libnautilus-private into src, and let's rethink a better logic to split the code and the private parts of nautilus than what we had. Thanks a lot to Rafael Fonseca for helping in get this done. https://bugzilla.gnome.org/show_bug.cgi?id=765543