summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/eds
diff options
context:
space:
mode:
authorChris Lord <chris@openedhand.com>2005-10-03 15:35:48 +0000
committerChris Lord <chris@openedhand.com>2005-10-03 15:35:48 +0000
commite24bd6148e82717bfa544c4b0eaa7641638e8c87 (patch)
tree6ff0a5c5bc375a339875df474a9d7b3f145bd86d /openembedded/packages/eds
parent955635618900c5e8b78921687db97a39600a7a9f (diff)
downloadpoky-e24bd6148e82717bfa544c4b0eaa7641638e8c87.tar.gz
Modify calendar file backend not to use gnome-vfs (Dates works now)
git-svn-id: https://svn.o-hand.com/repos/poky@103 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/eds')
-rw-r--r--openembedded/packages/eds/eds-dbus/no_gnomevfs.patch10
-rw-r--r--openembedded/packages/eds/eds-dbus/no_gnomevfs3.patch392
-rwxr-xr-xopenembedded/packages/eds/eds-dbus_svn.bb3
3 files changed, 394 insertions, 11 deletions
diff --git a/openembedded/packages/eds/eds-dbus/no_gnomevfs.patch b/openembedded/packages/eds/eds-dbus/no_gnomevfs.patch
index 3a0fb8e7ec..ad4c2572c3 100644
--- a/openembedded/packages/eds/eds-dbus/no_gnomevfs.patch
+++ b/openembedded/packages/eds/eds-dbus/no_gnomevfs.patch
@@ -47,16 +47,6 @@ Index: configure.in
47 47
48 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS) 48 EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS)
49 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS) 49 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
50Index: calendar/backends/Makefile.am
51===================================================================
52--- trunk/calendar/backends/Makefile.am (revision 212)
53+++ trunk/calendar/backends/Makefile.am (working copy)
54@@ -4,4 +4,4 @@
55 GROUPWISE_SUBDIR =
56 endif
57
58-SUBDIRS = file $(GROUPWISE_SUBDIR) contacts
59+SUBDIRS = $(GROUPWISE_SUBDIR) contacts
60Index: calendar/libedata-cal-dbus/e-data-cal-factory.c 50Index: calendar/libedata-cal-dbus/e-data-cal-factory.c
61=================================================================== 51===================================================================
62--- trunk/calendar/libedata-cal-dbus/e-data-cal-factory.c (revision 206) 52--- trunk/calendar/libedata-cal-dbus/e-data-cal-factory.c (revision 206)
diff --git a/openembedded/packages/eds/eds-dbus/no_gnomevfs3.patch b/openembedded/packages/eds/eds-dbus/no_gnomevfs3.patch
new file mode 100644
index 0000000000..a9e911670a
--- /dev/null
+++ b/openembedded/packages/eds/eds-dbus/no_gnomevfs3.patch
@@ -0,0 +1,392 @@
1--- trunk/calendar/backends/file/e-cal-backend-file.c.old 2005-10-03 13:19:26.000000000 +0100
2+++ trunk/calendar/backends/file/e-cal-backend-file.c 2005-10-03 15:46:10.000000000 +0100
3@@ -29,7 +29,6 @@
4 #include <sys/stat.h>
5 #include <fcntl.h>
6 #include <glib/gi18n-lib.h>
7-#include <libgnomevfs/gnome-vfs.h>
8 #include <libedataserver/e-util.h>
9 #include <libedataserver/e-xml-hash-utils.h>
10 #include <libecal-dbus/e-cal-recur.h>
11@@ -106,17 +105,21 @@
12 g_free (obj_data);
13 }
14
15-/* Saves the calendar data */
16+static const char *
17+find_path_from_uri (const char *uri)
18+{
19+ g_assert (strncasecmp (uri, "file:", 5) == 0);
20+
21+ return uri + 5;
22+}
23+
24+ /* Saves the calendar data */
25 static gboolean
26 save_file_when_idle (gpointer user_data)
27 {
28 ECalBackendFilePrivate *priv;
29- GnomeVFSURI *uri, *backup_uri;
30- GnomeVFSHandle *handle = NULL;
31- GnomeVFSResult result = GNOME_VFS_ERROR_BAD_FILE;
32- GnomeVFSFileSize out;
33- gchar *tmp, *backup_uristr;
34- char *buf;
35+ const char *path, *buf;
36+ gboolean result;
37 ECalBackendFile *cbfile = user_data;
38
39 priv = cbfile->priv;
40@@ -130,52 +133,14 @@
41 return FALSE;
42 }
43
44- uri = gnome_vfs_uri_new (priv->uri);
45- if (!uri)
46+ path = find_path_from_uri (priv->uri);
47+ if (!path)
48 goto error_malformed_uri;
49
50- /* save calendar to backup file */
51- tmp = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
52- if (!tmp) {
53- gnome_vfs_uri_unref (uri);
54- goto error_malformed_uri;
55- }
56-
57- backup_uristr = g_strconcat (tmp, "~", NULL);
58- backup_uri = gnome_vfs_uri_new (backup_uristr);
59-
60- g_free (tmp);
61- g_free (backup_uristr);
62-
63- if (!backup_uri) {
64- gnome_vfs_uri_unref (uri);
65- goto error_malformed_uri;
66- }
67-
68- result = gnome_vfs_create_uri (&handle, backup_uri,
69- GNOME_VFS_OPEN_WRITE,
70- FALSE, 0666);
71- if (result != GNOME_VFS_OK) {
72- gnome_vfs_uri_unref (uri);
73- gnome_vfs_uri_unref (backup_uri);
74- goto error;
75- }
76-
77+ /* save calendar */
78 buf = icalcomponent_as_ical_string (priv->icalcomp);
79- result = gnome_vfs_write (handle, buf, strlen (buf) * sizeof (char), &out);
80- gnome_vfs_close (handle);
81- if (result != GNOME_VFS_OK) {
82- gnome_vfs_uri_unref (uri);
83- gnome_vfs_uri_unref (backup_uri);
84- goto error;
85- }
86-
87- /* now copy the temporary file to the real file */
88- result = gnome_vfs_move_uri (backup_uri, uri, TRUE);
89-
90- gnome_vfs_uri_unref (uri);
91- gnome_vfs_uri_unref (backup_uri);
92- if (result != GNOME_VFS_OK)
93+ result = g_file_set_contents (path, buf, -1, NULL);
94+ if (!result)
95 goto error;
96
97 priv->is_dirty = FALSE;
98@@ -193,7 +158,8 @@
99
100 error:
101 g_mutex_unlock (priv->idle_save_mutex);
102- e_cal_backend_notify_error (E_CAL_BACKEND (cbfile), gnome_vfs_result_to_string (result));
103+ e_cal_backend_notify_error (E_CAL_BACKEND (cbfile),
104+ _("Can't save calendar data: Error writing to file."));
105 return TRUE;
106 }
107
108@@ -310,7 +276,7 @@
109 return obj_data ? obj_data->full_object : NULL;
110 }
111
112-
113+
114
115 /* Calendar backend methods */
116
117@@ -592,14 +558,12 @@
118 }
119 }
120
121-static char *
122+G_GNUC_DEPRECATED static char *
123 get_uri_string_for_gnome_vfs (ECalBackend *backend)
124 {
125 ECalBackendFile *cbfile;
126 ECalBackendFilePrivate *priv;
127 const char *master_uri;
128- char *full_uri, *str_uri;
129- GnomeVFSURI *uri;
130
131 cbfile = E_CAL_BACKEND_FILE (backend);
132 priv = cbfile->priv;
133@@ -609,44 +573,41 @@
134 /* FIXME Check the error conditions a little more elegantly here */
135 if (g_strrstr ("tasks.ics", master_uri) || g_strrstr ("calendar.ics", master_uri)) {
136 g_warning (G_STRLOC ": Existing file name %s", master_uri);
137-
138 return NULL;
139 }
140
141- full_uri = g_strdup_printf ("%s%s%s", master_uri, G_DIR_SEPARATOR_S, priv->file_name);
142- uri = gnome_vfs_uri_new (full_uri);
143- g_free (full_uri);
144-
145- if (!uri)
146- return NULL;
147-
148- str_uri = gnome_vfs_uri_to_string (uri,
149- (GNOME_VFS_URI_HIDE_USER_NAME
150- | GNOME_VFS_URI_HIDE_PASSWORD
151- | GNOME_VFS_URI_HIDE_HOST_NAME
152- | GNOME_VFS_URI_HIDE_HOST_PORT
153- | GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD));
154- gnome_vfs_uri_unref (uri);
155+ return g_strdup_printf ("%s%s%s", master_uri, G_DIR_SEPARATOR_S, priv->file_name);
156+}
157
158- if (!str_uri || !strlen (str_uri)) {
159- g_free (str_uri);
160+/**
161+ * Get the full path to this calendar file.
162+ */
163+static char *
164+get_path (ECalBackend *backend)
165+{
166+ ECalBackendFile *cbfile;
167+ const char *topuri, *dirname;
168+ char *filename;
169
170- return NULL;
171- }
172+ g_return_val_if_fail (E_IS_CAL_BACKEND_FILE (backend), NULL);
173
174- return str_uri;
175+ cbfile = E_CAL_BACKEND_FILE (backend);
176+ topuri = e_cal_backend_get_uri (backend);
177+ dirname = find_path_from_uri (topuri);
178+ filename = g_build_filename (dirname, cbfile->priv->file_name, NULL);
179+ return filename;
180 }
181
182 /* Parses an open iCalendar file and loads it into the backend */
183 static ECalBackendSyncStatus
184-open_cal (ECalBackendFile *cbfile, const char *uristr)
185+open_cal (ECalBackendFile *cbfile, const char *path)
186 {
187 ECalBackendFilePrivate *priv;
188 icalcomponent *icalcomp;
189
190 priv = cbfile->priv;
191
192- icalcomp = e_cal_util_parse_ics_file (uristr);
193+ icalcomp = e_cal_util_parse_ics_file (path);
194 if (!icalcomp)
195 return GNOME_Evolution_Calendar_OtherError;
196
197@@ -759,7 +720,7 @@
198 }
199
200 static ECalBackendSyncStatus
201-reload_cal (ECalBackendFile *cbfile, const char *uristr)
202+reload_cal (ECalBackendFile *cbfile, const char *path)
203 {
204 ECalBackendFilePrivate *priv;
205 icalcomponent *icalcomp, *icalcomp_old;
206@@ -767,7 +728,7 @@
207
208 priv = cbfile->priv;
209
210- icalcomp = e_cal_util_parse_ics_file (uristr);
211+ icalcomp = e_cal_util_parse_ics_file (path);
212 if (!icalcomp)
213 return GNOME_Evolution_Calendar_OtherError;
214
215@@ -811,7 +772,7 @@
216 }
217
218 static ECalBackendSyncStatus
219-create_cal (ECalBackendFile *cbfile, const char *uristr)
220+create_cal (ECalBackendFile *cbfile, const char *path)
221 {
222 char *dirname;
223 ECalBackendFilePrivate *priv;
224@@ -819,7 +780,7 @@
225 priv = cbfile->priv;
226
227 /* Create the directory to contain the file */
228- dirname = g_path_get_dirname (uristr);
229+ dirname = g_path_get_dirname (path);
230 if (e_util_mkdir_hier (dirname, 0700) != 0) {
231 g_free (dirname);
232 return GNOME_Evolution_Calendar_NoSuchCal;
233@@ -840,18 +801,6 @@
234 return GNOME_Evolution_Calendar_Success;
235 }
236
237-static char *
238-get_uri_string (ECalBackend *backend)
239-{
240- gchar *str_uri, *full_uri;
241-
242- str_uri = get_uri_string_for_gnome_vfs (backend);
243- full_uri = gnome_vfs_unescape_string (str_uri, "");
244- g_free (str_uri);
245-
246- return full_uri;
247-}
248-
249 /* Open handler for the file backend */
250 static ECalBackendSyncStatus
251 e_cal_backend_file_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists,
252@@ -859,7 +808,7 @@
253 {
254 ECalBackendFile *cbfile;
255 ECalBackendFilePrivate *priv;
256- char *str_uri;
257+ char *filename;
258 ECalBackendSyncStatus status;
259
260 cbfile = E_CAL_BACKEND_FILE (backend);
261@@ -869,22 +818,20 @@
262 if (priv->uri && priv->comp_uid_hash)
263 return GNOME_Evolution_Calendar_Success;
264
265- str_uri = get_uri_string (E_CAL_BACKEND (backend));
266- if (!str_uri)
267- return GNOME_Evolution_Calendar_OtherError;
268-
269- if (access (str_uri, R_OK) == 0) {
270- status = open_cal (cbfile, str_uri);
271- if (access (str_uri, W_OK) != 0)
272+ filename = get_path (E_CAL_BACKEND (backend));
273+
274+ if (access (filename, R_OK) == 0) {
275+ status = open_cal (cbfile, filename);
276+ if (access (filename, W_OK) != 0)
277 priv->read_only = TRUE;
278 } else {
279 if (only_if_exists)
280 status = GNOME_Evolution_Calendar_NoSuchCal;
281 else
282- status = create_cal (cbfile, str_uri);
283+ status = create_cal (cbfile, filename); // TODO?
284 }
285
286- g_free (str_uri);
287+ g_free (filename);
288
289 return status;
290 }
291@@ -894,7 +841,7 @@
292 {
293 ECalBackendFile *cbfile;
294 ECalBackendFilePrivate *priv;
295- char *str_uri, *dirname;
296+ char *filename, *dirname;
297 const char *fname;
298 GDir *dir;
299 GError *error = NULL;
300@@ -903,21 +850,21 @@
301 cbfile = E_CAL_BACKEND_FILE (backend);
302 priv = cbfile->priv;
303
304- str_uri = get_uri_string (E_CAL_BACKEND (backend));
305- if (!str_uri)
306+ filename = get_path (E_CAL_BACKEND (backend));
307+ if (!filename)
308 return GNOME_Evolution_Calendar_OtherError;
309
310- if (access (str_uri, W_OK) != 0) {
311- g_free (str_uri);
312+ if (access (filename, W_OK) != 0) {
313+ g_free (filename);
314
315 return GNOME_Evolution_Calendar_PermissionDenied;
316 }
317
318 /* remove all files in the directory */
319- dirname = g_path_get_dirname (str_uri);
320+ dirname = g_path_get_dirname (filename);
321 dir = g_dir_open (dirname, 0, &error);
322 if (!dir) {
323- g_free (str_uri);
324+ g_free (filename);
325 g_free (dirname);
326
327 return GNOME_Evolution_Calendar_PermissionDenied;
328@@ -929,7 +876,7 @@
329 full_path = g_build_filename (dirname, fname, NULL);
330 if (unlink (full_path) != 0) {
331 g_free (full_path);
332- g_free (str_uri);
333+ g_free (filename);
334 g_free (dirname);
335 g_dir_close (dir);
336
337@@ -943,7 +890,7 @@
338 success = rmdir (dirname) == 0;
339
340 g_dir_close (dir);
341- g_free (str_uri);
342+ g_free (filename);
343 g_free (dirname);
344
345 return success ? GNOME_Evolution_Calendar_Success : GNOME_Evolution_Calendar_OtherError;
346@@ -1506,14 +1453,11 @@
347 EXmlHash *ehash;
348 ECalBackendFileComputeChangesData be_data;
349 GList *i;
350- gchar *unescaped_uri;
351
352 priv = cbfile->priv;
353
354 /* FIXME Will this always work? */
355- unescaped_uri = gnome_vfs_unescape_string (priv->uri, "");
356- filename = g_strdup_printf ("%s-%s.db", unescaped_uri, change_id);
357- g_free (unescaped_uri);
358+ filename = g_strdup_printf ("%s-%s.db", priv->uri, change_id);
359 if (!(ehash = e_xmlhash_new (filename))) {
360 g_free (filename);
361 return GNOME_Evolution_Calendar_OtherError;
362@@ -2577,23 +2521,23 @@
363 e_cal_backend_file_reload (ECalBackendFile *cbfile)
364 {
365 ECalBackendFilePrivate *priv;
366- char *str_uri;
367+ char *filename;
368 ECalBackendSyncStatus status;
369
370 priv = cbfile->priv;
371
372- str_uri = get_uri_string (E_CAL_BACKEND (cbfile));
373- if (!str_uri)
374+ filename = get_path (E_CAL_BACKEND (cbfile));
375+ if (!filename)
376 return GNOME_Evolution_Calendar_OtherError;
377
378- if (access (str_uri, R_OK) == 0) {
379- status = reload_cal (cbfile, str_uri);
380- if (access (str_uri, W_OK) != 0)
381+ if (access (filename, R_OK) == 0) {
382+ status = reload_cal (cbfile, filename);
383+ if (access (filename, W_OK) != 0)
384 priv->read_only = TRUE;
385 } else {
386 status = GNOME_Evolution_Calendar_NoSuchCal;
387 }
388
389- g_free (str_uri);
390+ g_free (filename);
391 return status;
392 }
diff --git a/openembedded/packages/eds/eds-dbus_svn.bb b/openembedded/packages/eds/eds-dbus_svn.bb
index 77ea4141da..6ddb91498b 100755
--- a/openembedded/packages/eds/eds-dbus_svn.bb
+++ b/openembedded/packages/eds/eds-dbus_svn.bb
@@ -4,12 +4,13 @@ RDEPENDS = "gtk+ gconf db libiconv"
4MAINTAINER = "Chris Lord <chris@openedhand.com>" 4MAINTAINER = "Chris Lord <chris@openedhand.com>"
5DESCRIPTION = "Evolution database backend server" 5DESCRIPTION = "Evolution database backend server"
6PV = "1.4.0cvs${CVSDATE}" 6PV = "1.4.0cvs${CVSDATE}"
7PR = "r5" 7PR = "r6"
8 8
9SRC_URI = "svn://svn.o-hand.com/repos/${PN};module=trunk;proto=http \ 9SRC_URI = "svn://svn.o-hand.com/repos/${PN};module=trunk;proto=http \
10 file://external_libdb.patch;patch=1 \ 10 file://external_libdb.patch;patch=1 \
11 file://no_gnomevfs.patch;patch=1 \ 11 file://no_gnomevfs.patch;patch=1 \
12 file://no_gnomevfs2.patch;patch=1 \ 12 file://no_gnomevfs2.patch;patch=1 \
13 file://no_gnomevfs3.patch;patch=1 \
13 file://no_iconv_test.patch;patch=1 \ 14 file://no_iconv_test.patch;patch=1 \
14 file://iconv-detect.h" 15 file://iconv-detect.h"
15 16