X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-widget-memory.c;h=a5fba5e323e887f8130d4b4656432f29c1020581;hp=56ab18aef2ed49fd1480a72d124069938a42178f;hb=78b797b192ee0ec5741f49cd3d649bf81519dec5;hpb=c5c7a9164713055c43ec69bdda8c2767271515a1 diff --git a/src/modest-widget-memory.c b/src/modest-widget-memory.c index 56ab18a..a5fba5e 100644 --- a/src/modest-widget-memory.c +++ b/src/modest-widget-memory.c @@ -27,6 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -118,7 +119,7 @@ save_settings_widget (ModestConf *conf, GtkWidget *widget, const gchar *name) static gboolean restore_settings_widget (ModestConf *conf, GtkWidget *widget, const gchar *name) { - GtkRequisition req; + GtkRequisition req = {0, 0}; gchar *key; key = _modest_widget_memory_get_keyname (name, MODEST_WIDGET_MEMORY_PARAM_HEIGHT); @@ -194,7 +195,7 @@ restore_settings_window (ModestConf *conf, GtkWindow *win, const gchar *name) gtk_window_set_default_size() makes "drag-motion" signal report bad coordinates, so drag-and-drop do not work properly */ -#ifdef MODEST_PLATFORM_GNOME +#ifdef MODEST_TOOLKIT_GTK if (height && width) gtk_window_set_default_size (win, width, height); #endif @@ -492,16 +493,22 @@ restore_settings_folder_view (ModestConf *conf, default_acc = modest_account_mgr_get_default_account (mgr); if (default_acc) { ModestAccountSettings *settings; - ModestServerAccountSettings *store_settings; const gchar *server_acc_id; settings = modest_account_mgr_load_account_settings (mgr, (const gchar*) default_acc); - store_settings = modest_account_settings_get_store_settings (settings); - server_acc_id = modest_server_account_settings_get_account_name (store_settings); - - modest_folder_view_set_account_id_of_visible_server_account (folder_view, server_acc_id); - g_object_unref (store_settings); - g_object_unref (settings); + /* If there was any problem with the settings storage + the settings could be NULL */ + if (settings) { + ModestServerAccountSettings *store_settings; + store_settings = modest_account_settings_get_store_settings (settings); + + if (store_settings) { + server_acc_id = modest_server_account_settings_get_account_name (store_settings); + modest_folder_view_set_account_id_of_visible_server_account (folder_view, server_acc_id); + g_object_unref (store_settings); + } + g_object_unref (settings); + } g_free (default_acc); } return TRUE;