Mercurial > geeqie
comparison src/layout.c @ 269:dca6c0b9f862
Simplify layout_color_name_parse() using g_strdelimit().
author | zas_ |
---|---|
date | Tue, 08 Apr 2008 14:52:42 +0000 |
parents | 98268a6b8182 |
children | 67db7e4505c6 |
comparison
equal
deleted
inserted
replaced
268:98268a6b8182 | 269:dca6c0b9f862 |
---|---|
364 layout_image_refresh(lw); | 364 layout_image_refresh(lw); |
365 } | 365 } |
366 | 366 |
367 static gchar *layout_color_name_parse(const gchar *name) | 367 static gchar *layout_color_name_parse(const gchar *name) |
368 { | 368 { |
369 gchar *result; | 369 if (!name) return g_strdup(_("Empty")); |
370 gchar *p; | 370 return g_strdelimit(g_strdup(name), "_", '-'); |
371 | |
372 if (!name) name = _("Empty"); | |
373 | |
374 result = g_strdup(name); | |
375 p = result; | |
376 while (*p != '\0') | |
377 { | |
378 if (*p == '_') *p = '-'; | |
379 p++; | |
380 } | |
381 return result; | |
382 } | 371 } |
383 | 372 |
384 static void layout_color_button_press_cb(GtkWidget *widget, gpointer data) | 373 static void layout_color_button_press_cb(GtkWidget *widget, gpointer data) |
385 { | 374 { |
386 LayoutWindow *lw = data; | 375 LayoutWindow *lw = data; |