1
0
mirror of https://gitlab.gnome.org/GNOME/nautilus synced 2024-07-04 17:30:47 +00:00
Commit Graph

352 Commits

Author SHA1 Message Date
Peter Eisenmann
bab0d708cf general: remove eel-vfs-extensions 2023-11-16 02:36:20 +01:00
Peter Eisenmann
134468da3f filename-util: add extension offset helper
Add `nautilus_filename_get_extension_offset` to calculate the offset in
characters to the extension of a file name. Use it to replace and remove
`eel_filename_get_rename_region`.
2023-11-16 01:25:18 +00:00
Peter Eisenmann
ba8a8fd373 general: remove eel-debug
Oversight from https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1319
where this was forgotten.
2023-11-16 01:25:18 +00:00
Peter Eisenmann
8c21a037fc general: remove self-checking functionality
All self-checking tests were converted into unittests. Remove the
"--check" parameter along with all code related to self-checking.
2023-10-31 22:19:46 +00:00
Peter Eisenmann
095664a420 filename-util: integrate common prefix detection
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.
2023-10-31 22:19:46 +00:00
Peter Eisenmann
f5633d1ea7 ui-util: integrate string capitalization function
Integrate `eel_str_capitalize` as `nautilus_capitalize_str` into ui utilities
and turn the self-check functionality into a unittest.
2023-10-31 22:19:46 +00:00
Peter Eisenmann
43b6c59148 general: remove unused eel-string includes 2023-10-31 22:19:46 +00:00
Peter Eisenmann
4d3ad41a5c filename-util: add extension detector
The new `nautilus_filename_get_extension` function is similar to the
previous `eel_filename_get_extension_offset` function, but differs
in some ways:
 * It does not accept NULL
 * It returns a pointer to \0 rather than NULL when no extension
   can be found.
 * It detects .tar.* extensions without needing a maintained list.

In the one place it was used, replace `nautilus_file_get_extension`
by instead calling `nautilus_filename_get_extension` on the file name.
Migrate usages of the previous eel function to use the new function
and remove the eel function from the header file (It is still used
in the .c file).

Also unittests.
2023-10-31 22:19:46 +00:00
António Fernandes
f86c068dc4 vfs-extensions: make space check UTF-8 compatible
The added iterating of 678836bbfc does not
work for UTF-8 strings, which file names generally are. This fixes this
by using appropriate UTF-8 functionality of GLib.
2023-10-28 13:25:55 +02:00
Peter Eisenmann
678836bbfc vfs-extensions: don't allow whitespaces in extension
Whitespaces in file extensions are not (commonly) used, it's more
likely in cases where a whitespaces occurs after a dot, that the
dot does not indicatie an extension at all.

This change prevents such incorrect extension detections by
checking for whitespaces, and adjusts a self-check test that tested
for the previous behavior.
2023-10-27 23:54:53 +00:00
António Fernandes
97b4fccc03 eel-vfs-extensions: Erradicate EEL_SEARCH_URI 2023-08-09 12:06:45 +01:00
António Fernandes
c1194a8d77 scheme: Always use macro for trash scheme
This makes it easy to grep for every situation we special case the trash.

Also add nautilus_is_root_for_scheme() which is going to be used more in
next commits.
2023-08-09 12:06:13 +01:00
Peter Eisenmann
3a047dc39a eel: compare schemes without uri_is_* functions
Use g_uri_peek_scheme and compare with predefined schemes.
2023-08-03 20:37:45 +01:00
Peter Eisenmann
62c2d338a7 eel: remove unused struct and enum 2023-07-20 17:52:47 +00:00
Peter Eisenmann
9e7353e180 eel: use g_utf8_truncate_middle()
Use upstreamed g_utf8_truncate_middle() over eel_str_middle_truncate().
2023-07-20 17:52:47 +00:00
Peter Eisenmann
2d28cc235b eel: use g_string_replace over eel functionality
Use g_string_replace over eel_str_replace_substring and
eel_str_double_underscores.

Remove the now unused eel* functions.

Bump glib version to 2.76 for g_string_free_and_steal().
2023-07-20 17:52:47 +00:00
Peter Eisenmann
b5dcb9e124 file: use g_strsplit for real name creation
Instead of homebaked eel_str_strip_substring_and_after, use g_strsplit()
to parse pw entries into user names.

