summaryrefslogtreecommitdiff
path: root/core/launcher/inputmethods.cpp
Unidiff
Diffstat (limited to 'core/launcher/inputmethods.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/inputmethods.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp
index 586628b..24669ac 100644
--- a/core/launcher/inputmethods.cpp
+++ b/core/launcher/inputmethods.cpp
@@ -196,108 +196,108 @@ QRect InputMethods::inputRect() const
196 return QRect(); 196 return QRect();
197 else 197 else
198 return mkeyboard->widget->geometry(); 198 return mkeyboard->widget->geometry();
199} 199}
200 200
201void InputMethods::unloadInputMethods() 201void InputMethods::unloadInputMethods()
202{ 202{
203 unloadMethod( inputMethodList ); 203 unloadMethod( inputMethodList );
204 unloadMethod( inputModifierList ); 204 unloadMethod( inputModifierList );
205 inputMethodList.clear(); 205 inputMethodList.clear();
206 inputModifierList.clear(); 206 inputModifierList.clear();
207 207
208} 208}
209 209
210void InputMethods::unloadMethod( QValueList<InputMethod>& list ) { 210void InputMethods::unloadMethod( QValueList<InputMethod>& list ) {
211 QValueList<InputMethod>::Iterator it; 211 QValueList<InputMethod>::Iterator it;
212 212
213 for (it = list.begin(); it != list.end(); ++it ) 213 for (it = list.begin(); it != list.end(); ++it )
214 (*it).releaseInterface(); 214 (*it).releaseInterface();
215 215
216} 216}
217 217
218 218
219QStringList InputMethods::plugins()const { 219QStringList InputMethods::plugins()const {
220 QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; 220 QString path = QPEApplication::qpeDir() + "plugins/inputmethods";
221#ifdef Q_OS_MACX 221#ifdef Q_OS_MACX
222 QDir dir( path, "lib*.dylib" ); 222 QDir dir( path, "lib*.dylib" );
223#else 223#else
224 QDir dir( path, "lib*.so" ); 224 QDir dir( path, "lib*.so" );
225#endif /* Q_OS_MACX */ 225#endif /* Q_OS_MACX */
226 return dir.entryList(); 226 return dir.entryList();
227} 227}
228 228
229void InputMethods::installTranslator( const QString& type ) { 229void InputMethods::installTranslator( const QString& type ) {
230 QStringList langs = Global::languageList(); 230 QStringList langs = Global::languageList();
231 QStringList::ConstIterator lit; 231 QStringList::ConstIterator lit;
232 for ( lit= langs.begin(); lit!=langs.end(); ++lit) { 232 for ( lit= langs.begin(); lit!=langs.end(); ++lit) {
233 QString lang = *lit; 233 QString lang = *lit;
234 QTranslator * trans = new QTranslator(qApp); 234 QTranslator * trans = new QTranslator(qApp);
235 235
236 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 236 QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
237 237
238 if ( trans->load( tfn )) 238 if ( trans->load( tfn ))
239 qApp->installTranslator( trans ); 239 qApp->installTranslator( trans );
240 else 240 else
241 delete trans; 241 delete trans;
242 } 242 }
243} 243}
244 244
245void InputMethods::setPreferedHandlers() { 245void InputMethods::setPreferedHandlers() {
246 Config cfg("qpe"); 246 Config cfg("qpe");
247 cfg.setGroup("InputMethod"); 247 cfg.setGroup("InputMethod");
248 QString current = cfg.readEntry("current"); 248 QString current = cfg.readEntry("current");
249 QString im = cfg.readEntry("im"); 249 QString im = cfg.readEntry("im");
250 250
251 QValueList<InputMethod>::Iterator it; 251 QValueList<InputMethod>::Iterator it;
252 if (!inputModifierList.isEmpty() && !im.isEmpty() ) { 252 if (!inputModifierList.isEmpty() && !im.isEmpty() ) {
253 for (it = inputModifierList.begin(); it != inputModifierList.end(); ++it ) 253 for (it = inputModifierList.begin(); it != inputModifierList.end(); ++it )
254 if ( (*it).name() == im ) { 254 if ( (*it).name() == im ) {
255 imethod = &(*it); break; 255 imethod = &(*it); break;
256 } 256 }
257 257
258 } 258 }
259 if (!inputMethodList.isEmpty() && !current.isEmpty() ) { 259 if (!inputMethodList.isEmpty() && !current.isEmpty() ) {
260 for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it ) 260 for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it )
261 if ( (*it).name() == current ) { 261 if ( (*it).name() == current ) {
262 owarn << "preferred keyboard is " << current << "" << oendl; 262 owarn << "preferred keyboard is " << current << "" << oendl;
263 mkeyboard = &(*it); 263 mkeyboard = &(*it);
264 kbdButton->setPixmap( *mkeyboard->icon() ); 264 kbdButton->setPixmap( *mkeyboard->icon() );
265 break; 265 break;
266 } 266 }
267 } 267 }
268 268
269} 269}
270 270
271void InputMethods::loadInputMethods() 271void InputMethods::loadInputMethods()
272{ 272{
273#ifndef QT_NO_COMPONENT 273#ifndef QT_NO_COMPONENT
274 hideInputMethod(); 274 hideInputMethod();
275 mkeyboard = 0; 275 mkeyboard = 0;
276 276
277 unloadInputMethods(); 277 unloadInputMethods();
278 278
279 QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; 279 QString path = QPEApplication::qpeDir() + "plugins/inputmethods";
280 QStringList list = plugins(); 280 QStringList list = plugins();
281 QStringList::Iterator it; 281 QStringList::Iterator it;
282 for ( it = list.begin(); it != list.end(); ++it ) { 282 for ( it = list.begin(); it != list.end(); ++it ) {
283 InputMethodInterface *iface = 0; 283 InputMethodInterface *iface = 0;
284 ExtInputMethodInterface *eface = 0; 284 ExtInputMethodInterface *eface = 0;
285 QLibrary *lib = new QLibrary( path + "/" + *it ); 285 QLibrary *lib = new QLibrary( path + "/" + *it );
286 286
287 if ( lib->queryInterface( IID_InputMethod, (QUnknownInterface**)&iface ) == QS_OK ) { 287 if ( lib->queryInterface( IID_InputMethod, (QUnknownInterface**)&iface ) == QS_OK ) {
288 InputMethod input; 288 InputMethod input;
289 input.newIM = FALSE; 289 input.newIM = FALSE;
290 input.library = lib; 290 input.library = lib;
291 input.libName = *it; 291 input.libName = *it;
292 input.interface = iface; 292 input.interface = iface;
293 input.widget = input.interface->inputMethod( 0, inputWidgetStyle ); 293 input.widget = input.interface->inputMethod( 0, inputWidgetStyle );
294 input.interface->onKeyPress( this, SLOT(sendKey(ushort,ushort,ushort,bool,bool)) ); 294 input.interface->onKeyPress( this, SLOT(sendKey(ushort,ushort,ushort,bool,bool)) );
295 inputMethodList.append( input ); 295 inputMethodList.append( input );
296 } else if ( lib->queryInterface( IID_ExtInputMethod, (QUnknownInterface**)&eface ) == QS_OK ) { 296 } else if ( lib->queryInterface( IID_ExtInputMethod, (QUnknownInterface**)&eface ) == QS_OK ) {
297 InputMethod input; 297 InputMethod input;
298 input.newIM = TRUE; 298 input.newIM = TRUE;
299 input.library = lib; 299 input.library = lib;
300 input.libName = *it; 300 input.libName = *it;
301 input.extInterface = eface; 301 input.extInterface = eface;
302 input.widget = input.extInterface->keyboardWidget( 0, inputWidgetStyle ); 302 input.widget = input.extInterface->keyboardWidget( 0, inputWidgetStyle );
303 // may be either a simple, or advanced. 303 // may be either a simple, or advanced.