Updating branch refs/heads/master
         to 544de244c1537182c916de360198fbfc8b068e96 (commit)
       from 7417ccbb966e54f85387426c5d49f3f42854326f (commit)

commit 544de244c1537182c916de360198fbfc8b068e96
Author: Juha Kautto <j...@xfce.org>
Date:   Thu Dec 9 00:09:41 2010 +0200

    4.6.7.2: Several fixes for file handling
    
    Fixed Bugs
    6933 Incorrect config dir permissions
    6934 open orage calendar on click
    6936 Always segfault (panel plugin works)

 configure.in.in        |    2 +-
 src/appointment.c      |   11 +++++++----
 src/functions.c        |   14 +++++---------
 src/parameters.c       |    2 +-
 src/reminder.c         |    3 +--
 src/tz_zoneinfo_read.c |    2 ++
 6 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 22dbcd8..a9129f0 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <j...@xfce.org>
 dnl
 
 dnl Version information
-m4_define([orage_version], [4.7.6.1-git])
+m4_define([orage_version], [4.7.6.2-git])
 
 m4_define([gtk_minimum_version], [2.10.0])
 m4_define([xfce_minimum_version], [4.6.0])
diff --git a/src/appointment.c b/src/appointment.c
index a4faf84..5b17d42 100644
--- a/src/appointment.c
+++ b/src/appointment.c
@@ -1726,7 +1726,7 @@ void orage_category_get_list()
     pic1_cmap = gdk_colormap_get_system();
     orc = orage_category_file_open(TRUE);
     cat_groups = orage_rc_get_groups(orc);
