| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
Brings us rounded bottom corners.
|
|
|
|
|
|
| |
This will allow us to easily set up HdyWindow,
as otherwise we'd need to use GtkContainer APIs
that will be removed in GTK4
|
| |
|
|
|
|
|
| |
I think that it will be better to use the GNOME e-mail alias in the
.doap file instead of the corporate address.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
They are plain wrappers for g_file_is_native(), and, after the previous
commits, there are only two usages, which are found in:
* window-slot.c, introduced in b3a4eabf01a57b860ea95155f608f33fd08cce27
* files-view.c, introduced in f98d2edb0a71c58127e23a05d58bd12842b57132
In both cases, we can just call g_file_is_native() directly. This way,
we can drop the chronically-misinterpretted is_local() methods, whose
various interpretations are now covered by specific checking methods:
* g_file_is_native()
* nautilus_file_has_local_path()
* !nautilus_file_is_remote()
|
|
|
|
| |
The new name better reflects the usage and meaning of this method.
|
|
|
|
|
|
| |
Avoid calling g_file_get_path() if we have enough information.
Clarify the purpose of this function.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The early "return TRUE;" was added because gnome-vfs didn't have a way
to represent all URIs: 5baaa578051f2f1249a518c256d84d04f221011a
When nautilus was ported to GIO, this early return was kept despite
GnomeVFSURI being superceeded by GFile, which can represent any URI:
469047a2a58430026d68a3b99b223b922b18b8d1
This early return should never happen, because a non-NULL location
is always set.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use the is_local_or_fuse() method in 2 cases where we want to know
whether a local path can be obtained for a file in a give location:
1) when determining which apps can open the file, as some apps
don't understand URIs;
2) when providing local paths to scripts from the Scripts menu.
It has been returning TRUE for files in the Trash as a special case,
because they are stored in a real location which can be obtained from
the value of the G_FILE_ATTRIBUTE_STANDARD_TARGET_URI attribute.
However, we have been ignoring this attribute for trashed files since
commit bc22321e5b5b02711b65d8c1b0301a53de42f18b.
This has resulted in two bugs:
1) we pick the default handler to open an application ignoring the
fact that it may not be able to open URIs;
2) we pass relative paths as command-line parameters for scripts,
which they wrongly interpret as being relative to $HOME because
we can't chdir() into trash:///.
As discussed in https://bugzilla.gnome.org/show_bug.cgi?id=768168, we
probably don't want to provide direct access to the real location of
trashed files.
So, let's drop this special case, making is_local_or_fuse() return
FALSE for trash://*, which fixes these two bugs.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That commit mixed the concepts of "file with local path", "local file",
and "native file". They are 3 different things, as documented in GIO.
Now, after the previous commits, the is_local() methods are no longer
employed to check that files have local paths. Instead, we now use
nautilus_file_is_local_or_fuse(), which was introduced[1] in order to
fix[2] for a regression caused by the commit we are now reverting.
[1] 2f1765d80392c06166d077c27a9a6661edd7c128
[2] 4df06e7f14ffefedc65bae84fca1cd7f5e945f78
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The nautilus_[directory,file]_is_local() methods have been confounding
the concepts of "native" and "non-remote" files, ever since the port
from gnome-vfs to GIO in 59511dfee330102ee42e09bef37cbc9cd12973c6
This conceptual mismatch is notorious in the Trash location, which is
neither native nor remote. This soon raised a bug [1], which has been
worked around by introducing a check for nautilus_file_is_in_trash().
Now, after the previous commits, the is_local() methods are no longer
employed to check that files are "non-remote". Instead, we now use
nautilus_file_is_remote(), which correctly reports that the trash is
not remote.
So, this workaround can be droped now.
[1] https://bugzilla.gnome.org/show_bug.cgi?id=546353
|
|
|
|
| |
Drop unused parameters, consolidate code, sprinkle autocleanup variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have been calling is_local_or_fuse() on the current directory to
know if we can pass local paths for scripts in as an environment
variable.
This is wrong because the current directory may not be the actual
location of the files. That's why a workaround has been introduced for
search directories in commit 8fdd3792ed4e1fb95e6c4f2adc4c8631c27bb2d3
But the same problem still happens in the starred:/ directory.
In the case of paths passed as command line parameters, we call
is_local_or_fuse() directly on the files, so there is no need for any
workaround for search and starred. This enhancement had been proposed
in https://bugzilla.gnome.org/show_bug.cgi?id=341657, and introduced
in commit 34d594099868445b1c2d4f16da3bcdf05f914100.
However, this enhancement was not applied to the envar case. Let's do
something equivalent now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The scripts in the Scripts menu are passed the (possibly relative)
local paths to selected files as command line parameters.
The relative paths can only work if the current directory itself has a
local path that we can chdir into, and, for backwards compatibility,
don't pass URIs.
For that reason we pass no parameters if nautilus_file_is_local()
returns FALSE for any of them. [1]
However, it returns FALSE for files in FUSE mounts, which have
perfectly usable local paths.
So, use nautilus_file_is_local_or_fuse() instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The scripts in the Scripts menu are passed the local paths of selected
files as a NAUTILUS_SCRIPT_SELECTED_FILE_PATHS environment variable.
But in some cases files may not have a backing local path. We account
for this by checking for the "file:" URI schema. But the accompaining
comment is outdated, because nautilus_directory_is_local() changed
behaviour as a result of the gnome-vfs -> GIO port.
Furthermore, thanks to FUSE, we can have valid local paths for
non-native locations, but we haven't been passing these to scripts.
To fix this, we can use nautilus_directory_is_local_or_fuse() now. Also
drop the eel_uri_is_trash() check, which is now redundact.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When creating a file from template, we fail if the template's not local
This was introduced by commit e5e83363ca306025ccbf328ed7bf782fda58eb81
The assumption of being local comes from the original version of that
patch[1], which used filenames instead of URIs, as later explained[2]:
> I was sure that templates will be only stored on the local disk,
> ignoring that we have to pass URIs to GnomeVFS anyway.
As a result of the review process, the usage of filenames was dropped
in favor of URIs, but the precondition check remained, even though it
was no longer necessary.
Remove it now.
[1] https://mail.gnome.org/archives/nautilus-list/2005-June/msg00008.html
[2] https://mail.gnome.org/archives/nautilus-list/2005-June/msg00176.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The nautilus_file_should_show_thumbnail() method was first introduced
in commit 469047a2a58430026d68a3b99b223b922b18b8d1
It duplicated the tradeoff setting logic that was already present in
get_speed_tradeoff_preference_for_file(), a shared function for both
top left text preview and child directories item count.
(Top left text preview has since been phased out.)
The code duplication grew when support for the filesystem::use-preview
attribute was added in commit 00e59a6b3c10ec4c3915b61d09498b4110189917
Instead, let's make should_show_thumbnail() use the shared function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the thumbnailing and/or item counting preference is 'local-only',
we need to know if a file is local or remote, and for this we use the
nautilus_file_is_local() method.
However, ever since the port from gnome-vfs to GIO, this method relies
on g_file_is_native() instead of gnome_vfs_uri_is_local(), which are
not the same thing. Quoting the GIO docs:
> A native file is one expressed in the platform-native filename
> format, e.g. "C:\Windows" or "/usr/bin/". This does not mean the
> file is local, as it might be on a locally mounted remote filesystem.
So, nautilus_file_is_local() is no longer telling us the truth. This
means we may show thumbnails or item counts for natively-mounted remote
locations when we are not supposed to.
Instead, let's use the nautilus_file_is_remote() method, which relies
on the G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE attribute (which was not
implemented at the time of the GIO port).
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1478
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It compares the filesystem type identifier with a hardcoded list of
remote types introduced in 2015.[0]
The filesystem::remote attribute has been introduced[1] to handle this,
and we have been using it[2], but kept the hardcoded list in order to
workaround issues with GLocalFile not setting this attribute correctly.
Now that these issues have been fixed[3], we can finally drop it.
[0] d3e1a71c6377343af5d61d6ded7bc4f53dfeaf53
[1] https://gitlab.gnome.org/GNOME/glib/-/commit/e57355b055217b067cd1a71340f7ea47e51d4aae
[2] 99f55748ef69a68df86b9a039998ee576d59b898
[3] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1534
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The tests currently create various files and directories with generic names
and manipulate with them directly in the `/tmp` directory. The tests also
remove all files in `/tmp` with the generic prefixes like `move`, `copy`,
etc. This can simply cause test suite failures if files with such names
already exist in the `/tmp` directory. Also, the test suite can easily remove
files created by other applications. Let's always create an unique directory
in `/tmp` for tests to fix the mentioned problems...
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Currently, "Moved 0 files to ..." status is shown if all files were moved
during the initial phase. This is because the initial phase consists of
`g_file_move` calls with `G_FILE_COPY_NO_FALLBACK_FOR_MOVE` flag, however,
the status is printed for files which needs copy&delete fallback. Let's
print the total number of natively moved files in this case instead.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1635
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some GVfs backends doesn't report progress except the total file size. With
the previous patch applied, the remaining time is calculated after each
successfully transfered file for such backends. This is fine for small files,
but looks weird for big files as the estimated time is not updated regularly,
so it looks like hang. One possible solution would be to update the remaining
time periodically even if progress is not reported from GIO. However, this
could again lead to situations, which would look like that the transfer is
hanged. Let's do not report remaining time at all when progress is not reported
to reduce confusion.
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the remaining time for some operations is reported even if
it hasn't been yet computed. Consequently, "596,523 hours left" is
shown to the user as it corresponds to the initial value, which is INT_MAX.
In most cases this is because some GVfs backend doesn't report progress
except the total file size. Let's do not report remaining time if transfer
rate is 0, ie. remaing time is not computed.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/232
|
|
|
|
|
|
|
|
|
|
|
| |
The SOURCE_INFO_INIT sets the hash table pointer to NULL, and we may go
out of scope before/without calling scan_sources(). So, it's wrong to
assume that .scanned_dirs_info is not NULL.
Interestingly, this didn't break the tests in either the MR or the
main branch. But it did break the move-files test in another branch
after being rebased, because that branch added an early return which
precedes scan_sources(). Thank you tests, and thank you CI!
|
|
|
|
|
|
|
|
|
| |
The size of a copied or moved directory (when represented as a file itself - in
addition to its contents) was not being included in the transferred byte count.
Add code to include size of directory in transferred byte count.
Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1501
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During a copy/move operation the total file count as well are size was
not decremented correctly when a directory was skipped. The file count
and size were only decremented for the directory (being represented as
a single file) but not for the descendants of the directory even though
the count and size of the descendants were included in the original
count for the operation. This caused the reported progress of the copy
operation to be off from the total file count and size when one or more
directories were skipped.
Fix logic to reduce total file count and size of a skipped directory to
account for the descendants of the directory (children files and
subdirectories and their children, recursively).
Since the existing logic for scanning contents does not scan a
directory in a recursive manner but instead adds all identified
directories at the end of a queue to be processed later, additional
data structures were added to hold children file count and size of each
directory scanned during a file operation. Information from this data
structure is accessed to properly decrement the total file count and
size of a directory if it is skipped during a copy/move operation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 24dae9e0a429d25b3871e5a3d4710369d7cac0b9.
In situations that allow a directory and its children to be
simultaneously selected for file operations (such as from search
results, the logic implemented in the original commit prevented an
item to be counted more than once. However in the actual copy, move
or delete operation the selected items were copied (or moved or
deleted) as if they were separate top level items thus performing
the operation on the children or subdirectories multiple times (in
addition to processing them as part of the parent directory that was
also included in the selection).
Due to this inconsistency between the sources scan logic and the actual copy
logic the total scanned source file count and size would be less than the
actually transferred file count and size.
Refer https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/610#note_991810
for more details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During a "merge" directory copy operation, when recursively merging
a directory to a destination directory that already contains some files
or subdirectories that are being copied, the "skip" flag is set
individually for those files or subdirectories. This correctly reduces
the count total files being copied for each file or subdirectory that
was skipped.
However, the "skipped" flag was then also being set for the parent
directory even though that directory was successfully copied (when
represented as a single file which is also included in the file count).
This ended up incorrectly reducing the total file count even though
the copied file count was incremented for that directory.
Change code to ensure that the "skipped" flag is not set for a
directory when one or more children are skipped.
|
|
|
|
|
| |
If we fail to get a destination GFile when copying or moving a file on
"google-drive:".
|
|
|
|
|
|
|
| |
During a move operation the "skipped" flag was not being set when there
was an error deleting the source directory after copying the source
directory to the new location if "skip-all-error" was selected during a
previous user interaction in the same operation.
|
| |
|
|
|
|
|
|
| |
Rename on_directory_conflicts_ready() to
on_directory_attributes_ready_for_conflicts_check() to be more
indicative of its purpose.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were spawning a background thread for performing the name conflict
check. Since the logic and data used for checking name conflicts
is not thread-safe we were executing the actual conflict check function
in the main thread (via g_main_context_invoke()). That routine in turn
ended up scheduling the actual work to execute in the callback
on_directory_conflicts_ready() per distinct parent directory. Thus
almost all the computationally intensive work was done via multiple
layers of indirection in the main thread.
Modify file_names_list_has_duplicates_async() to simply schedule the
actual name check function to be called per distict parent directory.
As before, most of the computationally intensive work is still done in
the callback registered via nautilus_directory_call_when_ready().
This greatly simplifies the design of the name conflict check by
eliminating the need for thread-safe synchronization of access and
modification of data that is used in the check.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When collecting distinct parent directories of selected files we were
accessing and possibly modifying the selected files GList from multiple
threads without any synchronization causing unpredictable corruption.
We were also performing operations in a background thread on
NautilusFile and NautilusDirectory which are not thread safe.
Identify distict parent dirs only once during dialog initialization and
store it in the instance struct because the selection does not change
during operation of the dialog. This eliminates thread-unsafe operations
when collecting and accessing the list of distinct parent directories.
Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1552
|
|
|
|
|
|
|
|
|
| |
The `fedora rawhide` CI job currently fails because of usage of the
`volatile` qualifier. Let's drop the `volatile` qualifier as it doesn't
help anyway. It was dropped in GLib as well, see:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1741
|
|
|
|
|
|
|
|
| |
The About dialog contains outdated list of authors, which seems
was not updated for some time. One option is to add new contributors
there, but it would be probably better to replace the list by
"The Files Authors" statement instead:
https://liferay.dev/blogs/-/blogs/how-and-why-to-properly-write-copyright-statements-in-your-code
|
|
|
|
|
|
|
|
| |
The About dialog currently contains the following copyright:
"© 1999–2018 The Files Authors", which looks a little bit outdated.
One option is to update the date, but it seems that it would be
better to remove it completely:
https://liferay.dev/blogs/-/blogs/how-and-why-to-properly-write-copyright-statements-in-your-code
|
| |
|
| |
|
|
|
|
|
| |
Bug introduced by me in commit 4f6013e7344f030da86aeed9d0d2e3b658a1a429
Found thanks to the criticals it was causing when leaving list view.
|
| |
|