Diffstat (limited to 'core/launcher/inputmethods.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/inputmethods.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp index 8f3e812..62e316c 100644 --- a/core/launcher/inputmethods.cpp +++ b/core/launcher/inputmethods.cpp | |||
@@ -182,97 +182,101 @@ void InputMethods::showInputMethod(const QString& name) | |||
182 | int i = 0; | 182 | int i = 0; |
183 | QValueList<InputMethod>::Iterator it; | 183 | QValueList<InputMethod>::Iterator it; |
184 | InputMethod *im = 0; | 184 | InputMethod *im = 0; |
185 | for ( it = inputMethodList.begin(); it != inputMethodList.end(); ++it, i++ ) { | 185 | for ( it = inputMethodList.begin(); it != inputMethodList.end(); ++it, i++ ) { |
186 | QString lname = (*it).libName.mid((*it).libName.findRev('/') + 1); | 186 | QString lname = (*it).libName.mid((*it).libName.findRev('/') + 1); |
187 | if ( (*it).name() == name || lname == name ) { | 187 | if ( (*it).name() == name || lname == name ) { |
188 | im = &(*it); | 188 | im = &(*it); |
189 | break; | 189 | break; |
190 | } | 190 | } |
191 | } | 191 | } |
192 | if ( im ) | 192 | if ( im ) |
193 | chooseKeyboard(im); | 193 | chooseKeyboard(im); |
194 | } | 194 | } |
195 | 195 | ||
196 | void InputMethods::resetStates() | 196 | void InputMethods::resetStates() |
197 | { | 197 | { |
198 | if ( mkeyboard && !mkeyboard->newIM ) | 198 | if ( mkeyboard && !mkeyboard->newIM ) |
199 | mkeyboard->interface->resetState(); | 199 | mkeyboard->interface->resetState(); |
200 | } | 200 | } |
201 | 201 | ||
202 | QRect InputMethods::inputRect() const | 202 | QRect InputMethods::inputRect() const |
203 | { | 203 | { |
204 | if ( !mkeyboard || !mkeyboard->widget || !mkeyboard->widget->isVisible() ) | 204 | if ( !mkeyboard || !mkeyboard->widget || !mkeyboard->widget->isVisible() ) |
205 | return QRect(); | 205 | return QRect(); |
206 | else | 206 | else |
207 | return mkeyboard->widget->geometry(); | 207 | return mkeyboard->widget->geometry(); |
208 | } | 208 | } |
209 | 209 | ||
210 | void InputMethods::unloadInputMethods() | 210 | void InputMethods::unloadInputMethods() |
211 | { | 211 | { |
212 | unloadMethod( inputMethodList ); | 212 | unloadMethod( inputMethodList ); |
213 | unloadMethod( inputModifierList ); | 213 | unloadMethod( inputModifierList ); |
214 | inputMethodList.clear(); | 214 | inputMethodList.clear(); |
215 | inputModifierList.clear(); | 215 | inputModifierList.clear(); |
216 | 216 | ||
217 | } | 217 | } |
218 | 218 | ||
219 | void InputMethods::unloadMethod( QValueList<InputMethod>& list ) { | 219 | void InputMethods::unloadMethod( QValueList<InputMethod>& list ) { |
220 | QValueList<InputMethod>::Iterator it; | 220 | QValueList<InputMethod>::Iterator it; |
221 | 221 | ||
222 | for (it = list.begin(); it != list.end(); ++it ) | 222 | for (it = list.begin(); it != list.end(); ++it ) |
223 | (*it).releaseInterface(); | 223 | (*it).releaseInterface(); |
224 | 224 | ||
225 | } | 225 | } |
226 | 226 | ||
227 | 227 | ||
228 | QStringList InputMethods::plugins()const { | 228 | QStringList InputMethods::plugins()const { |
229 | QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; | 229 | QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; |
230 | #ifdef Q_OS_MACX | ||
231 | QDir dir( path, "lib*.dylib" ); | ||
232 | #else | ||
230 | QDir dir( path, "lib*.so" ); | 233 | QDir dir( path, "lib*.so" ); |
234 | #endif /* Q_OS_MACX */ | ||
231 | return dir.entryList(); | 235 | return dir.entryList(); |
232 | } | 236 | } |
233 | 237 | ||
234 | void InputMethods::installTranslator( const QString& type ) { | 238 | void InputMethods::installTranslator( const QString& type ) { |
235 | QStringList langs = Global::languageList(); | 239 | QStringList langs = Global::languageList(); |
236 | QStringList::ConstIterator lit; | 240 | QStringList::ConstIterator lit; |
237 | for ( lit= langs.begin(); lit!=langs.end(); ++lit) { | 241 | for ( lit= langs.begin(); lit!=langs.end(); ++lit) { |
238 | QString lang = *lit; | 242 | QString lang = *lit; |
239 | QTranslator * trans = new QTranslator(qApp); | 243 | QTranslator * trans = new QTranslator(qApp); |
240 | 244 | ||
241 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 245 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
242 | 246 | ||
243 | if ( trans->load( tfn )) | 247 | if ( trans->load( tfn )) |
244 | qApp->installTranslator( trans ); | 248 | qApp->installTranslator( trans ); |
245 | else | 249 | else |
246 | delete trans; | 250 | delete trans; |
247 | } | 251 | } |
248 | } | 252 | } |
249 | 253 | ||
250 | void InputMethods::setPreferedHandlers() { | 254 | void InputMethods::setPreferedHandlers() { |
251 | Config cfg("qpe"); | 255 | Config cfg("qpe"); |
252 | cfg.setGroup("InputMethod"); | 256 | cfg.setGroup("InputMethod"); |
253 | QString current = cfg.readEntry("current"); | 257 | QString current = cfg.readEntry("current"); |
254 | QString im = cfg.readEntry("im"); | 258 | QString im = cfg.readEntry("im"); |
255 | 259 | ||
256 | QValueList<InputMethod>::Iterator it; | 260 | QValueList<InputMethod>::Iterator it; |
257 | if (!inputModifierList.isEmpty() && !im.isEmpty() ) { | 261 | if (!inputModifierList.isEmpty() && !im.isEmpty() ) { |
258 | for (it = inputModifierList.begin(); it != inputModifierList.end(); ++it ) | 262 | for (it = inputModifierList.begin(); it != inputModifierList.end(); ++it ) |
259 | if ( (*it).name() == im ) { | 263 | if ( (*it).name() == im ) { |
260 | imethod = &(*it); break; | 264 | imethod = &(*it); break; |
261 | } | 265 | } |
262 | 266 | ||
263 | } | 267 | } |
264 | if (!inputMethodList.isEmpty() && !current.isEmpty() ) { | 268 | if (!inputMethodList.isEmpty() && !current.isEmpty() ) { |
265 | for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it ) | 269 | for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it ) |
266 | if ( (*it).name() == current ) { | 270 | if ( (*it).name() == current ) { |
267 | qWarning("preferred keyboard is %s", current.latin1() ); | 271 | qWarning("preferred keyboard is %s", current.latin1() ); |
268 | mkeyboard = &(*it); | 272 | mkeyboard = &(*it); |
269 | kbdButton->setPixmap( *mkeyboard->icon() ); | 273 | kbdButton->setPixmap( *mkeyboard->icon() ); |
270 | break; | 274 | break; |
271 | } | 275 | } |
272 | } | 276 | } |
273 | 277 | ||
274 | } | 278 | } |
275 | 279 | ||
276 | void InputMethods::loadInputMethods() | 280 | void InputMethods::loadInputMethods() |
277 | { | 281 | { |
278 | #ifndef QT_NO_COMPONENT | 282 | #ifndef QT_NO_COMPONENT |