comparison pidgin/win32/wspell.c @ 29998:140990e07e01

We're not going to support aspell dictionaries on Windows anymore.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 15 Mar 2010 22:00:43 +0000
parents b248178bc7b0
children 3d045343e04d
comparison
equal deleted inserted replaced
29997:d4ebabbfdeb6 29998:140990e07e01
93 /*wpidginspell_new_attach = wgtkspell_new_attach;*/ 93 /*wpidginspell_new_attach = wgtkspell_new_attach;*/
94 } 94 }
95 SetErrorMode(old_error_mode); 95 SetErrorMode(old_error_mode);
96 } 96 }
97 97
98 static void lookup_aspell_path() {
99 const char *tmp;
100 gchar *aspell_path;
101
102 if ((tmp = g_getenv("PIDGIN_ASPELL_DIR")))
103 aspell_path = g_strdup(tmp);
104 else
105 aspell_path = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Path");
106
107 if (aspell_path != NULL) {
108 char *tmp = g_build_filename(aspell_path, "aspell-15.dll", NULL);
109 if (g_file_test(tmp, G_FILE_TEST_EXISTS)) {
110 const char *path = g_getenv("PATH");
111 purple_debug_info("wspell", "Found Aspell in %s\n", aspell_path);
112
113 g_free(tmp);
114
115 tmp = g_strdup_printf("%s%s%s", (path ? path : ""),
116 (path ? G_SEARCHPATH_SEPARATOR_S : ""),
117 aspell_path);
118
119 g_setenv("PATH", tmp, TRUE);
120
121 } else
122 purple_debug_warning("wspell", "Couldn't find aspell-15.dll\n");
123
124 g_free(tmp);
125 g_free(aspell_path);
126 } else
127 purple_debug_warning("wspell", "Aspell installation not found (this isn't necessarily a problem)\n");
128 }
129
130 void winpidgin_spell_init() { 98 void winpidgin_spell_init() {
131 /* We keep doing the aspell path thing so that previously installed dictionaries still work */
132 lookup_aspell_path();
133
134 load_gtkspell(); 99 load_gtkspell();
135 } 100 }