* modest-main:
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Tue, 16 Jan 2007 23:16:00 +0000 (23:16 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Tue, 16 Jan 2007 23:16:00 +0000 (23:16 +0000)
- set header column settings if they're not there, or
  simply overwrite them if started with --factory-settings
* modest-widget-memory-*
- make the _PARAM and the 'get_key' stuff available for
  modest-init (using -priv)
* modest-init.[ch]:
- implement header column defaults, differentiated per folder
  type and for gtk/maemo

pmo-trunk-r649

src/Makefile.am
src/modest-init.c [new file with mode: 0644]
src/modest-init.h [new file with mode: 0644]
src/modest-main.c
src/modest-widget-memory-priv.h [new file with mode: 0644]
src/modest-widget-memory.c
src/modest-widget-memory.h

index 449e654..d4af382 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Makefile.am
-# Time-stamp: <2007-01-15 10:49:27 (djcb)>
+# Time-stamp: <2007-01-16 23:49:28 (djcb)>
 SUBDIRS=$(MODEST_PLATFORM) widgets
 DIST_SUBDIRS = widgets gtk maemo
 
@@ -43,6 +43,8 @@ modest_SOURCES=\
        modest-formatter.h \
        modest-icon-factory.c\
        modest-icon-factory.h\
+       modest-init.h\
+       modest-init.c\
        modest-mail-operation-queue.c \
        modest-mail-operation-queue.h \
        modest-mail-operation.c \
@@ -72,7 +74,8 @@ modest_SOURCES=\
        modest-widget-factory.c \
        modest-widget-factory.h \
        modest-widget-memory.c\
-       modest-widget-memory.h
+       modest-widget-memory.h \
+       modest-widget-memory-priv.h
 
 modest_LDADD =                                                 \
        $(MODEST_GSTUFF_LIBS)                           \
diff --git a/src/modest-init.c b/src/modest-init.c
new file mode 100644 (file)
index 0000000..de67233
--- /dev/null
@@ -0,0 +1,180 @@
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <config.h>
+#include <widgets/modest-header-view.h>
+#include <widgets/modest-folder-view.h>
+#include <modest-tny-platform-factory.h>
+#include <modest-widget-memory.h>
+#include <modest-widget-memory-priv.h>
+#include <modest-init.h>
+
+typedef struct {
+       ModestHeaderViewColumn col;
+       guint                  width;
+} FolderCols;
+
+
+#if MODEST_PLATFORM_ID==1   /*gtk*/
+static const FolderCols INBOX_COLUMNS[] = {
+       {MODEST_HEADER_VIEW_COLUMN_MSGTYPE, 20},
+       {MODEST_HEADER_VIEW_COLUMN_ATTACH,  20},
+       {MODEST_HEADER_VIEW_COLUMN_FROM,    50},
+       {MODEST_HEADER_VIEW_COLUMN_SUBJECT, 50},
+       {MODEST_HEADER_VIEW_COLUMN_RECEIVED_DATE, 50},
+       {MODEST_HEADER_VIEW_COLUMN_SIZE, 30},
+};
+
+static const FolderCols OUTBOX_COLUMNS[] = {
+        {MODEST_HEADER_VIEW_COLUMN_MSGTYPE, 20},
+        {MODEST_HEADER_VIEW_COLUMN_ATTACH,  20},
+        {MODEST_HEADER_VIEW_COLUMN_TO,    50},
+        {MODEST_HEADER_VIEW_COLUMN_SUBJECT, 50},
+        {MODEST_HEADER_VIEW_COLUMN_SENT_DATE, 50},
+        {MODEST_HEADER_VIEW_COLUMN_SIZE, 30},
+};
+#elif MODEST_PLATFORM==2  /*maemo*/
+static const FolderCols INBOX_COLUMNS = {
+       {MODEST_HEADER_VIEW_COLUMN_MSGTYPE, 20},
+       {MODEST_HEADER_VIEW_COLUMN_ATTACH,  20},
+       {MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_IN,150},
+};
+static const FolderCols OUTBOX_COLUMNS = {
+        {MODEST_HEADER_VIEW_COLUMN_MSGTYPE, 20},
+        {MODEST_HEADER_VIEW_COLUMN_ATTACH,  20},
+        {MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_OUT,150},
+};
+#endif /*MODEST_PLATFORM*/
+
+
+static ModestTnyPlatformFactory*
+get_platform_factory (void)
+{
+       TnyPlatformFactory *fact =
+               modest_tny_platform_factory_get_instance ();
+
+       if (!fact) {
+               g_printerr ("modest: cannot get platform factory instance\n");
+               return NULL;
+       }
+
+       return MODEST_TNY_PLATFORM_FACTORY(fact);
+}
+
+
+static ModestConf*
+get_modest_conf (void)
+{
+       ModestTnyPlatformFactory *fact =
+               get_platform_factory ();
+       ModestConf *conf =
+               modest_tny_platform_factory_get_conf_instance (fact);
+       if (!conf) {
+               g_printerr ("modest: cannot get modest conf instance\n");
+               return NULL;
+       }
+       return conf;
+}
+
+
+/* NOTE: the exact details of this format are important, as they
+ * are also used in modest-widget-memory. FIXME: make a shared function
+ * for this with widget-memory
+ */
+static gboolean
+save_header_settings (ModestConf *conf, TnyFolderType type, const FolderCols* cols,
+                    guint col_num, gboolean overwrite)
+{
+       int i;
+       gchar *key;
+       GString *str;
+
+       g_return_val_if_fail (cols, FALSE);
+
+       key = _modest_widget_memory_get_keyname_with_type ("header-view",
+                                                          type,
+                                                          MODEST_WIDGET_MEMORY_PARAM_COLUMN_WIDTH);
+       /* if we're not in overwrite mode, only write stuff it
+        * there was nothing before */
+       if (!overwrite &&  modest_conf_key_exists(conf, key, NULL)) {
+               g_free (key);
+               return TRUE;
+       }
+
+       /* the format is necessarily the same as the one in modest-widget-memory */
+       str = g_string_new (NULL);
+       for (i = 0; i != col_num; ++i) 
+               g_string_append_printf (str, "%d:%d ",
+                                       cols[i].col, cols[i].width); 
+
+       modest_conf_set_string (conf, key, str->str, NULL);
+       g_free (key);
+       g_string_free (str, TRUE);
+       
+       return TRUE;
+}
+
+/* we set the the defaults here for all folder types */
+gboolean
+modest_init_header_columns (gboolean overwrite)
+{
+       ModestConf *conf;
+       int folder_type;
+
+       conf = get_modest_conf ();
+       if (!conf) {
+               g_printerr ("modest: cannot get modest conf\n");
+               return FALSE;
+       }
+       
+       for (folder_type = TNY_FOLDER_TYPE_UNKNOWN;
+            folder_type <= TNY_FOLDER_TYPE_CALENDAR; ++folder_type) {          
+               
+               switch (folder_type) {
+               case TNY_FOLDER_TYPE_OUTBOX:
+               case TNY_FOLDER_TYPE_SENT:
+               case TNY_FOLDER_TYPE_DRAFTS:
+                       save_header_settings (conf, folder_type, OUTBOX_COLUMNS,
+                                             G_N_ELEMENTS(OUTBOX_COLUMNS),
+                                             overwrite);
+                       break;
+               default:
+                       save_header_settings (conf, folder_type, INBOX_COLUMNS,
+                                             G_N_ELEMENTS(INBOX_COLUMNS),
+                                             overwrite);
+               };
+       }
+       return TRUE;
+}
+
+gboolean
+modest_init_local_folders  (void)
+{
+       return TRUE;
+}
diff --git a/src/modest-init.h b/src/modest-init.h
new file mode 100644 (file)
index 0000000..690d64b
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __MODEST_INIT_H__
+#define __MODEST_INIT_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+/*
+ * functions to initialize various parts of the modest system
+ */
+
+G_BEGIN_DECLS
+
+/**
+ * modest_init_header_columns:
+ * @overwrite: write the setting, even if it already exists
+ * 
+ * will set defaults for the columns to show for folder,
+ * if there are no such settings yet (in ModestWidgetMemory)
+ * 
+ * Returns: TRUE if succeeded, FALSE in case of error
+ */
+gboolean modest_init_header_columns (gboolean overwrite);
+
+/**
+ * modest_init_local_folders:
+ * 
+ * create the Local Folders folder under cache, if they
+ * do not exist yet.
+ * 
+ * Returns: TRUE if the folder were already there, or
+ * they were created, FALSE otherwise
+ */
+gboolean modest_init_local_folders  (void);
+
+G_END_DECLS
+
+#endif /*__MODEST_INIT_H__*/
index ac3821f..0a08943 100644 (file)
@@ -81,7 +81,7 @@ main (int argc, char *argv[])
        GError *err = NULL;
        int retval  = MODEST_ERR_NONE;
                
-       static gboolean batch=FALSE;
+       static gboolean batch=FALSE, factory_settings=FALSE;
        static gchar    *mailto, *subject, *bcc, *cc, *body, *account;
 
        static GOptionEntry options[] = {
@@ -99,6 +99,8 @@ main (int argc, char *argv[])
                  N_("Account to use (if specified, default account is used)"), NULL},
                { "batch", 'y', 0, G_OPTION_ARG_NONE, &batch,
                  N_("Run in batch mode (don't show UI)"), NULL},
+               { "factory-settings", 0, 0, G_OPTION_ARG_NONE, &factory_settings,
+                 N_("return to factory settings"), NULL},
                { NULL, 0, 0, 0, NULL, NULL, NULL }
        };
 
