Tilman Sauerbeck wrote:
Morten Nilsen [2005-12-02 06:23]:
With the recent checkin of the gadget stuff in CVS, I suddenly got this idea to implement a gadget that tells you of new mail in a more clean way than the current alternative does..

The current alternative is as clean as it can be.

well, embrace uses edb ... I just wrote a patch to convert to using ecore_config..

untested (but compiled) patch attached

Cheers,
--
Morten
Index: configure.ac
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/configure.ac,v
retrieving revision 1.18
diff -u -r1.18 configure.ac
--- configure.ac        13 Oct 2005 22:13:14 -0000      1.18
+++ configure.ac        4 Dec 2005 03:56:04 -0000
@@ -107,9 +107,6 @@
 AC_PATH_GENERIC(ecore, , ,
        AC_MSG_ERROR(Cannot find ecore: Is ecore-config in path?))
 
-AC_PATH_GENERIC(edb, , ,
-       AC_MSG_ERROR(Cannot find edb: Is edb-config in path?))
-
 AC_PATH_GENERIC(evas, , ,
        AC_MSG_ERROR(Cannot find evas: Is evas-config in path?))
 
Index: data/create_embrace_cfg.sh
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/data/create_embrace_cfg.sh,v
retrieving revision 1.6
diff -u -r1.6 create_embrace_cfg.sh
--- data/create_embrace_cfg.sh  29 Jan 2005 14:51:36 -0000      1.6
+++ data/create_embrace_cfg.sh  4 Dec 2005 03:56:04 -0000
@@ -1,8 +1,8 @@
 #!/bin/sh
 
 NAME=embrace
-CONFIGPATH=~/.e/apps/embrace
-DB=$CONFIGPATH/$NAME.db
+CONFIGPATH=~/.e/apps/$NAME
+DB=$CONFIGPATH/$NAME.eet
 
 # generic mandatory attributes:
 # * title
@@ -20,30 +20,30 @@
 
 mkdir -p $CONFIGPATH
 
-edb_ed $DB add /$NAME/theme str "default"
-edb_ed $DB add /$NAME/num_mailboxes int 4
+ecore_config $DB set /$NAME/theme str "default"
+ecore_config $DB set /$NAME/num_mailboxes int 4
 
-edb_ed $DB add /$NAME/mailbox1/title str "inbox"
-edb_ed $DB add /$NAME/mailbox1/path str "~/Mail/inbox"
-edb_ed $DB add /$NAME/mailbox1/type str "maildir"
-
-edb_ed $DB add /$NAME/mailbox2/title str "e-cvs"
-edb_ed $DB add /$NAME/mailbox2/path str "~/Mail/enlightenment-cvs"
-edb_ed $DB add /$NAME/mailbox2/type str "mbox"
-
-edb_ed $DB add /$NAME/mailbox3/title str "my pop3 box"
-edb_ed $DB add /$NAME/mailbox3/host str "foo.bar.com"
-edb_ed $DB add /$NAME/mailbox3/port int 123
-edb_ed $DB add /$NAME/mailbox3/type str "pop3"
-edb_ed $DB add /$NAME/mailbox3/user str "myuser"
-edb_ed $DB add /$NAME/mailbox3/pass str "mypass"
-edb_ed $DB add /$NAME/mailbox3/ssl int 1 
-
-edb_ed $DB add /$NAME/mailbox4/title str "my imap mailbox"
-edb_ed $DB add /$NAME/mailbox4/host str "foo.bar.com"
-edb_ed $DB add /$NAME/mailbox4/port int 143
-edb_ed $DB add /$NAME/mailbox4/type str "imap"
-edb_ed $DB add /$NAME/mailbox4/user str "myuser"
-edb_ed $DB add /$NAME/mailbox4/pass str "mypass"
-edb_ed $DB add /$NAME/mailbox4/path str "path.to.mailbox"
-edb_ed $DB add /$NAME/mailbox4/ssl int 1
+ecore_config $DB set /$NAME/mailbox1/title str "inbox"
+ecore_config $DB set /$NAME/mailbox1/path str "~/Mail/inbox"
+ecore_config $DB set /$NAME/mailbox1/type str "maildir"
+
+ecore_config $DB set /$NAME/mailbox2/title str "e-cvs"
+ecore_config $DB set /$NAME/mailbox2/path str "~/Mail/enlightenment-cvs"
+ecore_config $DB set /$NAME/mailbox2/type str "mbox"
+
+ecore_config $DB set /$NAME/mailbox3/title str "my pop3 box"
+ecore_config $DB set /$NAME/mailbox3/host str "foo.bar.com"
+ecore_config $DB set /$NAME/mailbox3/port int 123
+ecore_config $DB set /$NAME/mailbox3/type str "pop3"
+ecore_config $DB set /$NAME/mailbox3/user str "myuser"
+ecore_config $DB set /$NAME/mailbox3/pass str "mypass"
+ecore_config $DB set /$NAME/mailbox3/ssl int 1 
+
+ecore_config $DB set /$NAME/mailbox4/title str "my imap mailbox"
+ecore_config $DB set /$NAME/mailbox4/host str "foo.bar.com"
+ecore_config $DB set /$NAME/mailbox4/port int 143
+ecore_config $DB set /$NAME/mailbox4/type str "imap"
+ecore_config $DB set /$NAME/mailbox4/user str "myuser"
+ecore_config $DB set /$NAME/mailbox4/pass str "mypass"
+ecore_config $DB set /$NAME/mailbox4/path str "path.to.mailbox"
+ecore_config $DB set /$NAME/mailbox4/ssl int 1
Index: src/Makefile.am
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/Makefile.am,v
retrieving revision 1.13
diff -u -r1.13 Makefile.am
--- src/Makefile.am     8 Oct 2005 15:09:37 -0000       1.13
+++ src/Makefile.am     4 Dec 2005 03:56:05 -0000
@@ -5,7 +5,6 @@
 AM_CFLAGS = -I./include \
             @ENLIGHTENMENT_CFLAGS@ \
             @ECORE_CFLAGS@  \
