Remove unneeded modest_osso_load_state() and modest_osso_save_state()
authorSergio Villar Senin <svillar@igalia.com>
Tue, 27 Oct 2009 15:58:09 +0000 (16:58 +0100)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 3 Nov 2009 16:26:32 +0000 (17:26 +0100)
modest_osso_load_state () is am empty function and modest_osso_save_state()
can be substituted by modest_window_mgr_save_state_for_all_windows()

Fixes NB#141651

12 files changed:
src/hildon2/Makefile.am
src/hildon2/modest-accounts-window.c
src/hildon2/modest-folder-window.c
src/hildon2/modest-header-window.c
src/hildon2/modest-mailboxes-window.c
src/hildon2/modest-main-window.c
src/hildon2/modest-osso-autosave-callbacks.c [deleted file]
src/hildon2/modest-osso-autosave-callbacks.h [deleted file]
src/hildon2/modest-osso-state-saving.c [deleted file]
src/hildon2/modest-osso-state-saving.h [deleted file]
src/hildon2/modest-platform.c
src/modest-ui-actions.c

index 5224c13..67fc237 100644 (file)
@@ -92,10 +92,6 @@ libmodest_ui_la_SOURCES=              \
        modest-connection-specific-smtp-window.c \
        modest-connection-specific-smtp-edit-window.h \
        modest-connection-specific-smtp-edit-window.c \
-       modest-osso-autosave-callbacks.c \
-       modest-osso-autosave-callbacks.h \
-       modest-osso-state-saving.c \
-       modest-osso-state-saving.h   \
        modest-secureauth-picker.h modest-secureauth-picker.c \
        modest-selector-picker.h modest-selector-picker.c \
        modest-hildon2-window-mgr.h modest-hildon2-window-mgr.c
@@ -144,4 +140,4 @@ EXTRA_DIST=\
        $(backupsettings_DATA) \
        $(prebackup_SCRIPTS) \
        $(restore_SCRIPTS) \
-       $(ossocudscripts_SCRIPTS)
\ No newline at end of file
+       $(ossocudscripts_SCRIPTS)
index 345ee43..3eec8a5 100644 (file)
@@ -28,8 +28,6 @@
  */
 
 #include <modest-accounts-window.h>
-#include <modest-osso-state-saving.h>
-#include <libosso.h>
 #include <hildon/hildon-pannable-area.h>
 #include <hildon/hildon-banner.h>
 #include <hildon/hildon-helper.h>
@@ -361,10 +359,6 @@ modest_accounts_window_new (void)
 
        connect_signals (MODEST_ACCOUNTS_WINDOW (self));
 
-       /* Load previous osso state, for instance if we are being restored from 
-        * hibernation:  */
-       modest_osso_load_state ();
-
        app = hildon_program_get_instance ();
        hildon_program_add_window (app, HILDON_WINDOW (self));
        
index 2750834..b970563 100644 (file)
@@ -28,8 +28,6 @@
  */
 
 #include <modest-folder-window.h>
-#include <modest-osso-state-saving.h>
-#include <libosso.h>
 #include <hildon/hildon-pannable-area.h>
 #include <modest-window-mgr.h>
 #include <modest-signal-mgr.h>
@@ -386,10 +384,6 @@ modest_folder_window_new (TnyFolderStoreQuery *query)
 
        connect_signals (MODEST_FOLDER_WINDOW (self));
 
-       /* Load previous osso state, for instance if we are being restored from 
-        * hibernation:  */
-       modest_osso_load_state ();
-
        /* Get device name */
        modest_maemo_utils_get_device_name ();
 
index f15ecc2..16792f7 100644 (file)
@@ -28,8 +28,6 @@
  */
 
 #include <modest-header-window.h>
-#include <modest-osso-state-saving.h>
-#include <libosso.h>
 #include <hildon/hildon-pannable-area.h>
 #include <hildon/hildon-helper.h>
 #include <modest-window-mgr.h>
@@ -812,10 +810,6 @@ modest_header_window_new (TnyFolder *folder, const gchar *account_name, const gc
 
        update_view (self, NULL);
 
-       /* Load previous osso state, for instance if we are being restored from 
-        * hibernation:  */
-       modest_osso_load_state ();
-
        /* Get device name */
        modest_maemo_utils_get_device_name ();
 
index 4df7ced..04e8a7a 100644 (file)
@@ -28,8 +28,6 @@
  */
 
 #include <modest-mailboxes-window.h>
-#include <modest-osso-state-saving.h>
-#include <libosso.h>
 #include <hildon/hildon-pannable-area.h>
 #include <modest-window-mgr.h>
 #include <modest-signal-mgr.h>
@@ -330,10 +328,6 @@ modest_mailboxes_window_new (const gchar *account)
 
        connect_signals (MODEST_MAILBOXES_WINDOW (self));
 
-       /* Load previous osso state, for instance if we are being restored from 
-        * hibernation:  */
-       modest_osso_load_state ();
-
        /* Get device name */
        modest_maemo_utils_get_device_name ();
 
index 295850f..aba0ca6 100644 (file)
@@ -61,7 +61,6 @@
 #include "modest-progress-bar.h"
 #include "modest-text-utils.h"
 #include "modest-ui-dimming-manager.h"
-#include "modest-osso-state-saving.h"
 #include "modest-text-utils.h"
 #include "modest-signal-mgr.h"
 #include <tny-gtk-folder-store-tree-model.h>
@@ -1017,7 +1016,6 @@ on_hildon_program_is_topmost_notify(GObject *self,
                        hildon_program_set_can_hibernate (app, FALSE);
                else {
                        /* Allow hibernation, after saving the state: */
-                       modest_osso_save_state();
                        hildon_program_set_can_hibernate (app, TRUE);
                }
        }       
@@ -1048,10 +1046,6 @@ modest_main_window_on_show (GtkWidget *self, gpointer user_data)
        tny_account_store_view_set_account_store (TNY_ACCOUNT_STORE_VIEW (priv->folder_view),
                                                  TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()));
 