@@ -134,7 +136,7 @@ main (int argc, char *argv[])
                retval = MODEST_ERR_CONF;
                goto cleanup;
        }
-
+       
        /* Get the account store */
        account_store = tny_platform_factory_new_account_store (fact);
        if (!account_store) {
@@ -142,6 +144,7 @@ main (int argc, char *argv[])
                retval = MODEST_ERR_RUN;
                goto cleanup;
         }
+
        
        if (!getenv("DISPLAY"))
                batch = TRUE; 
@@ -149,6 +152,8 @@ main (int argc, char *argv[])
        if (!batch) {
                gdk_threads_init ();
                gtk_init (&argc, &argv);
+               modest_init_header_columns (factory_settings);
+               
                retval = start_ui (mailto, cc, bcc, subject, body, account_store);
        } else 
                retval = send_mail (mailto, cc, bcc, subject, body);
diff --git a/src/modest-widget-memory-priv.h b/src/modest-widget-memory-priv.h
new file mode 100644 (file)
index 0000000..177f24f
--- /dev/null
@@ -0,0 +1,54 @@
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived from
+ *   this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __MODEST_WIDGET_MEMORY_PRIV_H__
+#define __MODEST_WIDGET_MEMORY_PRIV_H__
+
+G_BEGIN_DECLS
+
+
+#define MODEST_WIDGET_MEMORY_PARAM_X             "x"
+#define MODEST_WIDGET_MEMORY_PARAM_Y             "y"
+#define MODEST_WIDGET_MEMORY_PARAM_HEIGHT        "height"
+#define MODEST_WIDGET_MEMORY_PARAM_WIDTH         "width"
+#define MODEST_WIDGET_MEMORY_PARAM_POS           "pos"
+#define MODEST_WIDGET_MEMORY_PARAM_COLUMN_WIDTH  "column-width"
+
+/* private functions, only for use in modest-widget-memory and modest-init */
+gchar* _modest_widget_memory_get_keyname           (const gchar *name, const gchar *param);
+gchar* _modest_widget_memory_get_keyname_with_type (const gchar *name, guint type,
+                                                   const gchar *param);
+
+G_END_DECLS
+
+#endif /*__MODEST_WIDGET_MEMORY_PRIV_H__*/
+
+
+
+
index 70af7af..756cf0e 100644 (file)
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "modest-widget-memory.h"
+#include <modest-widget-memory.h>
+#include <modest-widget-memory-priv.h>
 
 #include <modest-tny-platform-factory.h>
 #include <modest-tny-folder.h>
 #include <widgets/modest-header-view.h>
 #include <widgets/modest-msg-view.h>
 #include <widgets/modest-folder-view.h>