-            @EDB_CFLAGS@    \
             @EVAS_CFLAGS@   \
             @EDJE_CFLAGS@   \
             @ESMART_CFLAGS@
@@ -15,7 +14,6 @@
 embrace_SOURCES = main.c
 
 embrace_LDADD = @ECORE_LIBS@  \
-                @EDB_LIBS@    \
                 @EVAS_LIBS@   \
                 @EDJE_LIBS@   \
                 @ESMART_LIBS@ \
Index: src/include/embrace_plugin.h
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/include/embrace_plugin.h,v
retrieving revision 1.1
diff -u -r1.1 embrace_plugin.h
--- src/include/embrace_plugin.h        2 Sep 2005 05:32:57 -0000       1.1
+++ src/include/embrace_plugin.h        4 Dec 2005 03:56:05 -0000
@@ -30,7 +30,7 @@
        char name[64];
 
        bool (*check) (MailBox *mb);
-       bool (*load_config) (MailBox *mb, E_DB_File *edb, const char *root);
+       bool (*load_config) (MailBox *mb, const char *root);
 
        bool (*add_mailbox) (MailBox *mb);
        bool (*remove_mailbox) (MailBox *mb);
Index: src/include/mailbox.h
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/include/mailbox.h,v
retrieving revision 1.1
diff -u -r1.1 mailbox.h
--- src/include/mailbox.h       2 Sep 2005 05:32:57 -0000       1.1
+++ src/include/mailbox.h       4 Dec 2005 03:56:05 -0000
@@ -21,7 +21,7 @@
 #define __MAILBOX_H
 
 #include <Evas.h>
-#include <Edb.h>
+#include <Ecore_Config.h>
 
 #ifndef __MAILBOX_C
 typedef void MailBox;
@@ -30,7 +30,7 @@
 MailBox *mailbox_new (Evas *evas, const char *theme);
 void mailbox_free (MailBox *mb);
 
-bool mailbox_load_config (MailBox *mb, E_DB_File *edb, char *key);
+bool mailbox_load_config (MailBox *mb, char *key);
 void mailbox_emit_add (MailBox *mb);
 bool mailbox_check (MailBox *mb);
 
Index: src/lib/Makefile.am
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/lib/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- src/lib/Makefile.am 4 Sep 2005 20:00:07 -0000       1.3
+++ src/lib/Makefile.am 4 Dec 2005 03:56:05 -0000
@@ -2,7 +2,6 @@
 
 AM_CFLAGS = -I. \
            -I$(top_srcdir)/src/include \
-            @EDB_CFLAGS@    \
             @EVAS_CFLAGS@   \
             @ECORE_CFLAGS@ \
             @EDJE_CFLAGS@ \
