gossip r2831 - in trunk: . data/glade src



Author: mr
Date: Sun Jul 20 13:29:18 2008
New Revision: 2831
URL: http://svn.gnome.org/viewvc/gossip?rev=2831&view=rev

Log:
Make it possible to filter the spelling	corrections by language


Modified:
   trunk/ChangeLog
   trunk/data/glade/main.glade
   trunk/src/gossip-preferences.c
   trunk/src/gossip-spell-dialog.c
   trunk/src/gossip-spell.c
   trunk/src/gossip-spell.h

Modified: trunk/data/glade/main.glade
==============================================================================
--- trunk/data/glade/main.glade	(original)
+++ trunk/data/glade/main.glade	Sun Jul 20 13:29:18 2008
@@ -3049,29 +3049,53 @@
       </child>
 
       <child>
-	<widget class="GtkVBox" id="vbox128">
-	  <property name="border_width">5</property>
+	<widget class="GtkVBox" id="vbox224">
 	  <property name="visible">True</property>
 	  <property name="homogeneous">False</property>
-	  <property name="spacing">6</property>
+	  <property name="spacing">18</property>
 
 	  <child>
-	    <widget class="GtkLabel" id="label_word">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Suggestions for the word:</property>
-	      <property name="use_underline">False</property>
-	      <property name="use_markup">True</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
-	      <property name="wrap">True</property>
-	      <property name="selectable">False</property>
-	      <property name="xalign">0</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xpad">0</property>
-	      <property name="ypad">0</property>
-	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	      <property name="width_chars">-1</property>
-	      <property name="single_line_mode">False</property>
-	      <property name="angle">0</property>
+	    <widget class="GtkVBox" id="vbox_language">
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label661">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Language:</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">True</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkComboBox" id="combobox_language">
+		  <property name="visible">True</property>
+		  <property name="add_tearoffs">False</property>
+		  <property name="focus_on_click">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="padding">0</property>
@@ -3081,26 +3105,68 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkScrolledWindow" id="scrolledwindow9">
+	    <widget class="GtkVBox" id="vbox128">
+	      <property name="border_width">5</property>
 	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-	      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-	      <property name="shadow_type">GTK_SHADOW_IN</property>
-	      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
 
 	      <child>
-		<widget class="GtkTreeView" id="treeview_words">
+		<widget class="GtkLabel" id="label_word">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Suggestions for the word:</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">True</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkScrolledWindow" id="scrolledwindow9">
+		  <property name="width_request">300</property>
+		  <property name="height_request">225</property>
 		  <property name="visible">True</property>
 		  <property name="can_focus">True</property>
-		  <property name="headers_visible">False</property>
-		  <property name="rules_hint">False</property>
-		  <property name="reorderable">False</property>
-		  <property name="enable_search">True</property>
-		  <property name="fixed_height_mode">False</property>
-		  <property name="hover_selection">False</property>
-		  <property name="hover_expand">False</property>
+		  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		  <property name="shadow_type">GTK_SHADOW_IN</property>
+		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+		  <child>
+		    <widget class="GtkTreeView" id="treeview_words">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="has_focus">True</property>
+		      <property name="headers_visible">False</property>
+		      <property name="rules_hint">False</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <property name="fixed_height_mode">False</property>
+		      <property name="hover_selection">False</property>
+		      <property name="hover_expand">False</property>
+		    </widget>
+		  </child>
 		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
 	      </child>
 	    </widget>
 	    <packing>

Modified: trunk/src/gossip-preferences.c
==============================================================================
--- trunk/src/gossip-preferences.c	(original)
+++ trunk/src/gossip-preferences.c	Sun Jul 20 13:29:18 2008
@@ -305,7 +305,8 @@
 				    -1);
 	}
 
-	gossip_spell_free_language_codes (codes);
+	g_list_foreach (codes, (GFunc) g_free, NULL);
+	g_list_free (codes);
 }
 
 static void

Modified: trunk/src/gossip-spell-dialog.c
==============================================================================
--- trunk/src/gossip-spell-dialog.c	(original)
+++ trunk/src/gossip-spell-dialog.c	Sun Jul 20 13:29:18 2008
@@ -23,13 +23,7 @@
 #include <string.h>
 
 #include <glib/gi18n.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkliststore.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtksizegroup.h>
+#include <gtk/gtk.h>
 #include <glade/glade.h>
 
 #include "gossip-chat.h"
