Merge lp://qastaging/~didrocks/unity/fix-711189 into lp://qastaging/unity

Proposed by Didier Roche-Tolomelli
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 824
Proposed branch: lp://qastaging/~didrocks/unity/fix-711189
Merge into: lp://qastaging/unity
Diff against target: 50 lines (+31/-2)
1 file modified
src/IconTexture.cpp (+31/-2)
To merge this branch: bzr merge lp://qastaging/~didrocks/unity/fix-711189
Reviewer Review Type Date Requested Status
Gord Allott (community) Needs Fixing
Review via email: mp+48760@code.qastaging.launchpad.net

Description of the change

Support incorrectly formated .desktop file when Icon=<filename>.extension (LP:
#711189)

To post a comment you must log in.
Revision history for this message
Gord Allott (gordallott) wrote :

When splitting the string your doing some manual splitting stuff. we should let glib do that, so i'll mark this as needs fixing

So instead of splitting the string manually and worrying me about leaking memory ;) - we should

gchar **foo = g_strsplit (_icon_name, ".", -1); // to get an array of strings split on .
g_free (foo [g_strv_length (foo) - 1]); // to remove the extension from the array of strings
stripped_icon_name = g_strjoinv (".", foo); //gets our final stripped icon name
g_strfreev (foo); // to free the previously created array of strings

This will also make sure we catch the case of "this.is.my.icon.png", which is horrible and anyone that does that should be shot, but that is linux for you.

review: Needs Fixing
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

ok, I was really hesitating between the two methods for splitting yesterday.

I was thining this one to be a little bit worse TBH, but if you prefer it, I have no strong opinion :)

And +1, I was really surprise to not find that into glib. copy-paste and merging :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.