diff options
Diffstat (limited to 'shell/e-shortcuts.c')
-rw-r--r-- | shell/e-shortcuts.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c index c76a12cbd1..2561ce91bb 100644 --- a/shell/e-shortcuts.c +++ b/shell/e-shortcuts.c @@ -619,10 +619,10 @@ storage_set_updated_folder_callback (EStorageSet *storage_set, } -/* GtkObject methods. */ +/* GObject methods. */ static void -impl_destroy (GtkObject *object) +impl_dispose (GObject *object) { EShortcuts *shortcuts; EShortcutsPrivate *priv; @@ -630,29 +630,46 @@ impl_destroy (GtkObject *object) shortcuts = E_SHORTCUTS (object); priv = shortcuts->priv; - g_free (priv->file_name); - unload_shortcuts (shortcuts); - if (priv->save_idle_id != 0) + if (priv->save_idle_id != 0) { gtk_idle_remove (priv->save_idle_id); + priv->save_idle_id = 0; + } if (priv->dirty) { if (! e_shortcuts_save (shortcuts, NULL)) g_warning (_("Error saving shortcuts.")); /* FIXME */ + priv->dirty = FALSE; } - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + (* G_OBJECT_CLASS (parent_class)->dispose) (object); +} + +static void +impl_finalize (GObject *object) +{ + EShortcuts *shortcuts; + EShortcutsPrivate *priv; + + shortcuts = E_SHORTCUTS (object); + priv = shortcuts->priv; + + g_free (priv->file_name); + g_free (priv); + + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } static void class_init (EShortcutsClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = (GtkObjectClass*) klass; - object_class->destroy = impl_destroy; + object_class = G_OBJECT_CLASS (klass); + object_class->dispose = impl_dispose; + object_class->finalize = impl_finalize; parent_class = gtk_type_class (gtk_object_get_type ()); |