@@ -39,10 +33,15 @@
 
 typedef struct {
 	GtkWidget   *window;
-	GtkWidget   *button_replace;
+
+	GtkWidget   *vbox_language;
+	GtkWidget   *combobox_language;
+
 	GtkWidget   *label_word;
 	GtkWidget   *treeview_words;
 
+	GtkWidget   *button_replace;
+
 	GossipChat  *chat;
 
 	gchar       *word;
@@ -55,62 +54,103 @@
 	COL_SPELL_COUNT
 };
 
-static void spell_dialog_model_populate_columns     (GossipSpellDialog *dialog);
-static void spell_dialog_model_populate_suggestions (GossipSpellDialog *dialog);
-static void spell_dialog_model_row_activated_cb     (GtkTreeView       *tree_view,
-						     GtkTreePath       *path,
-						     GtkTreeViewColumn *column,
-						     GossipSpellDialog *dialog);
-static void spell_dialog_model_selection_changed_cb (GtkTreeSelection  *treeselection,
-						     GossipSpellDialog *dialog);
-static void spell_dialog_model_setup                (GossipSpellDialog *dialog);
-static void spell_dialog_response_cb                (GtkWidget         *widget,
-						     gint               response,
-						     GossipSpellDialog *dialog);
-static void spell_dialog_destroy_cb                 (GtkWidget         *widget,
-						     GossipSpellDialog *dialog);
+enum {
+	COL_LANG_CODE,
+	COL_LANG_NAME,
+	COL_LANG_COUNT
+};
 
 static void
-spell_dialog_model_populate_columns (GossipSpellDialog *dialog)
+model_populate_languages (GossipSpellDialog *dialog)
 {
-	GtkTreeModel      *model;
-	GtkTreeViewColumn *column;
-	GtkCellRenderer   *renderer;
-	guint              col_offset;
+	GtkComboBox  *combobox;
+	GtkTreeModel *model;
+	GtkListStore *store;
+	GtkTreeIter   iter;
+	GList        *codes, *l;
 
-	model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->treeview_words));
+ 	/* Words treeview */
+	combobox = GTK_COMBO_BOX (dialog->combobox_language);
 
-	renderer = gtk_cell_renderer_text_new ();
-	col_offset = gtk_tree_view_insert_column_with_attributes (
-		GTK_TREE_VIEW (dialog->treeview_words),
-		-1, _("Word"),
-		renderer,
-		"text", COL_SPELL_WORD,
-		NULL);
+	model = gtk_combo_box_get_model (combobox);
+	store = GTK_LIST_STORE (model);
 
-	g_object_set_data (G_OBJECT (renderer),
-			   "column", GINT_TO_POINTER (COL_SPELL_WORD));
+	codes = gossip_spell_get_language_codes ();
+	for (l = codes; l; l = l->next) {
+		const gchar *code;
+		const gchar *name;
+
+		code = l->data;
+		name = gossip_spell_get_language_name (code);
+		if (!name) {
+			continue;
+		}
 
-	column = gtk_tree_view_get_column (GTK_TREE_VIEW (dialog->treeview_words), col_offset - 1);
-	gtk_tree_view_column_set_sort_column_id (column, COL_SPELL_WORD);
-	gtk_tree_view_column_set_resizable (column, FALSE);
-	gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter,
+				    COL_LANG_CODE, code,
+				    COL_LANG_NAME, name,
+				    -1);
+	}
+	
+	/* Only show the combo if we have enough languages */
+	if (g_list_length (codes) != 1) {
+		gtk_widget_show (dialog->vbox_language);
+	} else {
+		gtk_widget_hide (dialog->vbox_language);
+	}
+
+	g_list_foreach (codes, (GFunc) g_free, NULL);
+	g_list_free (codes);
+
+	/* Insert the 'All' option and separator. */
+	gtk_list_store_prepend (store, &iter);
+	gtk_list_store_set (store, &iter,
+			    COL_LANG_CODE, "-",
+			    COL_LANG_NAME, _("All"),
+			    -1);
+
+	gtk_list_store_prepend (store, &iter);
+	gtk_list_store_set (store, &iter,
+			    COL_LANG_CODE, NULL,
+			    COL_LANG_NAME, _("All"),
+			    -1);
+
+	/* Select 'ALL' by default */
+	gtk_combo_box_set_active_iter (combobox, &iter);
 }
 
 static void