-       /* Load previous osso state, for instance if we are being restored from
-        * hibernation:  */
-       modest_osso_load_state ();
-
        /* Restore window & widget settings */
        priv->wait_for_settings = TRUE;
        restore_settings (MODEST_MAIN_WINDOW(self), TRUE);
diff --git a/src/hildon2/modest-osso-autosave-callbacks.c b/src/hildon2/modest-osso-autosave-callbacks.c
deleted file mode 100644 (file)
index e51e4db..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (c) 2007, 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 <modest-osso-autosave-callbacks.h>
-
-void modest_on_osso_application_autosave(gpointer data)
-{
-       
-}
-
-
-
-
diff --git a/src/hildon2/modest-osso-autosave-callbacks.h b/src/hildon2/modest-osso-autosave-callbacks.h
deleted file mode 100644 (file)
index 3676e8b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (c) 2007, 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_OSSO_AUTOSAVE_CALLBACKS_H__
-#define __MODEST_OSSO_AUTOSAVE_CALLBACKS_H__
-
-#include <glib.h>
-#include <libosso.h>
-
-void modest_on_osso_application_autosave(gpointer data);
-
-
-#endif /* __MODEST_OSSO_AUTOSAVE_CALLBACKS_H__ */
diff --git a/src/hildon2/modest-osso-state-saving.c b/src/hildon2/modest-osso-state-saving.c
deleted file mode 100644 (file)
index 13e420b..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (c) 2007, 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 <modest-osso-state-saving.h>
-#include "modest-runtime.h"
-#include <libosso.h>
-
-void modest_osso_load_state()
-{
-       /* We don't need to call osso_state_read() 
-        * - we use our general widget-state-saving technique instead. */
-}
-
-void modest_osso_save_state()
-{
-       /* We don't need to call osso_state_write() 
-        * - we use our general widget-state-saving technique instead: */
-       modest_window_mgr_save_state_for_all_windows(
-               modest_runtime_get_window_mgr ());
-}
-
-
-
-
diff --git a/src/hildon2/modest-osso-state-saving.h b/src/hildon2/modest-osso-state-saving.h
deleted file mode 100644 (file)
index eee23df..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (c) 2007, 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_OSSO_STATE_SAVING_H__
-#define __MODEST_OSSO_STATE_SAVING_H__
-
-#include <glib.h>
-
-void modest_osso_load_state();
-
-void modest_osso_save_state();
-
-#endif /* __MODEST_OSSO_STATE_SAVING_H__ */
index 1125cde..cc9e75c 100644 (file)
@@ -41,7 +41,6 @@
 #include <modest-maemo-utils.h>
 #include <modest-utils.h>
 #include <dbus_api/modest-dbus-callbacks.h>
-#include <modest-osso-autosave-callbacks.h>
 #include <libosso.h>
 #include <tny-maemo-conic-device.h>
 #include <tny-camel-folder.h>
@@ -208,15 +207,6 @@ modest_platform_init (int argc, char *argv[])
        hw_state.shutdown_ind = TRUE;
        osso_hw_set_event_cb(osso_context, NULL, NULL, NULL);
 
-       /* Register osso auto-save callbacks: */
-       result = osso_application_set_autosave_cb (osso_context, 
-               modest_on_osso_application_autosave, NULL /* user_data */);
-       if (result != OSSO_OK) {
-               g_printerr ("modest: osso_application_set_autosave_cb() failed.\n");
-               return FALSE;
-       }
-       
-
        /* Make sure that the update interval is changed whenever its gconf key 
         * is changed */
        /* CAUTION: we're not using here the
index 58b2859..667224b 100644 (file)
@@ -66,8 +66,8 @@
 #include "maemo/modest-hildon-includes.h"
 #include "maemo/modest-connection-specific-smtp-window.h"
 #endif /* !MODEST_TOOLKIT_GTK */
-#include <modest-utils.h>
 
+#include <modest-utils.h>
 #include "widgets/modest-ui-constants.h"
 #include <widgets/modest-main-window.h>
 #include <widgets/modest-msg-view-window.h>
@@ -639,7 +639,7 @@ modest_ui_actions_on_quit (GtkAction *action, ModestWindow *win)
        ModestWindowMgr *mgr = NULL;
 
 #ifdef MODEST_PLATFORM_MAEMO
-       modest_osso_save_state();
+       modest_window_mgr_save_state_for_all_windows (modest_runtime_get_window_mgr ());
 #endif /* MODEST_PLATFORM_MAEMO */
 
        g_debug ("closing down, clearing %d item(s) from operation queue",