| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
In the `nautilus_file_get_volume_name` function, the `g_strdup` function
is called on a result from the `g_mount_get_name` function in the
`nautilus_file_get_volume_name` function currently. However,
`g_mount_get_name` already returns a newly allocated string. Let's remove
the extra `g_strdup` call to fix the leak.
|
|
|
|
|
|
| |
The `nautilus_file_get_volume_name` function currently calls the
`g_file_find_enclosing_mount` function, but this should not be needed
as the enclosing mount is now part of the `NautilusFile` object.
|
|
|
|
|
| |
The description of `nautilus_file_get_volume_name` function looks to be
wrong. Let's try to fix it.
|
|
|
|
|
|
| |
The pathbar automatically clear all the buttons when the current location
is marked as gone. This was needed earlier, when child folders where shown
in some cases, but this is no more needed nowadays. Let's drop that code.
|
|
|
|
|
|
| |
The `get_mount_at` private function looks to be equal to the
`nautilus_get_mounted_mount_for_root` utility function. Let's drop it
and use the utility function instead.
|
|
|
|
|
| |
Let's document the recently changed behavior of when the current location
is marked as gone to make the code easier to understand.
|
|
|
|
|
|
|
|
| |
When the current location is marked as gone, Nautilus jumps to the
first existing parent currently (except when unmounted), but only for
native locations. I don't see reasons why not to jump to parent also
for GVfs locations when they are still mounted (though not many of them
support file monitors). Let's change that.
|
|
|
|
|
|
|
| |
Currently, the `GFileMonitor` object on GVfs locations never emits
the `G_FILE_MONITOR_EVENT_UNMOUNTED`, nor `_DELETED` events when the
location is unmounted. Let's mark the file as gone when the `unmounted`
signal is emitted for the enclosing mount.
|
|
|
|
|
|
|
|
| |
When the current location is marked as gone, Nautilus jumps to the home
directory in case of `GMount` root folders. This is fine as it is not
desired to jump inside the runtime dir. However, for subfolders it still
jumps to the first existing parent. Let's jump to the home directory also
for subfolders when the corresponding mount is unmounted.
|
|
|
|
|
|
|
| |
The `NautilusFile` object currently stores the `GMount` object only for
unix mount points and files of the `G_FILE_TYPE_MOUNTABLE` type. It would
be handy to know also an enclosing mount. Let's store it as well. This is
preparation for the follow-up commit.
|
|
|
|
|
|
|
|
| |
The `nautilus_find_existing_uri_in_hierarchy` function calls the
`g_object_unref` with a `NULL` pointer when `g_file_query_info` fails.
This leads to a crash e.g. when parent directory of the currently
opened location is removed. Let's port the code to use `g_autoptr` to
avoid that.
|
|
|
|
|
|
|
| |
The logic to handle that the current location was marked as gone relies
on the fact that the `nautilus_get_mounted_mount_for_root` function returns
the `GMount` object despite the fact that it might be already unmounted.
Let's add a comment about it to make it obvious.
|
|
|
|
|
|
|
| |
Otherwise, due to some modular arithmetic artifacts, there is an
unsightly 1px transparent line between the picture and its css border.
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2779
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the current location is marked as gone, Nautilus jumps to the
first existing parent currently (except for non-native locations and
mount roots). This is fine in most cases, but not for autofs locations
as Nautilus jumps to parent everytime autofs mount timeouted. It would
be better to stay in the same folder in this case. Let's try the current
location first even if it is marked as gone to ensure that. It would be
perhaps even better to prevent autofs locations somehow from timeouting
at all, or avoid immediate remounting at least, but those solutions
don't look easy to implement.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1514
|
| |
|
|
|
|
|
|
|
|
| |
When copying these classes from GTK the translation domain was kept.
This causes issues with translations in libadwaita widgets, so remove
them.
Fixes #2890
|
|
|
|
|
|
|
|
| |
Changes in GTK (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5442)
require to use `gtk_switch_set_active` to flip a switch, otherwise it
ends up in an inconsistent state.
Fixes #2883
|
|
|
|
|
| |
gtk_window_get_focus can return NULL. Passing that directly into
gtk_widget_is_ancestor throws a GLib warning, so handle it explicitly.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
The `Deprecated pre-processor symbol: replace with "G_ADD_PRIVATE"`
warning is shown during build currently. This is caused by the usage
of the `G_TYPE_INSTANCE_GET_PRIVATE` macro. However, the statement with
this macro doesn't have any effect. This looks to be an oversight in
the commit 335eabec. Let's drop the whole statement to get rid of this
warning.
|
|
|
|
|
|
|
| |
The `‘action’ may be used uninitialized` warning is shown during build
currently. It can really happen that uninitialized value is used when
dropping something else then the `GDK_TYPE_FILE_LIST` and `G_TYPE_STRING`
on the tab bar. Let's initialize the action to prevent this.
|
|
|
|
|
|
|
| |
The `‘action’ may be used uninitialized` warning is shown during build
currently. It can really happen that uninitialized value is used when
dropping something else then `GDK_TYPE_FILE_LIST` on the pathbar. Let's
initialize the action to prevent this.
|
|
|
|
|
|
|
|
| |
Currently, the `ignoring return value of ‘g_string_free_and_steal’
declared with attribute ‘warn_unused_result’` warning is shown during
build. This is because the `str` struct member is used instead of a
return value from the `g_string_free` function. Let's update the code
to use the return value in order to avoid this warning.
|
|
|
|
|
|
|
| |
Currently, the `Nautilus: "@name" parameter unexpected at this location`
warning is shown during build. This is caused by the extra newline character
in the documentation comment for the `nautilus_column_new` function. Let's
remove this extra newline character to get rid of that warning.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit c1c7ccb0e23772d8cfb509eb133d7e522706c697 as it
turned out that the workaround is still needed. I've only updated the
obsolete comment a bit. The issue was initially fixed by the
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4831 merge request,
but it has been broken later.
Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/5670
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2844
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
We are already caching the preferences for thumbnailing. Since the
clock format is queried for every single file when loading a list view,
we should also cache the clock format setting.
Rename the flag from use_24 to use_24_hour for more clarity.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In nautilus_file_class_init, we are calling
thumbnail_limit_changed_callback() and show_thumbnails_changed_callback()
in order to cache the initial values for the static variables
cached_thumbnail_limit and show_file_thumbs. This has the unintended
side effect of also calling emit_change_signals_for_all_files_in_all_directories ()
which doesn't make sense at a point in time when there are no
NautilusFile's and NautilusDirectory may not even be ready.
Split out the updating of the setting from the emission of
all files changed.
|
|
|
|
|
|
|
|
|
| |
I see regularly the following debug print on Nautilus startup:
`GLib-CRITICAL **: 10:52:52.992: g_hash_table_foreach: assertion
'hash_table != NULL' failed`. This is because the
`emit_change_signals_for_all_files_in_all_directories` function is called
before the `directories` hash table is initialzed. Let's return early
to prevent usage of the uninitialized hash table.
|
|
|
|
|
|
|
|
|
|
| |
Currently, the `g_bus_own_name_on_connection` function is called for the
`org.freedesktop.FileManager1` name before exporting the
`/org/freedesktop/FileManager1` skeleton. This seemingly works fine in most
cases, but occasionally the name is acquired too early and D-Bus clients
can get `No such interface` error. This is regression caused by the commit
2293e813d3cd1cc47b2b8750f7140647aa066fc8. Let's try to own the nam until
after exporting the skeleton to avoid this error.
|
|
|
|
|
|
| |
This reverts commit d45b820d4a082287ef52f538fc001009ad5204e1.
This commit causes a crash.
|