Remove the now unused eel* function.
2023-07-20 17:52:47 +00:00
Barnabás Pőcze
427faf9ebd general: Change libadwaita include path
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
2023-02-19 03:24:55 +00:00
Peter Eisenmann
16e3e6ddd3 eel: remove eel-glib-extensions.h
Replace the eel_boolean_bit typedef with a plain guint and remove all
includes.
2022-12-23 17:42:34 +00:00
Peter Eisenmann
10198a8174 eel: remove more unused functionality 2022-12-23 17:42:34 +00:00
Corey Berla
5d1fcf1e77 eel: Remove unused files
Usage was generally removed in 2d1deaac2d
2022-12-23 17:42:34 +00:00
António Fernandes
0c0e92a0ea eel-string: Support Unicode when capitalizing first character
And use this instead of g_ascii_to_upper() in app-chooser.c

This is more i18n-friendly.
2022-08-08 21:37:53 +00:00
Christopher Davis
021f0d828d eel-stock-dialogs: Use AdwMessageDialog for timed wait 2022-08-06 19:35:00 +01:00
Christopher Davis
2bfc3f3584 eel-stock-dialogs: Remove message dialogs
Now that we have AdwMessageDialog to provide a GNOME-compliant
message dialog API, we don't need the functions from eel.
This commit removes all of the functions for creating
dialogs from eel-stock-dialogs.
2022-08-06 19:35:00 +01:00
Peter Eisenmann
856803f9d6 general: Delete no longer needed git ignores
Meson builds out-of-tree, these ignored files will never get created in
these directories. If they do, it indicates a build configuration error
and should not be hidden.
2022-07-17 23:51:03 +00:00
Ondrej Holy
e55613a582 eel-stock-dialogs: Remove unused functionality
Some functions are no more used. Let's remove them instead of fixing
GTK 4 regressions in them.

Related: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2117
2022-02-07 16:41:05 +00:00
Ondrej Holy
7cad82c9d1 general: Make message dialogs modal again
After the GTK 4 port, some dialogs are no more modal. This is regression,
which is probably caused by the fact, that this needs to be explicitly
specified now. Let's make all the `GtkMessageDialog` dialogs modal again.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2117
2022-02-07 16:41:05 +00:00
António Fernandes
e358c2343c general: Switch to GTK4
The new major version of the toolkit is a requirement to fix old issues and enable future enhancements.

Update symbols and adapt logic to API changes.
Update and simplify UI definitions.
Update local copy of places sidebar and places view.
Replace dependencies with their GTK4-compatible successors.
Make a minimum changes required to build and run, with known
regressions to be fixed in future commits.

For a detailed breakup of the changes, see the 36 commits-deep
log leading to d5763facb1e5045251171ed1273dca0859f3542f.

This is the main part of https://gitlab.gnome.org/GNOME/nautilus/-/issues/276
2022-01-09 01:25:39 +00:00
António Fernandes
23cb15d8ee eel: Drop gtk extensions
No longer used.
2022-01-05 11:32:12 +00:00
António Fernandes
8d974ecc60 files-view: Drop NAUTILUS_SCRIPT_WINDOW_GEOMETRY envar
It relies on X11-only information, such as the window position on the
screen, which is not known to the application under Wayland.
So, this was already broken.

Also, its implementation relies on GtkWindow API which is gone in GTK 4.
2022-01-05 11:32:12 +00:00
António Fernandes
2d1deaac2d general: Remove canvas view
The new grid view has reached feature parity with the canvas, if we
ignore drag-and-drop and clipboard support (which would need to be
reimplemented in GTK 4 anyway) and performance scalability (which is
a problem of GtkFlowBox and solvable by using GtkGridView in GTK 4).

The canvas view relies on extensive custom implementation for layout,
drawing, input handling, accessibility, etc., which would be too
hard to port to in GT1K4.

Furthermore, most of its features, such as support for manual sorting,
haven't been used since the "icons on desktop" feature has been taken
out from this app. We are actually using a swiss army knife for a job
where we only need a single blade -- a simple pocketknife would do!

Therefore, we say goodbye to this seasoned veteran widget, who has
served us for 2 whole decades.
2021-12-29 11:39:32 +00:00
António Fernandes
130a676b08 eel-stock-dialogs: Start and end va_list
This got lost in the refactoring and results in it not being initialized.
Thanks to Abderrahim Kitouni for reporting.
2021-12-29 11:14:06 +00:00
Matthew Jakeman
b85def1615 eel-stock-dialogs: Remove eel_run_simple_dialog
This method is no longer used anywhere and can be
safely removed.

Part of #1992
2021-12-28 23:08:39 +00:00
Matthew Jakeman
67812f918d eel-stock-dialogs: Add eel_show_simple_dialog
Extracts the creation of simple dialogs to a new function
that does not depend on gtk_dialog_run. It is the caller's
responsibility to obtain a response from the dialog.

