From: Sergio Villar Senin Date: Tue, 27 Oct 2009 15:58:09 +0000 (+0100) Subject: Remove unneeded modest_osso_load_state() and modest_osso_save_state() X-Git-Tag: 3.1.11~8 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=f3d583d6a6f5066b7f9ea655ee3c16c67a85a343 Remove unneeded modest_osso_load_state() and modest_osso_save_state() 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 --- diff --git a/src/hildon2/Makefile.am b/src/hildon2/Makefile.am index 5224c13..67fc237 100644 --- a/src/hildon2/Makefile.am +++ b/src/hildon2/Makefile.am @@ -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) diff --git a/src/hildon2/modest-accounts-window.c b/src/hildon2/modest-accounts-window.c index 345ee43..3eec8a5 100644 --- a/src/hildon2/modest-accounts-window.c +++ b/src/hildon2/modest-accounts-window.c @@ -28,8 +28,6 @@ */ #include -#include -#include #include #include #include @@ -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)); diff --git a/src/hildon2/modest-folder-window.c b/src/hildon2/modest-folder-window.c index 2750834..b970563 100644 --- a/src/hildon2/modest-folder-window.c +++ b/src/hildon2/modest-folder-window.c @@ -28,8 +28,6 @@ */ #include -#include -#include #include #include #include @@ -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 (); diff --git a/src/hildon2/modest-header-window.c b/src/hildon2/modest-header-window.c index f15ecc2..16792f7 100644 --- a/src/hildon2/modest-header-window.c +++ b/src/hildon2/modest-header-window.c @@ -28,8 +28,6 @@ */ #include -#include -#include #include #include #include @@ -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 (); diff --git a/src/hildon2/modest-mailboxes-window.c b/src/hildon2/modest-mailboxes-window.c index 4df7ced..04e8a7a 100644 --- a/src/hildon2/modest-mailboxes-window.c +++ b/src/hildon2/modest-mailboxes-window.c @@ -28,8 +28,6 @@ */ #include -#include -#include #include #include #include @@ -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 (); diff --git a/src/hildon2/modest-main-window.c b/src/hildon2/modest-main-window.c index 295850f..aba0ca6 100644 --- a/src/hildon2/modest-main-window.c +++ b/src/hildon2/modest-main-window.c @@ -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 @@ -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 index e51e4db..0000000 --- a/src/hildon2/modest-osso-autosave-callbacks.c +++ /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 - -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 index 3676e8b..0000000 --- a/src/hildon2/modest-osso-autosave-callbacks.h +++ /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 -#include - -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 index 13e420b..0000000 --- a/src/hildon2/modest-osso-state-saving.c +++ /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 -#include "modest-runtime.h" -#include - -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 index eee23df..0000000 --- a/src/hildon2/modest-osso-state-saving.h +++ /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 - -void modest_osso_load_state(); - -void modest_osso_save_state(); - -#endif /* __MODEST_OSSO_STATE_SAVING_H__ */ diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index 1125cde..cc9e75c 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -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 diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 58b2859..667224b 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -66,8 +66,8 @@ #include "maemo/modest-hildon-includes.h" #include "maemo/modest-connection-specific-smtp-window.h" #endif /* !MODEST_TOOLKIT_GTK */ -#include +#include #include "widgets/modest-ui-constants.h" #include #include @@ -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",