-spell_dialog_model_populate_suggestions (GossipSpellDialog *dialog)
+model_populate_suggestions (GossipSpellDialog *dialog)
 {
 	GtkTreeModel *model;
 	GtkListStore *store;
+	GtkTreeIter   iter;
+	GtkComboBox  *combobox;
 	GList        *suggestions, *l;
+	gchar        *code;
+
+	/* Get combobox model */
+	combobox = GTK_COMBO_BOX (dialog->combobox_language);
+	model = gtk_combo_box_get_model (combobox);
 
+	if (!gtk_combo_box_get_active_iter (combobox, &iter)) {
+		return;
+	}
+
+	/* Get current code */
+	gtk_tree_model_get (model, &iter, COL_LANG_CODE, &code, -1);
+
+	/* Get list model */ 
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->treeview_words));
 	store = GTK_LIST_STORE (model);
 
-	suggestions = gossip_spell_get_suggestions (dialog->word);
-	for (l = suggestions; l; l=l->next) {
-		GtkTreeIter  iter;
-		gchar       *word;
+	/* Clear list */
+	gtk_list_store_clear (store);
+	
+	suggestions = gossip_spell_get_suggestions (dialog->word, code);
+	for (l = suggestions; l; l = l->next) {
+		const gchar *word;
 
 		word = l->data;
 
@@ -120,21 +160,66 @@
 				    -1);
 	}
 
-	gossip_spell_free_suggestions (suggestions);
+	g_free (code);
+	g_list_foreach (suggestions, (GFunc) g_free, NULL);
+	g_list_free (suggestions);
+	
+	/* Select first by default */
+	if (gtk_tree_model_get_iter_first (model, &iter)) {
+		GtkTreeView      *view;
+		GtkTreeSelection *selection;
+
+		view = GTK_TREE_VIEW (dialog->treeview_words);
+		selection = gtk_tree_view_get_selection (view);
+		gtk_tree_selection_select_iter (selection, &iter);
+	}
 }
 
 static void
-spell_dialog_model_row_activated_cb (GtkTreeView       *tree_view,
-			       GtkTreePath       *path,
-			       GtkTreeViewColumn *column,
-			       GossipSpellDialog *dialog)
+dialog_response_cb (GtkWidget         *widget,
+		    gint               response,
+		    GossipSpellDialog *dialog)
 {
-	spell_dialog_response_cb (dialog->window, GTK_RESPONSE_OK, dialog);
+	if (response == GTK_RESPONSE_OK) {
+		GtkTreeView      *view;
+		GtkTreeModel     *model;
+		GtkTreeSelection *selection;
+		GtkTreeIter       iter;
+
+		gchar            *new_word;
+
+		view = GTK_TREE_VIEW (dialog->treeview_words);
+		selection = gtk_tree_view_get_selection (view);
+
+		if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
+			return;
+		}
+
+		gtk_tree_model_get (model, &iter, COL_SPELL_WORD, &new_word, -1);
+
+		gossip_chat_correct_word (dialog->chat,
+					  dialog->start,
+					  dialog->end,
+					  new_word);
+
+		g_free (new_word);
+	}
+
+	gtk_widget_destroy (dialog->window);
 }
 
 static void
-spell_dialog_model_selection_changed_cb (GtkTreeSelection  *treeselection,
-				   GossipSpellDialog *dialog)
+model_row_activated_cb (GtkTreeView       *tree_view,
+			GtkTreePath       *path,
+			GtkTreeViewColumn *column,
+			GossipSpellDialog *dialog)
+{
+	dialog_response_cb (dialog->window, GTK_RESPONSE_OK, dialog);
+}
+
+static void
+model_selection_changed_cb (GtkTreeSelection  *treeselection,
+			    GossipSpellDialog *dialog)
 {
 	gint count;
 
@@ -143,77 +228,111 @@
 }
 
 static void
