| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
There are two error messages that may be shown when the delete operation
fails. One message is generic and the another one mentions insuffient
permissions. However, the generic one is now shown in the case of the
`G_IO_ERROR_PERMISSION_DENIED` error. Let's exchange the messages to
use the second one in this case.
|
|
|
|
|
|
|
|
| |
Now that we are properly freeing all view items, it became obvious
that we were incorrectly freeing a call to get_item_from_file
which is just a hash table lookup.
See: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1101
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When renaming a file in list-view or grid-view, the renamed file keeps
its position (i.e. it isn't re-positioned into the new proper position)
until a refresh). There is actually a more generalized problem where
file changes on all attributes fail to cause the sort positions to be
updated. For example, sorting by date modified and touching a file
doesn't cause a re-sort.
The file-changes signal from nautilus-directory, simply gives us the
changed files for a given directory, without telling us what was changed
so there's not an efficient way of detecting this. We do have a
::end-file-changes signal, that is only emitted once every batch of
changes, so let's call nautilus_view_model_sort() then. If no sort
changes are required, this will finish quite fast, so it seems like
the best alternative.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2568
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The libadwaita pkg-config adds `-I/usr/include/libadwaita-1`
(or similar) to the compiler flags, which means that
#include <adwaita.h>
is sufficient, and the currently used
#include <libadwaita-1/adwaita.h>
is not necessary.
Not only is it not necessary, but it prevents nautilus from being
built with an uninstalled libadwaita build (either meson subproject
or otherwise). To fix that, remove the `libadwaita-1/` prefix.
The libadwaita test programs also only `#include <adwaita.h>`, and
according to Debian Code Search, that is the more popular version.
https://codesearch.debian.net/search?q=%23include+%3Cadwaita.h%3E&literal=1
https://codesearch.debian.net/search?q=%23include+%3Clibadwaita-1%2Fadwaita.h%3E&literal=1
|
|
|
|
|
|
|
|
|
|
|
| |
Fix critical when parsing null date string:
GLib-CRITICAL **: 12:05:52.144: g_time_val_from_iso8601: assertion 'iso_date != NULL' failed
This is possible since tracker can return NULL[1] "if the column is
not in the [0,#ncolumns] range"
[1] https://gnome.pages.gitlab.gnome.org/tracker/docs/developer/tracker-sparql-cursor.html?gi-language=c#tracker_sparql_cursor_get_string
|
|
|
|
|
|
|
|
|
|
|
| |
The commit e2969a9c29d0d171038fcb35d8baa5a7df372191 introduced an assertion
statement to ensure that the `g_file_get_basename` returned non-NULL string.
Unfortunately, the assertion has an inverted condition. This leads to crashes
in the `get_unique_target_file` function for files that don't have the
`edit-name` attribute set (i.e just a few GVfs backends). Let's fix the
inverted condition.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2825
|
|
|
|
|
|
|
| |
With non-local drops, when the value is initially NULL, we get
warnings because of some of the checks done on a NULL value. This was
a regression from 3d17ed252960cbc9848aea0b398a4a74ef05623c. Return
action copy before any check dependent on a dropped value.
|
|
|
|
|
|
|
|
|
|
| |
Add a check to assert nautilus_files_view_drop_proxy_received_uris is
not called with an empty source uri list.
Make nautilus_dnd_perform_drop return whether the drop event was
actually handled. Adjust callers accordingly.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2787
|
|
|
|
|
|
| |
This change makes the rubberband to have rounded corners,
making it consistent with other elements such as buttons and text entries,
which also have rounded corners.
|
|
|
|
|
|
|
|
|
| |
We are still leaking NautilusViewItem in several places. Essentially
every NautilusViewItem (and thus every NautilusFile) ever created is
leaked. In list-base, the queue in real_add_files is freed, but not
the items themselves. Make sure to also free the results of
g_list_model_get_item() and our macro listitem_get_view_item which now
calls gtk_tree_list_row_get_item.
|
|
|
|
|
|
|
| |
view-item holds a reference for the cell and the cell holds a ref
to the item. In order to break this cycle, let's make item_ui
a weak pointer in view-item. The cell will get freed by the
list factory.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
GtkTreeExpander includes a built-in "expand on drag hover" feature.
But our own "open on drag hover" feature competes (and often wins)
over it, making it hard to reliably expand rows on hover without
opening the folder.
So, separate the content and the expander. Trigger "expand on drag
hover" only if over the expander, and "open on drag hover" only if
over the rest.
|
|
|
|
|
|
| |
No functional change in this commit, but this is going to make it
possible for each view to pick the areas which trigger the hover
timeout, to be done in the next commit.
|
|
|
|
|
|
|
|
| |
A property binding is unfit for our use case because directory
loading is async, so the expander arrow is temporarily hidden,
which is wrong and looks like a glitch.
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2791
|
|
|
|
|
|
|
| |
When using the collapse shortcut (Left arrow in LTR locales), if the
row is already collapsed, we want to move to the parent row.
Currently we select the parent but don't move focus. Fix that.
|
|
|
|
|
|
|
|
|
| |
They have been set on the cell in commit 728bec15a184ae31225499297284f07027716110
But they don't work because the focus is never in the cell.
So, set them in the view instead, and trigger them in the capture phase
to prevent GtkListBase's cursor movement shortcuts taking priority.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Toggling sort directories first in list view causes a crash.
This is a regression in commit b9ac68eb6fb1f7aa5f815f9b15cd789758d62cba
gtk_sort_list_model_set_sorter() first unrefs the old sorter, then refs
the new sorter. The crash happens because the new sorter is the new
sorter. It gets destroyed by the unref, and therefore we crash when
trying to ref a destroyed object. (It's arguably a GTK API bug too.)
The solution (from our side) is for us to hold a temporary reference to
keep the object alive.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an item is moved, we are still showing it in the old location as a
regression caused by commit 510a4202d25b82323a1307918b382aab603190eb
With the introduction of tree model, we maintain multiple list stores
(one for each TreeListRow when the TreeListRow is a directory) and the
item is associated with a directory store upon creation by checking
nautilus_file_get_parent(). When removing an item, we again find the
directory store to remove from, by checking directory_reverse_map for
the parent file.
But, when an item has been moved, the parent file is no longer the same
as when it was added. This means we try to remove the file from the new
parent instead of the old one.
Fortunately we already have a solution for this from the old list view:
NautilusFilesView.remove_file() gets passed the directory to remove the
file from. Let's use it instead of the current parent.
Heavily based on diagnosis and commit message from patch by Corey Berla
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2784
|
|
|
|
|
|
|
|
|
|
| |
Tooltips are not showing up for long file names that have Pango markup
characters. This is happening because the cell widget label is set using
`set_text`, but is retrieved in the `query-tooltip` signal handler using
`get_label`. While `get_label` can return Pango markup, it is not
guaranteed to return text with markup characters escaped. Avoid this
problem by fetching the file name from label and setting tooltip using
text.
|
|
|
|
|
|
|
|
|
|
|
| |
The `org/freedesktop/FileManager1` interface is not currently exported
from the `dbus_register` vfunc. This causes issues for projects (e.g.
desktop-icons extension) that want to use all the Nautilus intefaces
over the `org.gnome.Nautilus` connection. Let's use the already established
connection and export the `FileManager1` interface from the `dbus_register`
vfunc.
https://bugzilla.redhat.com/show_bug.cgi?id=2150894
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 3014f69485a120bedf0eec5af441346a95fe27f7 and part of
the commit a1751d3d870c6cdc092f893755623c4ff20e1ef3. This extra handling
was needed because `NautilusFreedesktopDBus` methods might be called before
establishing its own D-Bus connection. The follow-up commit is going to use
the already established connection from the `dbus_register` vfunc. It
should be ensured that the `dbus_register` vfunc is called before the
`window_added`, `window_removed`, or `startup` vfunc. Consequently, this
extra handling is going to be redundant. Let's remove it as a preparation
for the next commit.
|
|
|
|
|
|
|
| |
This reverts commit 23ae53870a39afe43548111b6432db39511a6e97. This
change was needed for split of desktop-related functionality, but it
seems no more needed to me. Let's revert those changes to make the
code a bit easier as a preparation for the next commits.
|
|
|
|
|
| |
The updated version of uncrustify didn't like this style,
the new style doesn't look great either.
|
|
|
|
|
|
|
| |
In some cases, an action that was disabled when opening the tab menu
might stay disabled when you close the tab menu because of an
early return. Make sure to reenable all of the actions when the
tab menu is closed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The gtk bookmark file stores bookmarks as follows:
<encoded file 1 uri> <file 1 label (optional)>
<encoded file 2 uri> <file 2 label (optional)>
...
File names (uri's) with newlines actually function "correctly" because
the newlines get encoded as %0A. The label however is not encoded
and it would be problematic to start encoding it at this point.
Since the sidebar entries should be 1 line anyways, let's just use
our existing eel_str_replace_substring() to change the newline to a
space.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1502
|
|
|
|
|
|
|
|
|
|
| |
Tree expander uses SHIFT+Right/Left because the right/left
keys may be used to switch focus between columns. We are just showing
labels, so there's no use for the Right / Left keys. Also,
Nautilus has special behavior for the left key when the folder
is already collapsed (or a file which cannot be expanded) where it
selects the parent folder (if available). Bring back this behavior
with GtkTreeExpander and improve it for RTL languages.
|
| |
|
|
|
|
|
| |
Noticed this when working on the previous commit. It doesn't seem
to be causing problems now, but could in the future.
|
|
|
|
|
| |
We have to reload the view in order to show the expanders, so
lets do it for the user.
|
|
|
|
|
| |
Now that we have a spinner on the name cell, let's wait for the directory
to be completely loaded before showing it, when expanding a tree.
|
|
|
|
| |
To prevent multiple clearing of the same handle
|
|
|
|
|
|
| |
Before 1a1f2b50778e03ac14bea7ee684bb9bddc563bc1 we only returned
non-NULL items in get_items_from_files. Fix this regression
that causes crashes in some situtations
|
|
|
|
|
|
|
|
|
|
| |
The code for get_selection_for_file_transfer was abstracted from
view_icon_controller which didn't account for the issues of selecting
files with tree expanders. Reimplement get_selection_for_file_transfer
to exclude children when the immediate parent is selected. As noted in
7ac81c87c84149b421a6869837deb852876e3d12 this is not a perfect solution
because other ancestors (i.e. grandparents) could be selected, but at least
it matches the behavior we had previously.
|
|
|
|
|
|
| |
Bind n_items in the children model to the hide-expander
property of TreeExpander in order to hide the expander icon
when the fold is empty.
|
|
|
|
|
| |
The handler warns that NAUTILUS_IS_NAME_CELL fails. Clean up
the handler to match others in the signal group.
|
|
|
|
|
| |
If we unexpanded a row, then the item would no longer be available.
Return early
|
|
|
|
|
|
| |
If the view is no longer available i.e. switched to the GridView,
this crashes. Simply move the call to nautilus_list_base_get_model()
after the NULL check.
|
|
|
|
|
| |
The spinner is shown only after 1 second without the directory having
finished loading, to avoid visual noise when directories loads quickly.
|
|
|
|
| |
Starred, Recent and Search still not supported due to bugs
|
|
|
|
|
|
|
|
|
| |
This is going to allow us to reuse the model for a GtkColumnView-based
list view with expanding trees support.
As documented, GtkTreeViewRow:item may be NULL when the item it held
is destroyed. So, we must take care to handle the NULL case when
expected and also warn and return when not expected.
|
|
|
|
|
| |
The view doesn't see any difference yet, but this prepares for
tree expansion support later.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a required step in order to use GtkTreeListModel later.
GtkTreeListModel doesn't work well when its internal models get
resorted: it assumes the items are gone, not reordered, causing
the row objects to get destroyed and the view to lose track of
things.
This might not be as efficient, but we've got no other option
other than implementing a custom tree list model...
|
|
|
|
|
| |
nautilus-window-slot-dnd was shared between the path-bar and the
tabs, but now its only used for the pathbar, so lets simplify
|
|
|
|
|
|
|
|
|
|
|
| |
We only call clipboard_clear_if_colliding_uris() from a dnd operation.
Previous to the gtk4 port, this was called from the
canvas view 2d1deaac2dd12b0ba16446bfbf3498b266e60338
and tree view 6708861ed174e2b2423df0500df9987cdaf2adc0
Also, we are calling nautilus_clipboard_clear_if_colliding_uris()
for any copy/move operation. Copy/Link don't negatively impact the
clipboard, so lets just call this on GDK_ACTION_MOVE
|
|
|
|
|
| |
This functions clears the clipboard if any of its contents becomes
potentially invalid.
|
|
|
|
|
|
|
|
|
| |
With the introduction of ::extra-drag-value in AdwTabBar, we can
now dynamically set the preferred action on the AdwTabBar. Use
the "extra" drop target on the AdwTabBar, and use our existing code
making this fairly simple.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2495
|
|
|
|
|
|
| |
window-slot-dnd never the same makeover as list-base. Reuse existing
code in nautilus-dnd and eliminate all of the unused code for when
nautilus-window-slot-dnd handled tab drop targets
|
| |
|
|
|
|
|
|
|
| |
In gtk4 we aren't using nautilus_files_view_handle_uri_list_drop()
because the uri-lists are handled by gtk now. We did have a dialog
to warn users when an invalid drag was used, instead of passing a
potentially bad GdkDragAction to nautilus_files_view_copy_move.
|