After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 550775 - Can't add words to dictionary in empathy
Can't add words to dictionary in empathy
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat
2.27.x
Other All
: Normal enhancement
: ---
Assigned To: empathy-maint
: 568563 593349 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-09-04 05:34 UTC by Laurent Bigonville
Modified: 2010-10-22 12:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (6.16 KB, patch)
2010-10-21 08:26 UTC, Guillaume Desmottes
reviewed Details | Review
updated patch (7.48 KB, patch)
2010-10-21 11:51 UTC, Vitaly Minko
committed Details | Review

Description Laurent Bigonville 2008-09-04 05:34:02 UTC
There is no way to add words to the dictionary, please add a menu entry in the contextual menu

Other information:
Please see: https://bugs.launchpad.net/ubuntu/+source/empathy/+bug/188447
Comment 1 Guillaume Desmottes 2009-01-18 20:07:53 UTC
indeed.
Comment 2 Frederic Peters 2009-01-21 16:06:04 UTC
*** Bug 568563 has been marked as a duplicate of this bug. ***
Comment 3 Frederic Peters 2009-08-28 11:28:57 UTC
*** Bug 593349 has been marked as a duplicate of this bug. ***
Comment 4 Vitaly Minko 2010-10-20 16:04:24 UTC
Fixed in
repo: git://vminko.org/empathy
branch: fix-550775
Comment 5 Guillaume Desmottes 2010-10-21 08:26:39 UTC
Created attachment 172903 [details] [review]
patch

attaching diff for easier review.
Comment 6 Guillaume Desmottes 2010-10-21 08:46:08 UTC
Review of attachment 172903 [details] [review]:

This look pretty good; thanks! My comments are mostly esthetic changes.

::: libempathy-gtk/empathy-chat.c
@@ +1885,3 @@
+
+static GtkWidget *
+chat_spelling_build_add_to_dictionary_item (EmpathyChatSpell *chat_spell)

I think I'd mimic xchat-gnome's UI: put the 'Add' entry in the spelling suggestion after the languages with a separator.

@@ +1896,3 @@
+	g_assert (codes != NULL);
+	if (g_list_length (codes) > 1) {
+		label = g_strdup_printf(_("Add '%s' to Dictionary"),

You should add a translator comment explaining the semantic of %s.
Syntax is:  /* translators: badger */

@@ +1910,3 @@
+			code = l->data;
+			name = empathy_spell_get_language_name (code);
+			if (!name)

if (name == NULL)

@@ +1918,3 @@
+						  chat_spell->word, code);
+			g_object_set_data_full (G_OBJECT (lang_item),
+				"chat_word", chat_word,

When are you using this data? Or is it just to destroy the chat_word when the menu is destroyed?
We'd usually use "chat-word" for data keys.

::: libempathy-gtk/empathy-spell.c
@@ +411,3 @@
 
+void
+empathy_spell_add_to_dictionary (const gchar *code, const gchar *word)

Should be one line par arg (I know this file doesn't respect our coding style but best to do it with new code).

@@ +419,3 @@
+
+	spell_setup_languages ();
+	if (!languages) {

if (ptr == NULL). Also, no need to use { } for one line block.

@@ +424,3 @@
+
+	lang = g_hash_table_lookup (languages, code);
+	if (!lang) {

same here.
Comment 7 Vitaly Minko 2010-10-21 11:50:35 UTC
Fixed in branch: fix-550775-v2

>Or is it just to destroy the chat_word when the menu is destroyed?

Yes
Comment 8 Vitaly Minko 2010-10-21 11:51:04 UTC
Created attachment 172926 [details] [review]
updated patch
Comment 9 Guillaume Desmottes 2010-10-22 12:09:11 UTC
Merged to master; thanks a lot.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.