summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2006-06-16 02:44:40 +0000
committerTor Lillqvist <tml@src.gnome.org>2006-06-16 02:44:40 +0000
commit8c8981fb5be1130555b03133051c3acc100e0182 (patch)
tree5ad01ff0d6609553cd2857702b672e4fe8455582
parent0570c92a7233ab3e4872d2444e81a5ee6c953209 (diff)
downloadevolution-data-server-8c8981fb5be1130555b03133051c3acc100e0182.tar.gz
Make addressbook work on Win32 also with non-ASCII chars in home directory
2006-06-16 Tor Lillqvist <tml@novell.com> Make addressbook work on Win32 also with non-ASCII chars in home directory name. * backends/file/e-book-backend-file.c (my_exists, my_rename) (my_unlink): Need to wrap more file name using functions in libdb. (e_book_backend_file_class_init): Register the above with libdb.
-rw-r--r--addressbook/ChangeLog9
-rw-r--r--addressbook/backends/file/e-book-backend-file.c30
2 files changed, 38 insertions, 1 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 1f6625198..084d9dd86 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,12 @@
+2006-06-16 Tor Lillqvist <tml@novell.com>
+
+ Make addressbook work on Win32 also with non-ASCII chars in home
+ directory name.
+
+ * backends/file/e-book-backend-file.c (my_exists, my_rename)
+ (my_unlink): Need to wrap more file name using functions in libdb.
+ (e_book_backend_file_class_init): Register the above with libdb.
+
2006-06-15 Andre Klapper <a9016009@gmx.de>
* libebook/e-book.c:
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index 29d101ebb..f27ab5557 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -1371,6 +1371,29 @@ my_open (const char *name, int oflag, ...)
return g_open (name, oflag, mode);
}
+
+int
+my_rename (const char *oldname, const char *newname)
+{
+ return g_rename (oldname, newname);
+}
+
+int
+my_exists (const char *name, int *isdirp)
+{
+ if (!g_file_test (name, G_FILE_TEST_EXISTS))
+ return ENOENT;
+ if (isdirp != NULL)
+ *isdirp = g_file_test (name, G_FILE_TEST_IS_DIR);
+ return 0;
+}
+
+int
+my_unlink (const char *name)
+{
+ return g_unlink (name);
+}
+
#endif
static void
@@ -1407,9 +1430,14 @@ e_book_backend_file_class_init (EBookBackendFileClass *klass)
object_class->dispose = e_book_backend_file_dispose;
#ifdef G_OS_WIN32
- /* Use the gstdio wrapper for open() to open files in libdb */
+ /* Use the gstdio wrappers to open, check, rename and unlink
+ * files from libdb.
+ */
db_env_set_func_open (my_open);
db_env_set_func_close (close);
+ db_env_set_func_exists (my_exists);
+ db_env_set_func_rename (my_rename);
+ db_env_set_func_unlink (my_unlink);
#endif
}