According to António's research, `standard::description` is only set by
evolution for sending attachments, which is not relevant for actual file
browsing. Thus, remove the description of `NautilusFile`.
For context, this was introduced in f78a979958
To avoid needless string copies, make nautilus_file_get_metadata return
a const char* rather then a string copy that has to be freed. Adjust
usages accordingly.
This has been introduced by bfd9ccf6 back when we used it to match
a hardcoded list of remote types, to know whether the file was remote.
It's been unused since f0759d6fe9.
To avoid needless string copies, make nautilus_file_get_filesystem_id
return a const char* rather then a string copy that has to be freed.
Adjust usages accordingly.
To avoid needless string copies, make nautilus_file_get_thumbnail_path
return a const char* rather then a string copy that has to be freed.
Adjust usage accordingly.
To avoid needless string copies, make nautilus_file_get_edit_name return
a const char* rather then a string copy that has to be freed. Adjust
usage accordingly.
To avoid needless string copies, make nautilus_file_get_name return a
const char* rather then a string copy that has to be freed. Adjust usage
accordingly.
To avoid needless string copies, make nautilus_file_get_mime_type return
a const char* rather then a string copy that has to be freed. Adjust
usage accordingly, especially keep copy for extensions interface.
Instead of using the NautilusFileInfo interface methods in normal
NautilusFile methods, swap the usage, making the interface methods use
NautilusFile methods. This saves doing unnecessary round trips for all
calls that are not made by extensions, so essentially all of them.
Amended by António Fernandes <antoniof@gnome.org> to make diff simpler.
Calling refresh_extension_model_pages() might cancel a pending
IO operation and free the ImagesPropertiesModel. Bailout after
being cancelled instead of using a freed data.
It has recently started to depend on unstable version of tracker-sparql
e02ecb3171
In due time, that should be available in the SDK, but we are moving to fast to wait for that, so let's unblock our CI pipeline.
The row holds a NautilusFile instance to cache information needed for
Properties dialog and DND. [0]
But not listening for changes means we never release the reference when
the file is marked as gone. This naturally leads to bugs.
Listen "changed", clear when gone, and reconnect on-demand, but even
then protect against ref'ing a gone file (which shouldn't happen but
still does for self-owned files).
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2922
[0] dc2711bd74
This reverts commit 5d371babaf.
The result is the same, because `nautilus_file_get_by_uri()` would just
return a new reference to the already existing file.
Reverting because, with the next commit, we should not be relying on
the file to be set on the row.
Their names are misleading: the list itself is not refcounted.
This misconception is likely how some memory leaks have been
introduced in nautilus_restore_files_from_trash() and in
properties_cb(). Both leaks are therefore fixed as part of
this commit by employing autocleanup in the first case and
stack allocation in the second case.
Restructure function by inlining pairwise string comparisons and using
strings directly from array, removing the need to do any string
duplications. Also reduce the amount of string length calculations.
It's too easy to forget to add them if adding more early returns in
the future.
Autocleanup was made for this. It also removes the need to store the
return value in a variable.
Explicitly clear the trash monitor from NautilusApplication, so it does
not need cleanup through the eel shutdown mechanism.
Also inline the static trash monitor into the get function, as that is
now its only usage.
Add nautilus_file_list_debug() to debug print a list of file uris.
Use this as a replacement for DEBUG_FILES(), so that these messages too
can be seen by setting G_MESSAGES_DEBUG accordingly.
Define respective GLib log domains per file for debug logging and remove
the custom DEBUG solution. Remove the unused nautilus-debug functions.
Fixes#1220
To not need to include a .c file in test-file-utilities, expose
nautilus_file_new_from_filename in nautilus-file-private.h and adjust
the includes accordingly.
Integrate `eel_str_get_common_prefix` as `nautilus_filename_get_common_prefix`
into filename utilities. Rename the unittest to reflect this.
eel-string.h is no longer needed with this change, so it is removed.