-spell_dialog_model_setup (GossipSpellDialog *dialog)
+combobox_selection_changed_cb (GtkComboBox       *combobox,
+			       GossipSpellDialog *dialog)
+{
+	model_populate_suggestions (dialog);
+}
+
+static gboolean
+combobox_separator_func (GtkTreeModel *model,
+			  GtkTreeIter  *iter,
+			  gpointer      user_data)
+{
+	gchar    *code;
+	gboolean  is_separator;
+
+	gtk_tree_model_get (model, iter, COL_LANG_CODE, &code, -1);
+	is_separator = code && strcmp (code, "-") == 0;
+	g_free (code);
+
+	return is_separator;
+}
+
+static void
+model_setup (GossipSpellDialog *dialog)
 {
-	GtkTreeView      *view;
-	GtkListStore     *store;
-	GtkTreeSelection *selection;
+	GtkTreeView       *view;
+	GtkTreeViewColumn *column;
+	GtkTreeModel      *model;
+	GtkListStore      *store;
+	GtkTreeSelection  *selection;
+	GtkCellRenderer   *renderer;
+	GtkComboBox       *combobox;
+	guint              col_offset;
 
 	view = GTK_TREE_VIEW (dialog->treeview_words);
 
 	g_signal_connect (view, "row-activated",
-			  G_CALLBACK (spell_dialog_model_row_activated_cb),
+			  G_CALLBACK (model_row_activated_cb),
 			  dialog);
 
 	store = gtk_list_store_new (COL_SPELL_COUNT,
 				    G_TYPE_STRING);   /* word */
 
 	gtk_tree_view_set_model (view, GTK_TREE_MODEL (store));
+	g_object_unref (store);
 
 	selection = gtk_tree_view_get_selection (view);
 	gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
 
 	g_signal_connect (selection, "changed",
-			  G_CALLBACK (spell_dialog_model_selection_changed_cb),
+			  G_CALLBACK (model_selection_changed_cb),
 			  dialog);
 
-	spell_dialog_model_populate_columns (dialog);
-	spell_dialog_model_populate_suggestions (dialog);
+	model = gtk_tree_view_get_model (view);
 
-	g_object_unref (store);
-}
+	renderer = gtk_cell_renderer_text_new ();
+	col_offset = gtk_tree_view_insert_column_with_attributes (view,
+								  -1, _("Word"),
+								  renderer,
+								  "text", COL_SPELL_WORD,
+								  NULL);
 
-static void
-spell_dialog_destroy_cb (GtkWidget         *widget,
-			 GossipSpellDialog *dialog)
-{
-	g_object_unref (dialog->chat);
-	g_free (dialog->word);
+	g_object_set_data (G_OBJECT (renderer), "column", 
+			   GINT_TO_POINTER (COL_SPELL_WORD));
 
-	g_free (dialog);
-}
+	column = gtk_tree_view_get_column (view, col_offset - 1);
+	gtk_tree_view_column_set_sort_column_id (column, COL_SPELL_WORD);
+	gtk_tree_view_column_set_resizable (column, FALSE);
+	gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
 
-static void
-spell_dialog_response_cb (GtkWidget         *widget,
-			  gint               response,
-			  GossipSpellDialog *dialog)
-{
-	if (response == GTK_RESPONSE_OK) {
-		GtkTreeView      *view;
-		GtkTreeModel     *model;
-		GtkTreeSelection *selection;
-		GtkTreeIter       iter;
+	/* Languages combobox */
+	combobox = GTK_COMBO_BOX (dialog->combobox_language);
 
-		gchar            *new_word;
+	store = gtk_list_store_new (COL_LANG_COUNT,
+				    G_TYPE_STRING,    /* code */
+				    G_TYPE_STRING);   /* language */
 
-		view = GTK_TREE_VIEW (dialog->treeview_words);
-		selection = gtk_tree_view_get_selection (view);
+	gtk_cell_layout_clear (GTK_CELL_LAYOUT (combobox));
 
-		if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
-			return;
-		}
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), renderer, TRUE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
+					"text", COL_LANG_NAME,
+					NULL);
 
-		gtk_tree_model_get (model, &iter, COL_SPELL_WORD, &new_word, -1);
+	gtk_combo_box_set_model (combobox, GTK_TREE_MODEL (store));
+	g_object_unref (store);
 
-		gossip_chat_correct_word (dialog->chat,
-					  dialog->start,
-					  dialog->end,
-					  new_word);
+	g_signal_connect (combobox, "changed",
+			  G_CALLBACK (combobox_selection_changed_cb),
+			  dialog);
 
-		g_free (new_word);
-	}
+	gtk_combo_box_set_row_separator_func (combobox, 
+					      combobox_separator_func,
+					      NULL, 
+					      NULL);
+}
 
-	gtk_widget_destroy (dialog->window);
+static void
+dialog_destroy_cb (GtkWidget         *widget,
+		   GossipSpellDialog *dialog)
+{
+	g_object_unref (dialog->chat);
+	g_free (dialog->word);
+
+	g_free (dialog);
 }
 
 void
