[tracker/wip/carlosg/term-ellipsizing] libtracker-common: Flip ellipsizing
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/term-ellipsizing] libtracker-common: Flip ellipsizing
- Date: Thu, 4 Feb 2021 22:39:28 +0000 (UTC)
commit e7e9e2432e98da8b0b99c6c5c292b7505ed6c1b8
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Feb 4 23:37:59 2021 +0100
libtracker-common: Flip ellipsizing
Due to some brain fart, ellipsizing was made to cut the string the
opposite way around to the given TRACKER_ELLIPSIZING_* value. Go
for the minimal fix and fully flip the condition/strings.
src/libtracker-common/tracker-term-utils.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-common/tracker-term-utils.c b/src/libtracker-common/tracker-term-utils.c
index d619d209d..0089fd3a6 100644
--- a/src/libtracker-common/tracker-term-utils.c
+++ b/src/libtracker-common/tracker-term-utils.c
@@ -56,13 +56,13 @@ tracker_term_ellipsize (const gchar *str,
begin = str;
end = &str[size];
- if (mode == TRACKER_ELLIPSIZE_START) {
+ if (mode == TRACKER_ELLIPSIZE_END) {
pos = begin;
for (i = 0; i < max_len; i++)
pos = g_utf8_find_next_char (pos, end);
substr = g_strndup (begin, pos - begin);
- retval = g_strdup_printf ("…%s", substr);
+ retval = g_strdup_printf ("%s…", substr);
g_free (substr);
} else {
pos = end;
@@ -70,7 +70,7 @@ tracker_term_ellipsize (const gchar *str,
pos = g_utf8_find_prev_char (begin, pos);
substr = g_strndup (pos, end - pos);
- retval = g_strdup_printf ("%s…", substr);
+ retval = g_strdup_printf ("…%s", substr);
g_free (substr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]