Commit graph

25 commits

Author SHA1 Message Date
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
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
3e3bd830b5 eel: string: fix middle truncation test cases
f42979f0b0 changed the ellipsis to a
unicode one, which is one character in length, in turn changing the
expected output.

For cases where the truncation length is zero, the expected output is
changed to NULL, as 536505728e added an
assertion.
2018-03-21 10:05:45 +02:00
Ernestas Kulik
7447f62fc7 eel: string: remove custom strdup_printf functions
These aren’t used anywhere and cause Clang to spit out errors about
format strings not being literals.
2018-03-05 11:26:49 +02:00
Ernestas Kulik
9f9183d83e eel: string: remove tautological comparison 2018-03-05 11:26:49 +02:00
Ernestas Kulik
536505728e eel: string: refactor middle truncation
This commit tries to make the function more readable and fixes the allocation of
the new string: the truncated string is of the same size as the source string.
This can be fixed by adding a couple of different allocations. :)
Some comments were trimmed down or removed.
2018-02-27 08:59:08 +02:00
António Fernandes
f2f0947627 eel-string: Fix API comment
eel_string_ellispize_*() functions and eel-gdk-extension.h
are no more. This comment was totally outdated.

Replace it with actual API docs.
2018-02-06 22:59:21 +00:00
António Fernandes
f42979f0b0 eel-string: middle_truncate with ellipsis character.
Instead of 3 periods ("...")
2018-02-06 22:58:45 +00:00
Ernestas Kulik
61ac48bdc0 file-utilities: rework common prefix computation
Currently, the process for getting the common prefix of a list of file
names is a tad too greedy:
    1. Find the common prefix of all the strings.
    2. Strip the extension from the prefix.
    3. Strip trailing punctuation.

Step 2 may strip dots if there’s trailing whitespace and step 3 may
strip useful punctuation (e.g. parentheses). This commit reworks the
process as such:
    1. Strip the extension from all the file names.
    2. Find the common prefix of all the strings.
    3. Trim trailing whitespace.

Fixes #174.
2017-12-23 17:38:17 +02:00
Carlos Soriano
0abaab1c44 general: adjust uncrustify style
https://bugzilla.gnome.org/show_bug.cgi?id=770564
2016-09-06 15:41:06 +02:00
Carlos Soriano
52d960542b general: run uncrustify
And make the style of Nautilus the same for all files.
Hopefully we can fix all the style issues we can find in the next days,
so expect a little of movement on this.

https://bugzilla.gnome.org/show_bug.cgi?id=770564
2016-08-29 18:37:10 +02:00
Neil Herald
ca0e00b6b3 files-view: change "New Folder /w Selection" to offer a name
New Folder with Selection currently doesn't offer a folder name. It
would be better if it suggested a folder name based on the files that
are selected.

With this change, it now looks for a common filename prefix of the
selected files, and pre-populates the folder name entry with that. If no
common prefix is found that is greater than 3 characters long, the
folder name entry will be left blank.

https://bugzilla.gnome.org/show_bug.cgi?id=747907
2016-07-10 08:30:48 +01:00
Carlos Soriano
1ffb8ca593 general: remove vim modelines
Vim and emacs modelines are used to specify some of the code style in the code.
However, this is misleading and poorly supported since nautilus had a mix of
code style for some time.
Also, the mode lines doesn't specify the whole code style, so we will need to
use a different tool as well to specify the whole code style.
For that, we can just use a different tool for everything.

So remove the mode lines, and in a short future we will reestyle the nautilus
code to have a single code style, and use a tool like editorconfig to specify
the whole code style.
2016-04-04 18:08:36 +02:00
Daniel Mustieles
e314fbcc99 Updated FSF's address 2014-01-31 14:13:48 +01:00
William Jon McCann
3935384e7f Add a utf8 test to eel-string 2012-08-14 09:45:21 -04:00
Cosimo Cecchi
9de34580ae eel: remove unused code
All these functions are now unused and can be removed.
2012-04-11 12:14:41 -04:00
Cosimo Cecchi
0d46b0620b all: remove eel_g_hash_table_new_free_at_exit()
Especially when references can be owned by non-resident modules, this is
just too dangerous.

https://bugzilla.gnome.org/show_bug.cgi?id=670989
2012-03-07 21:04:51 -05:00
Cosimo Cecchi
45ee835907 eel-string: don't segfault in eel_str_replace_substring for NULL strings
Just check if the strings are != NULL before calling strlen() on them.
2011-10-25 13:19:17 -04:00
Cosimo Cecchi
bcc62bec90 eel-string: remove unused code 2011-10-05 12:30:09 -04:00
Cosimo Cecchi
e3f055c886 eel-string: don't use deprecated gatomic API 2011-06-03 17:42:09 -04:00
Alexander Larsson
1d48f02ea1 Add custom foreach to eel_g_hash_table_new_free_at_exit
This can be used to get some sort of printout for leaks in non-string
hashtables.
2011-03-25 14:35:43 +01:00
Alexander Larsson
75298a3ded Print leaked unique eel_ref_str:s at exit 2009-09-08 10:55:29 +02:00
Alexander Larsson
b698cf1932 Fix threadsafety issue in eel_ref_str_unref
Its not safe to just decrement count if we didn't read a 1, as we
could race with another decrement.
2009-09-08 10:54:35 +02:00
Alexander Larsson
7e668edf20 eel/ Import eel into nautilus.
2008-12-15  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * acconfig.h:
        * configure.in:
	* eel/
        * libnautilus-private/Makefile.am:
	Import eel into nautilus.


svn path=/trunk/; revision=14815
2008-12-15 15:56:41 +00:00