2004-11-12 [paul] 0.9.12cvs146.4
[claws.git] / src / prefs_spelling.c
index 0c4473bc184c5f35726b376ed9332bcb12595308..ea3c0e8d6de1d57a9d9a44fc2655711d351d2b7d 100644 (file)
@@ -97,7 +97,7 @@ static void prefs_spelling_btn_aspell_path_clicked_cb(GtkWidget *widget,
        if (file_path != NULL) {
                gchar *tmp_path, *tmp;
 
-               tmp_path = g_dirname(file_path);
+               tmp_path = g_path_get_dirname(file_path);
                tmp = g_strdup_printf("%s%s", tmp_path, G_DIR_SEPARATOR_S);
                g_free(tmp_path);
 
@@ -371,6 +371,20 @@ void prefs_spelling_init(void)
 
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_spelling = page;
+       
+       if (!prefs_common.dictionary)
+               prefs_common.dictionary = g_strdup_printf("%s%s",
+                                               prefs_common.aspell_path,
+                                               g_getenv("LANG"));
+       if (!strlen(prefs_common.dictionary)
+       ||  !strcmp(prefs_common.dictionary,"(None"))
+               prefs_common.dictionary = g_strdup_printf("%s%s",
+                                               prefs_common.aspell_path,
+                                               g_getenv("LANG"));
+       if (strcasestr(prefs_common.dictionary,".utf"))
+               *(strcasestr(prefs_common.dictionary,".utf")) = '\0';
+       if (strstr(prefs_common.dictionary,"@"))
+               *(strstr(prefs_common.dictionary,"@")) = '\0';
 }
 
 void prefs_spelling_done(void)