| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Pass new uncrustify criteria. No logic changes.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Fixes test failures introduced by df78c517516cec20892f2a108df47613153ddf5b
Before that commit, we used to fully initiate the tag manager only from
NautilusApplication, because the tests didn't call set_cancellable().
Now that initialization is completed on construction, add a constructor
which skips the part of initialization that the tests don't need.
|
|
|
|
|
|
|
|
| |
It's really annoying having to setup a local autocleanup variable in
every function we want to use the NautilusTagManager API.
Use a NautilusUndoManager-like API instead, with new() returning a
reference and get() not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Somehow we have ended up in a situation where the singleton object
is not initialized on creation but instead when requires the
NautilusApplication code to pass a GCancellable instance in order to
complete the initialization.
The passed cancellable pointer is stored by the application object
in order to cancel it on finalization, but there is no other usage
for this cancellabled from outside of the NautilusTagManager code.
So, we can just cancel it in NautilusTagManager::finalize, such that
there is no need for NautilusApplication to pass or store it.
This way, we can move the initalization from ::set_cancellable()
into ::init instead.
|
| |
|
|
|
|
| |
Also respect code style (return type in different line).
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are leaking references to the singleton object in multiple places.
It's not a problem during runtime, but this means it's not properly
finalized when the application quits, leaking the tracker connection,
which is detected by valgrind.
Add g_autoptr() and g_clear_object() where missing. Also, to prevent
future leaks, document nautilus_tag_manager_get() and uniformize its
use as either an autovariable initializer or a field initializer.
|
|
|
|
|
|
| |
get_query_status() is a wrapper for tracker_sparql_cursor_next_finish()
and it's weird for _finish() not to be called directly by the
GAsyncReadyCallback function.
|
|
|
|
|
|
|
|
|
|
| |
Tracker 3 migration code tries to spawn tracker3 binary using
G_SPAWN_SEARCH_PATH_FROM_ENVP flag. However, tracker3 is installed under
/usr/local/bin/ on OpenBSD which isn't searched by envp. So the migration fails
with the following warnings: "Tracker 2 migration: Couldn't run `tracker3`:
Failed to execute child process "tracker3" (No such file or directory)."
Let's use G_SPAWN_SEARCH_PATH instead of G_SPAWN_SEARCH_PATH_FROM_ENVP to fix
this issue.
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the moment we restrict starring to within Home, but the database
might include URIs from outside of it. Such may happen after a file
move operation, as per the previous commit.
Keeping the moved URIs in the database is useful in case the move is
undone, because we change the URI back. But otherwise, the non-home
URIs remain in the database indefinitely.
So, let's filter them out when listing the starred files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't rely on tracker-miner-fs's rename tracking for starred files
anymore, as explained in 29105fc9f6abf2eca6f986104763d21b9f22f0fb.
However, losing track of starred files, when they or their containing
folders are renamed or moved, is a major regression for this feature.
The common case is that the operation is performed using this very app,
so, we can largely restore the feature by updating URI on every rename
and move operation we perform.
Additionally, this allows us to finally close a couple of old issues.
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/161
and fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/169
|
|
|
|
|
|
|
|
|
|
|
| |
Starred files data is now migrated from the Tracker 2.x database if
found. This depends on the `tracker3` CLI tool, which should be
present anywhere that we find libtracker-sparql 3.0. The --2to3
export functionality was added in
https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/308
If/when the migration completes successfully, a stamp file named
`~/.local/share/nautilus/tracker2-migration-complete` is created.
|
|
|
|
|
|
|
|
|
| |
Previously starred files were limited to directories indexed by Tracker.
Since the 'Port to Tracker 3' commit this is no longer the case.
However, to avoid unbounded growth in the starred files database we
want to prevent starring of network locations and removable devices
for now as these entries might go stale and we don't have any way
to clean them up.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nautilus is a file manager, so we should star files.
Previously we starred the content resources extracted by Tracker Miner
FS, instead. This had the advantage that the stars would follow file
renames. It had the downside of being more complex and limited in
which files can be starred. In Tracker 2.x, the feature only worked
in folders indexed by Tracker Miner FS. With Tracker 3.x, it was
additionally limited to files where Tracker had extracted metadata
-- mainly just documents and media files.
This commit takes the simpler approach of storing the star against
the file URL. All files can now be starred, and stars will no longer
persist when a file is moved or renamed.
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/160
|
|
|
|
|
|
|
| |
This means the Nautilus flatpak will be able to use Tracker on systems
which don't have Tracker 3 available on the host. It comes at a cost of
increased resource consumption inside the Flatpak due running an extra
indexer process there.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly the port is straightforward, we connect to tracker-miner-fs
explicitly over D-Bus instead of the centralized tracker-store daemon
we connected to previously.
The search-engine-tracker test is now isolated from the user's real
Tracker index using the `tracker-sandbox` script provided by Tracker,
and it lets tracker-miner-fs index the test file rather than trying
to synthesize the expected database contents.
There are more changes in nautilus-tag-manager.c. Until now, starred
file information was stored in the tracker-miner-fs database. This has
some downsides, firstly the data is deleted if someone runs `tracker
reset --hard`, secondly it isn't possible to do this from inside a
Flatpak sandbox with Tracker 3.0. because the
This commit changes the NautilusTagManager to set up a private
database inside XDG_DATA_HOME/nautilus/tags. This stores the starred
file information. The database is managed with Tracker, which allows us
to continue using the rename-tracking that tracker-miner-fs provides.
The same limitations apply as before that only files in indexed
locations can be starred.
|
|
|
|
|
|
|
|
| |
Only process query results if there's no error.
Fix some checks so that we report errors except for
G_IO_ERROR_CANCELLED, which happens normally as part of
nautilus_application_finalize().
|
|
|
|
|
|
| |
tracker_notifier_new() may return a null pointer on error, and that’s
exactly what happens sometimes (CI pipelines,
https://gitlab.gnome.org/GNOME/tracker/issues/43).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we use nao:predefined-tag-favorite, which is used by other
applications (example: gnome-photos) to tag favorite content. As such,
favorite photos show up as starred files in Files.
This is not what we currently want, because Favoriting has a different
meaning and function than Starring.
Instead, create our own custom tag <urn:gnome:nautilus:starred>
and use that instead of nao:predefined-tag-favorite.
Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/277
|
|
|
|
|
| |
This ensures all uses of the tag id use the same string. It also makes
it easy to change the tag id, as we are doing next commit.
|
|
|
|
|
|
|
| |
What is %ld on x86_64 machines might not be what %lld is on x86
machines.
Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/283
|
|
|
|
|
|
|
| |
Shadowing variables is error-prone, since one might mean to refer to a
variable that was declared earlier, but has the same name. Additionally,
being more strict about variable scoping can help make the code more
readable.
|
|
|
|
|
| |
Non-static functions without any previous declaration cause warnings and
are usually indicative of incorrectly marked static functions.
|
|
|
|
|
| |
Parameterless function declarations imply indeterminate parameter count,
while the implementations take no arguments.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
Files with apostrophes couldn't be starred because tracker cannot handle
non ascii characters.
So escape the uris of files before sending them to tracker.
Closes https://gitlab.gnome.org/GNOME/nautilus/issues/163
|
|
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
|