-
 #include <string.h>
 
-#define PARAM_X             "x"
-#define PARAM_Y             "y"
-#define PARAM_HEIGHT        "height"
-#define PARAM_WIDTH         "width"
-#define PARAM_POS           "pos"
-#define PARAM_COLUMN_WIDTH  "column-width"
-
-static gchar*
-get_keyname (ModestConf *conf, const gchar *name, const gchar *param)
+gchar*
+_modest_widget_memory_get_keyname (const gchar *name, const gchar *param)
 {
        gchar *esc_name, *keyname;
+
+       g_return_val_if_fail (name, NULL);
+       g_return_val_if_fail (param, NULL);
+       
        esc_name = modest_conf_key_escape (name);
 
        keyname = g_strdup_printf ("%s/%s/%s",
@@ -58,10 +55,15 @@ get_keyname (ModestConf *conf, const gchar *name, const gchar *param)
 }
 
 
-static gchar*
-get_keyname_with_type (ModestConf *conf, const gchar *name, guint type, const gchar *param)
+gchar*
+_modest_widget_memory_get_keyname_with_type (const gchar *name, guint type,
+                                            const gchar *param)
 {
        gchar *esc_name, *keyname;
+       
+       g_return_val_if_fail (name, NULL);
+       g_return_val_if_fail (param, NULL);
+
        esc_name = modest_conf_key_escape (name);
 
        keyname = g_strdup_printf ("%s/%s/%s_%d",
@@ -77,11 +79,11 @@ save_settings_widget (ModestConf *conf, GtkWidget *widget, const gchar *name)
 {
        gchar *key;
 
-       key = get_keyname (conf, name, PARAM_HEIGHT);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_HEIGHT);
        modest_conf_set_int (conf, key, GTK_WIDGET(widget)->allocation.height, NULL);
        g_free (key);
        
-       key = get_keyname (conf, name, PARAM_WIDTH);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_WIDTH);
        modest_conf_set_int (conf, key, GTK_WIDGET(widget)->allocation.width, NULL);
        g_free (key);
 
@@ -95,14 +97,14 @@ restore_settings_widget (ModestConf *conf, GtkWidget *widget, const gchar *name)
        GtkRequisition req;
        gchar *key;
 
-       key = get_keyname (conf, name, PARAM_HEIGHT);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_HEIGHT);
        
        if (modest_conf_key_exists (conf, key, NULL))
                req.height = modest_conf_get_int (conf, key, NULL);
 
        g_free (key);
        
-       key = get_keyname (conf, name, PARAM_WIDTH);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_WIDTH);
        if (modest_conf_key_exists (conf, key, NULL))
                req.width = modest_conf_get_int (conf, key, NULL);
        g_free (key);
