diff src/conversation.c @ 3209:265a3c9d0557

[gaim-migrate @ 3226] If gtkspell can't use ispell, it tries aspell; Thanks Andrew Sayman committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 05 May 2002 01:16:45 +0000
parents 332df87cf3d6
children 0970eabdd8df
line wrap: on
line diff
--- a/src/conversation.c	Sun May 05 01:06:15 2002 +0000
+++ b/src/conversation.c	Sun May 05 01:16:45 2002 +0000
@@ -65,6 +65,7 @@
 #include "pixmaps/farted.xpm"
 
 static gchar *ispell_cmd[] = { "ispell", "-a", NULL };
+static gchar *aspell_cmd[] = { "aspell", "--sug-mode=fast","-a", NULL };
 
 int state_lock = 0;
 
@@ -2899,8 +2900,19 @@
 	GSList *con = connections;
 	struct gaim_connection *gc;
 
-	if (convo_options & OPT_CONVO_CHECK_SPELLING)
-		gtkspell_start(NULL, ispell_cmd);
+	if (convo_options & OPT_CONVO_CHECK_SPELLING){
+		/*If ispell fails to start, start aspell. This is the way that
+		  Gabber does it. -- lorien420@myrealbox.com */
+		if (gtkspell_start(NULL, ispell_cmd)<0){
+			debug_printf("gtkspell failed to start when using ispell\n");
+			if (gtkspell_start(NULL, aspell_cmd)<0){
+				debug_printf("gtkspell failed to start when using aspell\n");
+			} else
+				debug_printf("gtkspell started with aspell\n");
+		} else {
+			debug_printf("gtkspell started with ispell\n");
+		}
+	}
 
 	while (cnv) {
 		c = (struct conversation *)cnv->data;