Part of #1992
2021-12-28 23:04:20 +00:00
António Fernandes
8c31d783ba general: Use envar to make warnings fatal in scripts
Same rationale as last commit.
2021-11-12 01:40:05 +00:00
António Fernandes
619970b1e8 general: Uniformize case code style
There are a few non-braced single-statement in the final cases, which
have  gone unnoticed until detected by a recent uncrustify update.

Let's add the missing braces around single-statements even if it's the
last case.
2021-07-11 22:05:51 +00:00
António Fernandes
e9e026df88 eel-vfs-extensions: Document get_extension_offset
Mostly to remember callers must be ready to handle a NULL return value,
trying to prevent more bugs like the one fixed by the previous commit.
2021-04-30 11:52:45 +01:00
Joshua Lee
d275c8bde1 general: Clean up signal handler disconnection
Make use of GLib's new g_clear_signal_handler() function to simplify nautilus'
signal handler disconnection and reduce unneccessary code.

Fixes: #1522
2020-07-08 19:37:24 +01:00
Marvin Schmidt
294c89d0f3 meson: Remove libX11 dependency
As of commit 70393e321 (general: Allow to compile on Wayland-only
system) libX11 is no longer a dependency
2020-05-01 19:39:03 +00:00
Ondrej Holy
fd2e7dfdea general: Run uncrustify script
There are some style issue since the last run. Let's run it again
before enabling style-check CI job.
2020-04-05 16:22:26 +00:00
Ondrej Holy
b477a7026c eel: Add redundant parentheses to prevent changes by uncrustify
Uncrustify changes "(*pixsrc++ * *pixdest)" to "(*pixsrc++ **pixdest)"
which is unwanted. Let's add redundant parentheses around "*pixdest" to
prevent these unwanted changes.
2020-04-05 16:22:26 +00:00
Vilhelm Prytz
ba24423344 eel-canvas: Remove redundant comparison
Comparison is always false because positions >= 1

Makes comparison redundant
2020-03-29 19:43:26 +00:00
Abdul Rauf
2a741d9617
files-view: Say "Trash is Empty" only in trash:///
Empty trash widget is displaying for empty folder inside trash
instead of Empty folder widget.

`eel_uri_is_trash` only checks whether the URI starts with "trash:",
that's why it also returns true for empty folders inside trash.

Create `eel_uri_is_trash_root` to distinguish trash root (trash:///)
from empty folder inside trash (trash:///emptyfolder)

Closes https://gitlab.gnome.org/GNOME/nautilus/issues/1367
2020-02-15 14:16:03 +05:00
Javier Jardón
70393e321c general: Allow to compile on Wayland-only system
Remove unneeded includes and add some guards to X11-only code.
2019-12-01 00:11:24 +09:00
florin.diaconescu
11da28bcfe eel: string: Add documentation
This commit adds comments describing the functionality,
the parameters and the return values of the functions that were not
documented.
2019-05-27 11:42:43 +02:00
Carlos Soriano
e03376b9d8 eel-graphic-effects: Make hover light less intense
With the new icons most of the area was white.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/827
2019-02-22 14:44:16 +00:00
Jordan Petridis
b4d200fed3 file: replace eel_ref_str with GRefString
glib now offers a reference counted api.
This allows us to replace a lot of legacy code and get rid of
eel_ref_str. GRefString [1] is almost a drop-in replacement.

nautilus-file-operations.c was indirectly depending upon
eel/eel-string.h from nautilus-file-private.h and thus
a new include was added.

This bumps the minimum version of glib to 2.58

Close #781
https://gitlab.gnome.org/GNOME/nautilus/issues/781

[1] https://developer.gnome.org/glib/stable/glib-Reference-counted-strings.html
2019-02-22 11:29:57 +00:00
ionbabalau
d4983562d6 eel-string: Add description to some eel-string functions
The eel_str_double_underscores and eel_str_capitalize
functions didn't have documentation.
Added importance of eel_str_double_underscores as well.

It's good practice to have documentation for functions
in the long term.
2018-10-29 15:57:26 +00:00
Ernestas Kulik
487213ad9b canvas-item: Drop gtk_style_context_get_background_color()
Even though more convoluted than the previous solution, this one
should last longer. Canvas item icons are now colorized by first drawing
the background to a Cairo surface and then multiplying the color values
of the original icon pixbuf and the ones from the newly created one.
2018-05-30 11:39:13 +03:00
Ernestas Kulik
0a6e406344 eel: Remove superfluous include
gdk/gdkprivate.h is no longer a thing in GTK+ 4 and doesn’t seem to be
at all required.
2018-05-28 13:13:56 +03:00