Author: juha
Date: 2007-10-29 19:56:25 +0000 (Mon, 29 Oct 2007)
New Revision: 26218

Modified:
   xfcalendar/trunk/src/ical-code.c
   xfcalendar/trunk/src/ical-code.h
   xfcalendar/trunk/src/interface.c
Log:
bug fix: store file name when changed and clean file cache


Modified: xfcalendar/trunk/src/ical-code.c
===================================================================
--- xfcalendar/trunk/src/ical-code.c    2007-10-29 19:07:51 UTC (rev 26217)
+++ xfcalendar/trunk/src/ical-code.c    2007-10-29 19:56:25 UTC (rev 26218)
@@ -752,6 +752,8 @@
 #ifdef ORAGE_DEBUG
     g_print(P_N "\n");
 #endif
+    if (fical == NULL)
+        return(FALSE); /* closed already, nothing to do */
     icalset_free(fical);
     fical = NULL;
     /*
@@ -810,6 +812,26 @@
         }
 }
 
+void xfical_file_close_force(void)
+{
+#undef  P_N 
+#define P_N "xfical_file_close_force: "
+
+#ifdef ORAGE_DEBUG
+    g_print(P_N "\n");
+#endif
+    if (file_close_timer) { 
+            /* We are closing main ical file and delayed close is in progress. 
+             * Closing must be cancelled since we are now closing the file. */
+        g_source_remove(file_close_timer);
+        file_close_timer = 0;
+        /*
+        orage_message(P_N "canceling delayed close");
+        */
+    }
+    delayed_file_close(NULL);
+}
+
 void xfical_archive_close(void)
 {
 #undef  P_N 

Modified: xfcalendar/trunk/src/ical-code.h
===================================================================
--- xfcalendar/trunk/src/ical-code.h    2007-10-29 19:07:51 UTC (rev 26217)
+++ xfcalendar/trunk/src/ical-code.h    2007-10-29 19:56:25 UTC (rev 26218)
@@ -121,6 +121,7 @@
 
 gboolean xfical_file_open(gboolean foreign);
 void xfical_file_close(gboolean foreign);
+void xfical_file_close_force(void);
 
 xfical_appt *xfical_appt_alloc();
 char *xfical_appt_add(xfical_appt *app);

Modified: xfcalendar/trunk/src/interface.c
===================================================================
--- xfcalendar/trunk/src/interface.c    2007-10-29 19:07:51 UTC (rev 26217)
+++ xfcalendar/trunk/src/interface.c    2007-10-29 19:56:25 UTC (rev 26218)
@@ -205,6 +205,8 @@
             g_free(g_par.orage_file);
         g_par.orage_file = s;
         gtk_widget_set_sensitive(intf_w->orage_file_save_button, FALSE);
+        write_parameters(); /* store file name */
+        xfical_file_close_force(); /* close it so that we open new file */
     }
     else {
         g_free(s);
@@ -270,6 +272,7 @@
             g_free(g_par.archive_file);
         g_par.archive_file = s;
         gtk_widget_set_sensitive(intf_w->archive_file_save_button, FALSE);
+        write_parameters(); /* store file name */
     }
     else {
         g_free(s);

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to