[Goodies-commits] r2452 - xfce4-datetime-plugin/trunk/panel-plugin
Remco den Breeje
stacium at xfce.org
Sun Jan 21 16:47:28 CET 2007
Author: stacium
Date: 2007-01-21 15:47:28 +0000 (Sun, 21 Jan 2007)
New Revision: 2452
Modified:
xfce4-datetime-plugin/trunk/panel-plugin/datetime.c
Log:
Fixes bug where datetime formats read from the config-file are lost
Modified: xfce4-datetime-plugin/trunk/panel-plugin/datetime.c
===================================================================
--- xfce4-datetime-plugin/trunk/panel-plugin/datetime.c 2007-01-20 16:35:06 UTC (rev 2451)
+++ xfce4-datetime-plugin/trunk/panel-plugin/datetime.c 2007-01-21 15:47:28 UTC (rev 2452)
@@ -446,8 +446,6 @@
gint size,
t_datetime *datetime)
{
- DBG("set_size called! with new size of %d", size);
-
if(size > 26)
gtk_container_set_border_width(GTK_CONTAINER(datetime->frame), 2);
else
@@ -466,13 +464,14 @@
XfceRc *rc;
t_layout layout;
const gchar *date_font, *time_font, *date_format, *time_format;
+ const gchar *val;
/* load defaults */
layout = LAYOUT_DATE_TIME;
- date_font = "Bitstream Vera Sans 8";
- time_font = "Bitstream Vera Sans 10";
- date_format = "%Y/%m/%d";
- time_format = "%H:%M";
+ date_font = g_strdup("Bitstream Vera Sans 8");
+ time_font = g_strdup("Bitstream Vera Sans 10");
+ date_format = g_strdup("%Y/%m/%d");
+ time_format = g_strdup("%H:%M");
/* open file */
if((file = xfce_panel_plugin_lookup_rc_file(plugin)) != NULL)
@@ -483,10 +482,14 @@
if(rc != NULL)
{
layout = xfce_rc_read_int_entry(rc, "layout", layout);
- date_font = xfce_rc_read_entry(rc, "date_font", date_font);
- time_font = xfce_rc_read_entry(rc, "time_font", time_font);
- date_format = xfce_rc_read_entry(rc, "date_format", date_format);
- time_format = xfce_rc_read_entry(rc, "time_format", time_format);
+ val = xfce_rc_read_entry(rc, "date_font", date_font);
+ date_font = g_strdup(val);
+ val = xfce_rc_read_entry(rc, "time_font", time_font);
+ time_font = g_strdup(val);
+ val = xfce_rc_read_entry(rc, "date_format", date_format);
+ date_format = g_strdup(val);
+ val = xfce_rc_read_entry(rc, "time_format", time_format);
+ time_format = g_strdup(val);
xfce_rc_close(rc);
}
More information about the Goodies-commits
mailing list