[gnome-shell] StTextureCache: generate icon names in the right order
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] StTextureCache: generate icon names in the right order
- Date: Sun, 13 Mar 2011 13:46:55 +0000 (UTC)
commit 057348763b674c075f803122856c58ff338f67ff
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Sat Mar 12 23:27:57 2011 +0100
StTextureCache: generate icon names in the right order
GThemedIcon expects the first name to be the most specific, and
will thus prefer it to later ones. We thus need to order the names
from the longer to the shorter.
https://bugzilla.gnome.org/show_bug.cgi?id=621707
src/st/st-texture-cache.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index 405cc17..198ddf2 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -1398,10 +1398,11 @@ static char **
symbolic_names_for_icon (const char *name)
{
char **parts, **names;
- int i;
+ int i, numnames;
parts = g_strsplit (name, "-", -1);
- names = g_new (char *, g_strv_length (parts) + 1);
+ numnames = g_strv_length (parts);
+ names = g_new (char *, numnames + 1);
for (i = 0; parts[i]; i++)
{
if (i == 0)
@@ -1418,6 +1419,15 @@ symbolic_names_for_icon (const char *name)
names[i] = NULL;
g_strfreev (parts);
+
+ /* need to reverse here, because longest (most specific)
+ name has to come first */
+ for (i = 0; i < (numnames / 2); i++) {
+ char *tmp = names[i];
+ names[i] = names[numnames - i - 1];
+ names[numnames - i - 1] = tmp;
+ }
+
return names;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]