@@ -124,11 +126,11 @@ save_settings_window (ModestConf *conf, GtkWindow *win, const gchar *name)
        
        gtk_window_get_size (win, &width, &height);
        
-       key = get_keyname (conf, name, PARAM_HEIGHT);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_HEIGHT);
        modest_conf_set_int (conf, key, height, NULL);
        g_free (key);
        
-       key = get_keyname (conf, name, PARAM_WIDTH);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_WIDTH);
        modest_conf_set_int (conf, key, width, NULL);
        g_free (key);
        
@@ -142,14 +144,14 @@ restore_settings_window (ModestConf *conf, GtkWindow *win, const gchar *name)
        gchar *key;
        int height = 0, width = 0;
 
-       key = get_keyname (conf, name, PARAM_HEIGHT);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_HEIGHT);
        
        if (modest_conf_key_exists (conf, key, NULL))
                height = modest_conf_get_int (conf, key, NULL);
 
        g_free (key);
 
-       key = get_keyname (conf, name, PARAM_WIDTH);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_WIDTH);
        if (modest_conf_key_exists (conf, key, NULL))
                width = modest_conf_get_int (conf, key, NULL);
 
@@ -170,7 +172,7 @@ save_settings_paned (ModestConf *conf, GtkPaned *paned, const gchar *name)
 
        pos = gtk_paned_get_position (paned);
        
-       key = get_keyname (conf, name, PARAM_POS);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_POS);
        modest_conf_set_int (conf, key, pos, NULL);
        g_free (key);
        
@@ -184,7 +186,7 @@ restore_settings_paned (ModestConf *conf, GtkPaned *paned, const gchar *name)
        gchar *key;
        int pos;
        
-       key = get_keyname (conf, name, PARAM_POS);
+       key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_POS);
        
        if (modest_conf_key_exists (conf, key, NULL)) {
                pos = modest_conf_get_int (conf, key, NULL);
@@ -215,11 +217,15 @@ save_settings_header_view (ModestConf *conf, ModestHeaderView *header_view,
                return TRUE; /* no folder: no settings */ 
        
        type = modest_tny_folder_guess_folder_type (folder);
-       key = get_keyname_with_type (conf, name, type, PARAM_COLUMN_WIDTH);
+       key = _modest_widget_memory_get_keyname_with_type (name, type,
+                                                          MODEST_WIDGET_MEMORY_PARAM_COLUMN_WIDTH);
 
        cursor = cols = modest_header_view_get_columns (header_view);
        str = g_string_new (NULL);
-       
+
+       /* NOTE: the exact details of this format are important, as they
+        * are also used in modest-init.
+        */
        while (cursor) {
 
                int col_id, width;
@@ -259,7 +265,8 @@ restore_settings_header_view (ModestConf *conf, ModestHeaderView *header_view,
        
        type = modest_tny_folder_guess_folder_type (folder);
        
-       key = get_keyname_with_type (conf, name, type, PARAM_COLUMN_WIDTH);
+       key = _modest_widget_memory_get_keyname_with_type (name, type,
+                                                          MODEST_WIDGET_MEMORY_PARAM_COLUMN_WIDTH);
        if (modest_conf_key_exists (conf, key, NULL)) {
                
                gchar *data, *cursor;
index 4e3993d..59879e9 100644 (file)
@@ -58,7 +58,6 @@ gboolean modest_widget_memory_save (ModestConf *conf, GObject *widget, const gch
  */
 gboolean modest_widget_memory_restore (ModestConf *conf, GObject *widget, const gchar *name);
 
-
 G_END_DECLS
 
 #endif /*__MODEST_WIDGET_MEMORY_H__*/