Code review comment for lp://qastaging/~didrocks/unity/fix-711189

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

« Back to merge proposal