-    for (i=1; cat_groups[i] != NULL; i++) {
+    for (i = 0; cat_groups[i] != NULL; i++) {
         orage_rc_set_group(orc, cat_groups[i]);
         color = orage_rc_get_str(orc, "Color", NULL);
         if (color) {
@@ -1756,14 +1756,13 @@ gboolean category_fill_cb(GtkComboBox *cb, char *select)
     OrageRc *orc;
     gchar **cat_gourps;
     gint i;
-    gboolean found=FALSE;
+    gboolean found = FALSE;
 
     orc = orage_category_file_open(TRUE);
     cat_gourps = orage_rc_get_groups(orc);
-    /* cat_groups[0] is special [NULL] entry always */
     gtk_combo_box_append_text(cb, _("Not set"));
     gtk_combo_box_set_active(cb, 0);
-    for (i=1; cat_gourps[i] != NULL; i++) {
+    for (i = 0; cat_gourps[i] != NULL; i++) {
         gtk_combo_box_append_text(cb, (const gchar *)cat_gourps[i]);
         if (!found && select && !strcmp(select, cat_gourps[i])) {
             gtk_combo_box_set_active(cb, i);
@@ -2398,6 +2397,8 @@ static void store_default_alarm(xfical_appt *appt)
     OrageRc *orc;
 
     orc = orage_alarm_file_open(FALSE);
+
+    orage_rc_set_group(orc, "DEFAULT ALARM");
     orage_rc_put_int(orc, "TIME", appt->alarmtime);
     orage_rc_put_bool(orc, "BEFORE", appt->alarm_before);
     orage_rc_put_bool(orc, "RELATED_START", appt->alarm_related_start);
@@ -2422,6 +2423,8 @@ static void read_default_alarm(xfical_appt *appt)
     OrageRc *orc;
 
     orc = orage_alarm_file_open(TRUE);
+
+    orage_rc_set_group(orc, "DEFAULT ALARM");
     appt->alarmtime = orage_rc_get_int(orc, "TIME", 5*60); /* 5 mins */
     appt->alarm_before = orage_rc_get_bool(orc, "BEFORE", TRUE);
     appt->alarm_related_start = orage_rc_get_bool(orc, "RELATED_START", TRUE);
diff --git a/src/functions.c b/src/functions.c
index 46ec480..986c8fb 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -753,7 +753,7 @@ gchar *orage_data_file_location(char *name)
 {
     char *file_name, *dir_name;
     const char *base_dir;
-    int mode = 700;
+    int mode = 0700;
 
     /*
     file_name = xfce_resource_save_location(XFCE_RESOURCE_DATA, name, TRUE);
@@ -766,7 +766,6 @@ gchar *orage_data_file_location(char *name)
     if (g_mkdir_with_parents(dir_name, mode)) {
         g_print("orage_data_file_location: (%s) (%s) directory creation 
failed.\n", base_dir, file_name);
     }
-    g_print("orage_data_file_location end (%s) (%s)\n", file_name, dir_name);
     g_free(dir_name);
 
     return(file_name);
@@ -776,7 +775,7 @@ gchar *orage_config_file_location(char *name)
 {
     char *file_name, *dir_name;
     const char *base_dir;
-    int mode = 700;
+    int mode = 0700;
 
     /*
     file_name = xfce_resource_save_location(XFCE_RESOURCE_CONFIG, name
@@ -790,7 +789,6 @@ gchar *orage_config_file_location(char *name)
     if (g_mkdir_with_parents(dir_name, mode)) {
         g_print("orage_config_file_location: (%s) (%s) directory creation 
failed.\n", base_dir, file_name);
     }
-    g_print("orage_config_file_location end (%s) (%s)\n", file_name, dir_name);
     g_free(dir_name);
 
     return(file_name);
@@ -864,7 +862,6 @@ void orage_rc_file_close(OrageRc *orc)
         /* xfce_rc_close((XfceRc *)orc->rc); */
         if (!orc->read_only) { /* need to write it */
             file_content = g_key_file_to_data(orc->rc, &length, NULL);
-            orage_message(150, "orage_rc_file_close: File (%s). String (%s)", 
orc->file_name, file_content);
             if (file_content 
             && !g_file_set_contents(orc->file_name, file_content, -1
                 , &error)) { /* write needed and failed */
@@ -891,7 +888,6 @@ gchar **orage_rc_get_groups(OrageRc *orc)
 void orage_rc_set_group(OrageRc *orc, char *grp)
 {
     /* xfce_rc_set_group((XfceRc *)orc->rc, grp); */
-    orage_message(150, "orage_rc_set_group: old group (%s) new group (%s).", 
orc->cur_group, grp);
     g_free((void *)orc->cur_group);
     orc->cur_group = g_strdup(grp);
 }
@@ -919,7 +915,6 @@ gchar *orage_rc_get_str(OrageRc *orc, char *key, char *def)
     gchar *ret;
 
     /* return(g_strdup(xfce_rc_read_entry((XfceRc *)orc->rc, key, def))); */
-        orage_message(150, "orage_rc_get_str: str (%s) group (%s) in RC file 
(%s) not found, using default (%s)", key, orc->cur_group, orc->file_name, def);
     ret = g_key_file_get_string((GKeyFile *)orc->rc, orc->cur_group
             , (const gchar *)key, &error);
     if (!ret && error) {
@@ -965,8 +960,9 @@ void orage_rc_put_str(OrageRc *orc, char *key, char *val)
     if (val != NULL)
         xfce_rc_write_entry((XfceRc *)orc->rc, key, val);
         */
-    g_key_file_set_string((GKeyFile *)orc->rc, orc->cur_group
-            , (const gchar *)key, (const gchar *)val);
+    if (ORAGE_STR_EXISTS(val))
+        g_key_file_set_string((GKeyFile *)orc->rc, orc->cur_group
+                , (const gchar *)key, (const gchar *)val);
 }
 
 void orage_rc_put_int(OrageRc *orc, char *key, gint val)
diff --git a/src/parameters.c b/src/parameters.c
index e218345..d4c0b44 100644
--- a/src/parameters.c
+++ b/src/parameters.c
@@ -957,7 +957,7 @@ OrageRc *orage_parameters_file_open(gboolean read_only)
 
     fpath = orage_config_file_location(ORAGE_PAR_DIR_FILE);
     if ((orc = orage_rc_file_open(fpath, read_only)) == NULL) {
-        orage_message(150, "orage_category_file_open: Parameter file open 
failed.");
+        orage_message(150, "orage_parameters_file_open: Parameter file open 
failed.(%s)", fpath);
     }
     g_free(fpath);
 
diff --git a/src/reminder.c b/src/reminder.c
index dc18510..71946d9 100644
--- a/src/reminder.c
+++ b/src/reminder.c
@@ -331,8 +331,7 @@ void alarm_read()
     time_now = orage_tm_time_to_icaltime(orage_localtime());
     orc = orage_persistent_file_open(TRUE);
     alarm_groups = orage_rc_get_groups(orc);
-    /* alarm_groups[0] is special [NULL] entry always */
-    for (i=1; alarm_groups[i] != NULL; i++) {
+    for (i = 0; alarm_groups[i] != NULL; i++) {
         orage_rc_set_group(orc, alarm_groups[i]);
         if ((new_alarm = alarm_read_next_alarm(orc, time_now)) != NULL) {
             create_reminders(new_alarm);
diff --git a/src/tz_zoneinfo_read.c b/src/tz_zoneinfo_read.c
index 5e7e096..c665fec 100644
--- a/src/tz_zoneinfo_read.c
+++ b/src/tz_zoneinfo_read.c
@@ -398,6 +398,8 @@ static int timezone_exists_in_ical()
     else
         return(0); /* not found */
 #else
+    if (!zones_tab_buf)
+        return(0);
     if ((str = strstr(zones_tab_buf, in_timezone_name)))
         return(1); /* yes, it is there */
     else
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to