Index: src/lib/embrace.c
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/lib/embrace.c,v
retrieving revision 1.6
diff -u -r1.6 embrace.c
--- src/lib/embrace.c   5 Sep 2005 12:32:52 -0000       1.6
+++ src/lib/embrace.c   4 Dec 2005 03:56:05 -0000
@@ -190,19 +190,18 @@
        return (evas_list_count (e->plugins) > 0);
 }
 
-static MailBox *load_mailbox (Embrace *e, E_DB_File *edb, int i)
+static MailBox *load_mailbox (Embrace *e, int i)
 {
        MailBox *mb;
        EmbracePlugin *p;
        char key[32], *str;
        int val;
 
-       assert (edb);
 
        /* read title */
        snprintf (key, sizeof (key), "/" PACKAGE "/mailbox%i/title", i);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "mailbox %i: 'title' not specified!\n", i);
                return NULL;
        }
@@ -216,13 +215,13 @@
        /* read poll interval */
        snprintf (key, sizeof (key), "/" PACKAGE "/mailbox%i/interval", i);
 
-       if (e_db_int_get (edb, key, &val))
+       if ((val = ecore_config_int_get (key)))
                mailbox_poll_interval_set (mb, val);
 
        /* read mailbox type */
        snprintf (key, sizeof (key), "/" PACKAGE "/mailbox%i/type", i);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get ( key))) {
                fprintf (stderr, "mailbox %i: 'type' not specified!\n", i);
                mailbox_free (mb);
                return NULL;
@@ -244,7 +243,7 @@
        /* load plugin-specific config */
        snprintf (key, sizeof (key), "/" PACKAGE "/mailbox%i", i);
 
-       if (!mailbox_load_config (mb, edb, key)) {
+       if (!mailbox_load_config (mb, key)) {
                fprintf (stderr,
                         "mailbox %i: "
                         "loading plugin-specific configuration failed!\n", i);
@@ -255,20 +254,19 @@
        return mb;
 }
 
-static int load_mailboxes (Embrace *e, E_DB_File *edb)
+static int load_mailboxes (Embrace *e)
 {
        MailBox *mailbox;
        Evas_Object *edje;
        int i, num = 0, val = 0, w = 0, h = 0;
 
        assert (e);
-       assert (edb);
 
-       if (e_db_int_get (edb, "/" PACKAGE "/num_mailboxes", &val))
+       if ((val = ecore_config_int_get ( "/" PACKAGE "/num_mailboxes")))
                num = val;
 
        for (i = 1; i <= num; i++)
-               if ((mailbox = load_mailbox (e, edb, i))) {
+               if ((mailbox = load_mailbox (e, i))) {
                        mailbox_emit_add (mailbox);
                        edje = mailbox_edje_get (mailbox);
                        esmart_container_element_append (e->gui.container, 
edje);
@@ -312,19 +310,18 @@
        return stat (eet, &st) ? NULL : eet;
 }
 
-static bool config_load_misc (Embrace *e, E_DB_File *edb)
+static bool config_load_misc (Embrace *e)
 {
        char *str = NULL, *theme;
        bool ret = false;
 
        assert (e);
-       assert (edb);
 
-       /* only load the values from the EDB if they haven't been overriden
+       /* only load the values from Ecore_Config if they haven't been overriden
         * in argv.
         */
        if (!*e->cfg.evas_engine
-           && (str = e_db_str_get (edb, "/" PACKAGE "/evas_engine"))) {
+           && (str = ecore_config_string_get ("/" PACKAGE "/evas_engine"))) {
                snprintf (e->cfg.evas_engine, sizeof (e->cfg.evas_engine),
                          "%s", str);
                free (str);
@@ -332,7 +329,7 @@
        }
 
        if (!*e->cfg.theme
-           && !(str = e_db_str_get (edb, "/" PACKAGE "/theme"))) {
+           && !(str = ecore_config_string_get ("/" PACKAGE "/theme"))) {
                fprintf (stderr, "'theme' not specified, "
                         "falling back to the default theme!\n");
                str = strdup ("default");
@@ -350,47 +347,27 @@
        return ret;
 }
 
-static E_DB_File *open_edb (Embrace *e)
-{
-       char file[PATH_MAX + 1];
-
-       assert (e);
-
-       embrace_expand_path ("~/.e/apps/" PACKAGE "/" PACKAGE ".db",
-                            file, sizeof (file));
-
-       /* sync changes */
-       e_db_flush ();
-
-       return e_db_open_read (file);
-}
-
 static bool embrace_load_config (Embrace *e)
 {
-       E_DB_File *edb;
-       bool ret;
-
-       if (!(edb = open_edb (e)))
+       if(ecore_config_init("embrace") != ECORE_CONFIG_ERR_SUCC) {
+               fprintf (stderr, "Cannot initialize ecore_config!\n");
                return false;
+       }
 
-       ret = config_load_misc (e, edb);
-       e_db_close (edb);
+       if(ecore_config_load() != ECORE_CONFIG_ERR_SUCC) {
+               fprintf (stderr, "Cannot load configuration file!\n");
+               return false;
+       }
 
-       return ret;
+       return config_load_misc(e);
 }
 
 static bool embrace_load_mailboxes (Embrace *e)
 {
-       E_DB_File *edb;
-       bool ret;
-
-       if (!(edb = open_edb (e)))
+       if (load_mailboxes (e) > 0)
                return false;
 
-       ret = (load_mailboxes (e, edb) > 0);
-       e_db_close (edb);
-
-       return ret;
+       return true;
 }
 
 static void on_pre_render (Ecore_Evas *ee)
Index: src/lib/mailbox.c
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/lib/mailbox.c,v
retrieving revision 1.2
diff -u -r1.2 mailbox.c
--- src/lib/mailbox.c   5 Sep 2005 12:32:52 -0000       1.2
+++ src/lib/mailbox.c   4 Dec 2005 03:56:05 -0000
@@ -128,17 +128,16 @@
        free (mb);
 }
 
-bool mailbox_load_config (MailBox *mb, E_DB_File *edb, char *key)
+bool mailbox_load_config (MailBox *mb, char *key)
 {
        assert (mb);
-       assert (edb);
        assert (key);
        assert (mb->plugin);
 
        if (!EMBRACE_PLUGIN(mb->plugin)->load_config)
                return true;
 
-       return (EMBRACE_PLUGIN(mb->plugin)->load_config (mb, edb, key));
+       return (EMBRACE_PLUGIN(mb->plugin)->load_config (mb, key));
 }
 
 void mailbox_emit_add (MailBox *mb)
Index: src/plugins/imap/Makefile.am
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/imap/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- src/plugins/imap/Makefile.am        3 Sep 2005 23:52:50 -0000       1.4
+++ src/plugins/imap/Makefile.am        4 Dec 2005 03:56:05 -0000
@@ -3,7 +3,6 @@
 if BUILD_IMAP
 
 AM_CFLAGS = -I$(top_srcdir)/src/include \
-            @EDB_CFLAGS@   \
             @EVAS_CFLAGS@  \
             @ECORE_CFLAGS@ \
             @EDJE_CFLAGS@
Index: src/plugins/imap/imap.c
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/imap/imap.c,v
retrieving revision 1.22
diff -u -r1.22 imap.c
--- src/plugins/imap/imap.c     5 Sep 2005 12:32:52 -0000       1.22
+++ src/plugins/imap/imap.c     4 Dec 2005 03:56:05 -0000
@@ -399,22 +399,21 @@
        return true;
 }
 
-static bool imap_load_config (MailBox *mb, E_DB_File *edb,
-                              const char *root)
+static bool imap_load_config (MailBox *mb, const char *root)
 {
        char key[32], *str;
        int val, use_ssl = 0;
 
        assert (mb);
-       assert (edb);
        assert (root);
 
        if (ecore_con_ssl_available_get ()) {
                /* check whether OpenSSL should be used */
                snprintf (key, sizeof (key), "%s/ssl", root);
 
-               if (!e_db_int_get (edb, key, &use_ssl))
-                       use_ssl = 0;
+               ecore_config_int_default(key, 0);
+
+               use_ssl = ecore_config_int_get (key);
 
                mailbox_property_set (mb, "ssl", (int *) use_ssl);
        }
@@ -422,7 +421,7 @@
        /* read server */
        snprintf (key, sizeof (key), "%s/host", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[imap] 'host' not specified!\n");
                return false;
        }
@@ -432,15 +431,15 @@
        /* read port */
        snprintf (key, sizeof (key), "%s/port", root);
 
-       if (!e_db_int_get (edb, key, &val))
-               val = use_ssl ? 993 : 143;
+       ecore_config_int_default(key, use_ssl ? 993 : 143);
+       val = ecore_config_int_get (key);
 
        mailbox_property_set (mb, "port", (int *) val);
 
        /* read username */
        snprintf (key, sizeof (key), "%s/user", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[imap] 'user' not specified!\n");
                return false;
        }
@@ -450,7 +449,7 @@
        /* read password */
        snprintf (key, sizeof (key), "%s/pass", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[imap] 'user' not specified!\n");
                return false;
        }
@@ -460,7 +459,7 @@
        /* read mailbox path */
        snprintf (key, sizeof (key), "%s/path", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[imap] 'path' not specified!\n");
                return false;
        }
Index: src/plugins/maildir/Makefile.am
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/maildir/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- src/plugins/maildir/Makefile.am     3 Sep 2005 23:52:50 -0000       1.4
+++ src/plugins/maildir/Makefile.am     4 Dec 2005 03:56:05 -0000
@@ -3,7 +3,6 @@
 if BUILD_MAILDIR
 
 AM_CFLAGS = -I$(top_srcdir)/src/include \
-            @EDB_CFLAGS@   \
             @EVAS_CFLAGS@  \
             @ECORE_CFLAGS@ \
             @EDJE_CFLAGS@
Index: src/plugins/maildir/maildir.c
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/maildir/maildir.c,v
retrieving revision 1.10
diff -u -r1.10 maildir.c
--- src/plugins/maildir/maildir.c       25 Oct 2005 11:35:36 -0000      1.10
+++ src/plugins/maildir/maildir.c       4 Dec 2005 03:56:05 -0000
@@ -275,21 +275,19 @@
 }
 #endif
 
-static bool maildir_load_config (MailBox *mb, E_DB_File *edb,
-                                 const char *root)
+static bool maildir_load_config (MailBox *mb, const char *root)
 {
        char key[256], *str, *path[2], expanded[PATH_MAX + 1];
        char *prop[2] = {"path_cur", "path_new"};
        int i;
 
        assert (mb);
-       assert (edb);
        assert (root);
 
        /* read path */
        snprintf (key, sizeof (key), "%s/path", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get ( key))) {
                fprintf (stderr, "[maildir] 'path' not specified!\n");
                return false;
        }
Index: src/plugins/mbox/Makefile.am
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/mbox/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- src/plugins/mbox/Makefile.am        3 Sep 2005 23:52:50 -0000       1.4
+++ src/plugins/mbox/Makefile.am        4 Dec 2005 03:56:05 -0000
@@ -3,7 +3,6 @@
 if BUILD_MBOX
 
 AM_CFLAGS = -I$(top_srcdir)/src/include \
-            @EDB_CFLAGS@   \
             @EVAS_CFLAGS@  \
             @ECORE_CFLAGS@ \
             @EDJE_CFLAGS@
Index: src/plugins/mbox/mbox.c
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/mbox/mbox.c,v
retrieving revision 1.7
diff -u -r1.7 mbox.c
--- src/plugins/mbox/mbox.c     5 Sep 2005 12:32:52 -0000       1.7
+++ src/plugins/mbox/mbox.c     4 Dec 2005 03:56:05 -0000
@@ -175,13 +175,11 @@
        return true;
 }
 
-static bool mbox_load_config (MailBox *mb, E_DB_File *edb,
-                              const char *root)
+static bool mbox_load_config (MailBox *mb, const char *root)
 {
        char key[32], *str, *path;
 
        assert (mb);
-       assert (edb);
        assert (root);
 
        if (!(path = malloc ((PATH_MAX + 1) * sizeof (char))))
@@ -189,7 +187,7 @@
 
        snprintf (key, sizeof (key), "%s/path", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[mbox] 'path' not specified!\n");
                return false;
        }
Index: src/plugins/pop3/Makefile.am
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/pop3/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- src/plugins/pop3/Makefile.am        3 Sep 2005 23:52:50 -0000       1.4
+++ src/plugins/pop3/Makefile.am        4 Dec 2005 03:56:05 -0000
@@ -3,7 +3,6 @@
 if BUILD_POP3
 
 AM_CFLAGS = -I$(top_srcdir)/src/include \
-            @EDB_CFLAGS@   \
             @EVAS_CFLAGS@  \
             @ECORE_CFLAGS@ \
             @EDJE_CFLAGS@
Index: src/plugins/pop3/pop3.c
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/pop3/pop3.c,v
retrieving revision 1.22
diff -u -r1.22 pop3.c
--- src/plugins/pop3/pop3.c     5 Sep 2005 17:08:54 -0000       1.22
+++ src/plugins/pop3/pop3.c     4 Dec 2005 03:56:05 -0000
@@ -242,22 +242,21 @@
        return true;
 }
 
-static bool pop3_load_config (MailBox *mb, E_DB_File *edb,
-                              const char *root)
+static bool pop3_load_config (MailBox *mb, const char *root)
 {
        char key[32], *str;
        int val, use_ssl = 0;
 
        assert (mb);
-       assert (edb);
        assert (root);
 
        if (ecore_con_ssl_available_get ()) {
                /* check whether OpenSSL should be used */
                snprintf (key, sizeof (key), "%s/ssl", root);
 
-               if (!e_db_int_get (edb, key, &use_ssl))
-                       use_ssl = 0;
+               ecore_config_int_default(key, 0);
+
+               use_ssl = ecore_config_int_get(key);
 
                mailbox_property_set (mb, "ssl", (int *) use_ssl);
        }
@@ -265,7 +264,7 @@
        /* read server */
        snprintf (key, sizeof (key), "%s/host", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[pop3] 'host' not specified!\n");
                return false;
        }
@@ -275,15 +274,16 @@
        /* read port */
        snprintf (key, sizeof (key), "%s/port", root);
 
-       if (!e_db_int_get (edb, key, &val))
-               val = use_ssl ? 995 : 110;
+       ecore_config_int_default(key, use_ssl ? 995 : 110);
+
+       val = ecore_config_int_get (key);
 
        mailbox_property_set (mb, "port", (int *) val);
 
        /* read username */
        snprintf (key, sizeof (key), "%s/user", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[pop3] 'user' not specified!\n");
                return false;
        }
@@ -293,7 +293,7 @@
        /* read password */
        snprintf (key, sizeof (key), "%s/pass", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[pop3] 'pass' not specified!\n");
                return false;
        }
Index: src/plugins/sylpheed/Makefile.am
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/sylpheed/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- src/plugins/sylpheed/Makefile.am    3 Sep 2005 23:52:50 -0000       1.4
+++ src/plugins/sylpheed/Makefile.am    4 Dec 2005 03:56:05 -0000
@@ -4,7 +4,6 @@
 
 AM_CFLAGS = -I$(top_srcdir)/src/include \
             @XML_CFLAGS@   \
-            @EDB_CFLAGS@   \
             @EVAS_CFLAGS@  \
             @ECORE_CFLAGS@ \
             @EDJE_CFLAGS@
Index: src/plugins/sylpheed/sylpheed.c
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/sylpheed/sylpheed.c,v
retrieving revision 1.3
diff -u -r1.3 sylpheed.c
--- src/plugins/sylpheed/sylpheed.c     30 Jan 2005 17:20:05 -0000      1.3
+++ src/plugins/sylpheed/sylpheed.c     4 Dec 2005 03:56:05 -0000
@@ -66,13 +66,11 @@
        return result;
 }
 
-static bool sylpheed_load_config (MailBox *mb, E_DB_File *edb,
-                                  const char *root)
+static bool sylpheed_load_config (MailBox *mb, const char *root)
 {
        char key[32], *str, *path, *mailbox, *folder;
 
        assert (mb);
-       assert (edb);
        assert (root);
 
        if (!(path = malloc ((PATH_MAX + 1) * sizeof (char))))
@@ -81,7 +79,7 @@
        /* get the path */
        snprintf (key, sizeof (key), "%s/path", root);
 
-       if (!(str = e_db_str_get (edb, key))) {
+       if (!(str = ecore_config_string_get (key))) {
                fprintf (stderr, "[sylpheed] 'path' not specified!\n");
                return false;
        }
@@ -94,7 +92,7 @@
        /* get the mailbox */
        snprintf (key, sizeof (key), "%s/mailbox", root);
 
-       if (!(mailbox = e_db_str_get (edb, key))) {
+       if (!(mailbox = ecore_config_string_get (key))) {
                fprintf (stderr, "[sylpheed] 'mailbox' not specified!\n");
                return false;
        }
@@ -104,7 +102,7 @@
        /* get the folder */
        snprintf (key, sizeof (key), "%s/folder", root);
 
-       if (!(folder = e_db_str_get (edb, key))) {
+       if (!(folder = ecore_config_string_get (key))) {
                fprintf (stderr, "[sylpheed] 'folder' not specified!\n");
                return false;
        }

Reply via email to