Memos Component - submitted by Nathan Owens.
authorHarish Krishnaswamy <kharish@src.gnome.org>
Wed, 19 Oct 2005 09:59:51 +0000 (09:59 +0000)
committerHarish Krishnaswamy <kharish@src.gnome.org>
Wed, 19 Oct 2005 09:59:51 +0000 (09:59 +0000)
calendar/ChangeLog
calendar/libecal/e-cal.c
calendar/libecal/e-cal.h
calendar/tests/ecal/test-ecal.c

index 229fac8..aac2d6c 100644 (file)
@@ -1,3 +1,12 @@
+2005-10-19  Harish Krishnaswamy <kharish@novell.com>
+       
+       Committing for Nathan Owens <pianocomp81@yahoo.com>
+       
+       * libecal/e-cal.c: (e_cal_new_system_memos): added backend
+       support for Memos component. Finished implement VJOURNAL support
+       * libecal/e-cal.h: (e_cal_new_system_memos): added prototype
+       * tests/ecal/test-ecal.c: (test_new_system_memos): added memos test
+
 2005-10-10  Chenthill Palanisamy  <pchenthill@novell.com>
 
        Fixes #266144
index f6dafb2..31598cf 100644 (file)
@@ -1546,6 +1546,19 @@ e_cal_new_system_tasks (void)
        return ecal;
 }
 
+ECal *
+e_cal_new_system_memos (void)
+{
+       ECal *ecal;
+       char *uri;
+
+       uri = g_build_filename ("file://", g_get_home_dir (), ".evolution", "memos", "local", "system", NULL);
+       ecal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_JOURNAL);
+       g_free (uri);
+       
+       return ecal;
+}
+
 /**
  * e_cal_set_auth_func
  * @ecal: A calendar client.
@@ -2876,7 +2889,8 @@ e_cal_get_object (ECal *ecal, const char *uid, const char *rid, icalcomponent **
                } else {
                        kind = icalcomponent_isa (tmp_icalcomp);
                        if ((kind == ICAL_VEVENT_COMPONENT && priv->type == E_CAL_SOURCE_TYPE_EVENT) ||
-                           (kind == ICAL_VTODO_COMPONENT && priv->type == E_CAL_SOURCE_TYPE_TODO)) {
+                           (kind == ICAL_VTODO_COMPONENT && priv->type == E_CAL_SOURCE_TYPE_TODO) ||
+                           (kind == ICAL_VJOURNAL_COMPONENT && priv->type == E_CAL_SOURCE_TYPE_JOURNAL)) {
                                *icalcomp = icalcomponent_new_clone (tmp_icalcomp);
                        } else if (kind == ICAL_VCALENDAR_COMPONENT) {
                                icalcomponent *subcomp = NULL;
@@ -5328,6 +5342,9 @@ e_cal_get_sources (ESourceList **sources, ECalSourceType type, GError **error)
        case E_CAL_SOURCE_TYPE_TODO:
                return get_sources (sources, "/apps/evolution/tasks/sources", error);
                break;
+       case E_CAL_SOURCE_TYPE_JOURNAL:
+               return get_sources (sources, "/apps/evolution/memos/sources", error);
+               break;
        default:
                /* FIXME Fill in error */
                return FALSE;
index 876c91f..7e12bfb 100644 (file)
@@ -104,6 +104,7 @@ ECal *e_cal_new (ESource *source, ECalSourceType type);
 ECal *e_cal_new_from_uri (const gchar *uri, ECalSourceType type);
 ECal *e_cal_new_system_calendar (void);
 ECal *e_cal_new_system_tasks (void);
+ECal *e_cal_new_system_memos (void);
 
 void e_cal_set_auth_func (ECal *ecal, ECalAuthFunc func, gpointer data);
 
index 2cf96de..9c919ff 100644 (file)
@@ -475,6 +475,23 @@ test_new_system_tasks()
 }
 
 static char *
+test_new_system_memos()
+{
+       ECal *cal;
+       char *uri;
+       gboolean created;
+       
+       cal = e_cal_new_system_memos ();
+       uri = g_build_filename (g_get_home_dir (), ".evolution", "memos", "local", "system", "journal.ics", NULL);
+       created = g_file_test (uri, G_FILE_TEST_EXISTS);
+       g_free (uri);
+       
+       mu_assert ("Test creation of default system memos : Failed", created);
+       
+       return NULL;
+}
+
+static char *
 test_get_free_busy (ECal *client)
 {
        // TODO uses NULL for users and currently specific to file backend.
@@ -608,6 +625,7 @@ all_tests(ECal *client, const gchar *uri)
                
        mu_run_test (test_new_system_calendar ());
        mu_run_test (test_new_system_tasks ());
+       mu_run_test (test_new_system_memos ());
        mu_run_test (test_set_uri (client, uri));
        mu_run_test (test_get_source (client, uri));
        mu_run_test (test_cal_loaded (client));