[evolution/wip/webkit-composer: 645/966] em-composer-prefs.c cleanups.
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit-composer: 645/966] em-composer-prefs.c cleanups.
- Date: Wed, 23 Apr 2014 10:47:39 +0000 (UTC)
commit 5b1b2d603a65a09a58294320d097ddf2a39ca1d0
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Jan 20 11:10:31 2013 -0500
em-composer-prefs.c cleanups.
In spell_setup(), use e_spell_checker_get_language_active() instead of
e_load_spell_languages(). Also fix a memory leak from not freeing the
GList returned by e_spell_checker_list_available_dicts().
modules/mail/em-composer-prefs.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index 3c58a3a..13f6a55 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -145,22 +145,22 @@ spell_setup (EMComposerPrefs *prefs)
store = GTK_LIST_STORE (prefs->language_model);
- available_languages =
- e_spell_checker_list_available_dicts (prefs->spell_checker);
-
- active_languages = e_load_spell_languages (prefs->spell_checker);
+ list = e_spell_checker_list_available_dicts (prefs->spell_checker);
/* Populate the GtkListStore. */
- while (available_languages != NULL) {
- ESpellDictionary *language;
+ for (link = list; link != NULL; link = g_list_next (link)) {
+ ESpellDictionary *dictionary;
GtkTreeIter tree_iter;
const gchar *name;
const gchar *code;
gboolean active;
- language = available_languages->data;
- name = e_spell_dictionary_get_name (language);
- active = (g_list_find (active_languages, language) != NULL);
+ dictionary = E_SPELL_DICTIONARY (link->data);
+ name = e_spell_dictionary_get_name (dictionary);
+ code = e_spell_dictionary_get_code (dictionary);
+
+ active = e_spell_checker_get_language_active (
+ prefs->spell_checker, code);
gtk_list_store_append (store, &tree_iter);
@@ -169,7 +169,7 @@ spell_setup (EMComposerPrefs *prefs)
0, active, 1, name, 2, dictionary, -1);
}
- g_list_free_full (active_languages, g_object_unref);
+ g_list_free (list);
}
#define MAIL_SEND_ACCOUNT_OVERRIDE_KEY "sao-mail-send-account-override"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]