@@ -242,27 +361,31 @@
 				     "spell_dialog",
 				     NULL,
 				     "spell_dialog", &dialog->window,
-				     "button_replace", &dialog->button_replace,
+				     "vbox_language", &dialog->vbox_language,
+				     "combobox_language", &dialog->combobox_language,
 				     "label_word", &dialog->label_word,
 				     "treeview_words", &dialog->treeview_words,
+				     "button_replace", &dialog->button_replace,
 				     NULL);
 
 	gossip_glade_connect (gui,
 			      dialog,
-			      "spell_dialog", "response", spell_dialog_response_cb,
-			      "spell_dialog", "destroy", spell_dialog_destroy_cb,
+			      "spell_dialog", "response", dialog_response_cb,
+			      "spell_dialog", "destroy", dialog_destroy_cb,
 			      NULL);
 
 	g_object_unref (gui);
 
-	str = g_strdup_printf ("%s:\n<b>%s</b>",
+	str = g_strdup_printf ("%s: <b>%s</b>",
 			       _("Suggestions for the word"),
 			       word);
 
 	gtk_label_set_markup (GTK_LABEL (dialog->label_word), str);
 	g_free (str);
 
-	spell_dialog_model_setup (dialog);
+	model_setup (dialog);
+	model_populate_languages (dialog);
+	model_populate_suggestions (dialog);
 
 	gtk_widget_show (dialog->window);
 }

Modified: trunk/src/gossip-spell.c
==============================================================================
--- trunk/src/gossip-spell.c	(original)
+++ trunk/src/gossip-spell.c	Sun Jul 20 13:29:18 2008
@@ -225,7 +225,7 @@
 
 			lang = g_slice_new0 (SpellLanguage);
 
-			lang->spell_config = new_aspell_config();
+			lang->spell_config = new_aspell_config ();
 
 			aspell_config_replace (lang->spell_config, "encoding", "utf-8");
 			aspell_config_replace (lang->spell_config, "lang", strv[i++]);
@@ -295,13 +295,6 @@
 	return codes;
 }
 
-void
-gossip_spell_free_language_codes (GList *codes)
-{
-	g_list_foreach (codes, (GFunc) g_free, NULL);
-	g_list_free (codes);
-}
-
 gboolean
 gossip_spell_check (const gchar *word)
 {
@@ -351,7 +344,8 @@
 }
 
 GList *
-gossip_spell_get_suggestions (const gchar *word)
+gossip_spell_get_suggestions (const gchar *word,
+			      const gchar *code)
 {
 	GList                   *l1;
 	GList                   *l2 = NULL;
@@ -368,9 +362,15 @@
 
 	for (l1 = languages; l1; l1 = l1->next) {
 		SpellLanguage *lang;
+		const gchar   *this_code;
 
 		lang = l1->data;
 
+		this_code = aspell_config_retrieve (lang->spell_config, "lang");
+		if (!this_code || (code && strcmp (code, this_code) != 0)) {
+			continue;
+		}
+
 		suggestions = aspell_speller_suggest (lang->spell_checker,
 						      word, len);
 
@@ -441,18 +441,5 @@
 	return NULL;
 }
 
-void
-gossip_spell_free_language_codes (GList *codes)
-{
-}
-
 #endif /* HAVE_ASPELL */
 
-
-void
-gossip_spell_free_suggestions (GList *suggestions)
-{
-	g_list_foreach (suggestions, (GFunc) g_free, NULL);
-	g_list_free (suggestions);
-}
-

Modified: trunk/src/gossip-spell.h
==============================================================================
--- trunk/src/gossip-spell.h	(original)
+++ trunk/src/gossip-spell.h	Sun Jul 20 13:29:18 2008
@@ -29,10 +29,10 @@
 gboolean     gossip_spell_supported           (void);
 const gchar *gossip_spell_get_language_name   (const gchar *code);
 GList       *gossip_spell_get_language_codes  (void);
-void         gossip_spell_free_language_codes (GList       *codes);
+
 gboolean     gossip_spell_check               (const gchar *word);
-GList *      gossip_spell_get_suggestions     (const gchar *word);
-void         gossip_spell_free_suggestions    (GList        *suggestions);
+GList *      gossip_spell_get_suggestions     (const gchar *word,
+					       const gchar *code);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]