aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-10-01 00:21:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-10-01 00:21:41 +0800
commit983bea9996458f5b5f03e22b22ebd1a5203b7180 (patch)
treefcc02ac5f1083def0bd4d1509d297341d10b272f /composer
parentaa2bed6ae369073152cc889a86055878125a60db (diff)
downloadgsoc2013-evolution-983bea9996458f5b5f03e22b22ebd1a5203b7180.tar.gz
gsoc2013-evolution-983bea9996458f5b5f03e22b22ebd1a5203b7180.tar.zst
gsoc2013-evolution-983bea9996458f5b5f03e22b22ebd1a5203b7180.zip
Remove some unneeded composer autosave bits.
Closing the last main window no longer takes composer windows down with it, so we no longer need the "holy crap we're shutting down, quick save to disk!" logic.
Diffstat (limited to 'composer')
-rw-r--r--composer/e-composer-actions.c3
-rw-r--r--composer/e-composer-autosave.c6
-rw-r--r--composer/e-composer-autosave.h3
-rw-r--r--composer/e-msg-composer.c47
-rw-r--r--composer/e-msg-composer.h3
5 files changed, 5 insertions, 57 deletions
diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c
index bceeb1a9f5..9c2ed6aed6 100644
--- a/composer/e-composer-actions.c
+++ b/composer/e-composer-actions.c
@@ -64,8 +64,7 @@ action_close_cb (GtkAction *action,
editor = GTKHTML_EDITOR (composer);
widget = GTK_WIDGET (composer);
- if (!gtkhtml_editor_get_changed (editor) ||
- e_msg_composer_is_exiting (composer)) {
+ if (!gtkhtml_editor_get_changed (editor)) {
gtk_widget_destroy (widget);
return;
}
diff --git a/composer/e-composer-autosave.c b/composer/e-composer-autosave.c
index 1fd04c3c1e..5c5d7a5bce 100644
--- a/composer/e-composer-autosave.c
+++ b/composer/e-composer-autosave.c
@@ -232,8 +232,7 @@ e_composer_autosave_register (EMsgComposer *composer)
}
void
-e_composer_autosave_unregister (EMsgComposer *composer,
- gboolean delete_file)
+e_composer_autosave_unregister (EMsgComposer *composer)
{
AutosaveState *state;
@@ -243,8 +242,7 @@ e_composer_autosave_unregister (EMsgComposer *composer,
if (state == NULL || state->file == NULL)
return;
- if (delete_file)
- g_file_delete (state->file, NULL, NULL);
+ g_file_delete (state->file, NULL, NULL);
g_object_set_data (G_OBJECT (composer), "autosave", NULL);
}
diff --git a/composer/e-composer-autosave.h b/composer/e-composer-autosave.h
index 93b7a630d0..c413acdf59 100644
--- a/composer/e-composer-autosave.h
+++ b/composer/e-composer-autosave.h
@@ -26,8 +26,7 @@ G_BEGIN_DECLS
GList * e_composer_autosave_find_orphans (GError **error);
void e_composer_autosave_register (EMsgComposer *composer);
-void e_composer_autosave_unregister (EMsgComposer *composer,
- gboolean delete_file);
+void e_composer_autosave_unregister (EMsgComposer *composer);
void e_composer_autosave_snapshot_async
(EMsgComposer *composer,
GAsyncReadyCallback callback,
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 072eb41690..5561623f61 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1499,14 +1499,6 @@ static void
msg_composer_dispose (GObject *object)
{
EMsgComposer *composer = E_MSG_COMPOSER (object);
- gboolean delete_file;
-
- /* If the application is exiting, keep the autosave file so we can
- * restore it later. Otherwise we're just closing this composer
- * window, and the CLOSE action has already handled any unsaved
- * changes, so we can safely delete the autosave file. */
- delete_file = !composer->priv->application_exiting;
- e_composer_autosave_unregister (composer, delete_file);
e_composer_private_dispose (composer);
@@ -1519,6 +1511,7 @@ msg_composer_finalize (GObject *object)
{
EMsgComposer *composer = E_MSG_COMPOSER (object);
+ e_composer_autosave_unregister (composer);
e_composer_private_finalize (composer);
/* Chain up to parent's finalize() method. */
@@ -3872,44 +3865,6 @@ e_msg_composer_set_enable_autosave (EMsgComposer *composer,
e_composer_autosave_set_enabled (composer, enabled);
}
-gboolean
-e_msg_composer_is_exiting (EMsgComposer *composer)
-{
- g_return_val_if_fail (composer != NULL, FALSE);
-
- return composer->priv->application_exiting;
-}
-
-gboolean
-e_msg_composer_request_close_all (void)
-{
- GSList *iter, *next;
-
- for (iter = all_composers; iter != NULL; iter = next) {
- EMsgComposer *composer = iter->data;
-
- /* The CLOSE action will delete this list node,
- * so grab the next one while we still can. */
- next = iter->next;
-
- /* Try to autosave before closing. If it fails for
- * some reason, the CLOSE action will still detect
- * unsaved changes and prompt the user.
- *
- * FIXME If it /does/ prompt the user, the Cancel
- * button will act the same as Discard Changes,
- * which is misleading.
- */
- composer->priv->application_exiting = TRUE;
- e_composer_autosave_snapshot_async (composer,
- (GAsyncReadyCallback) e_composer_autosave_snapshot_finish,
- NULL);
- gtk_action_activate (ACTION (CLOSE));
- }
-
- return (all_composers == NULL);
-}
-
EMsgComposer *
e_msg_composer_load_from_file (const gchar *filename)
{
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index 1d5eb39d80..f1e760ff47 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -135,7 +135,6 @@ void e_msg_composer_add_message_attachments
CamelMimeMessage *message,
gboolean just_inlines);
-gboolean e_msg_composer_request_close_all(void);
EMsgComposer * e_msg_composer_load_from_file (const gchar *filename);
void e_msg_composer_check_autosave (GtkWindow *parent);
@@ -151,8 +150,6 @@ void e_msg_composer_set_send_options (EMsgComposer *composer,
GByteArray * e_msg_composer_get_raw_message_text
(EMsgComposer *composer);
-gboolean e_msg_composer_is_exiting (EMsgComposer *composer);
-
GList * e_load_spell_languages (void);
void e_save_spell_languages (GList *spell_languages);