summaryrefslogtreecommitdiff
path: root/inputmethods/multikey/keyboard.cpp
Unidiff
Diffstat (limited to 'inputmethods/multikey/keyboard.cpp') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index 7ddfd3e..f8cafd5 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -1332,102 +1332,102 @@ ushort Keyboard::constoe(const ushort c) {
1332 case 0x1112: return 0x11c2; 1332 case 0x1112: return 0x11c2;
1333 default: return 0; 1333 default: return 0;
1334 1334
1335 } 1335 }
1336 1336
1337 } else { //echar to schar 1337 } else { //echar to schar
1338 1338
1339 switch (c) { 1339 switch (c) {
1340 case 0x11a8: return 0x1100; 1340 case 0x11a8: return 0x1100;
1341 case 0x11a9: return 0x1101; 1341 case 0x11a9: return 0x1101;
1342 case 0x11ab: return 0x1102; 1342 case 0x11ab: return 0x1102;
1343 case 0x11ae: return 0x1103; 1343 case 0x11ae: return 0x1103;
1344 case 0x11af: return 0x1105; 1344 case 0x11af: return 0x1105;
1345 case 0x11b7: return 0x1106; 1345 case 0x11b7: return 0x1106;
1346 case 0x11b8: return 0x1107; 1346 case 0x11b8: return 0x1107;
1347 case 0x11ba: return 0x1109; 1347 case 0x11ba: return 0x1109;
1348 case 0x11bb: return 0x110a; 1348 case 0x11bb: return 0x110a;
1349 case 0x11bc: return 0x110b; 1349 case 0x11bc: return 0x110b;
1350 case 0x11bd: return 0x110c; 1350 case 0x11bd: return 0x110c;
1351 case 0x11be: return 0x110e; 1351 case 0x11be: return 0x110e;
1352 case 0x11bf: return 0x110f; 1352 case 0x11bf: return 0x110f;
1353 case 0x11c0: return 0x1110; 1353 case 0x11c0: return 0x1110;
1354 case 0x11c1: return 0x1111; 1354 case 0x11c1: return 0x1111;
1355 case 0x11c2: return 0x1112; 1355 case 0x11c2: return 0x1112;
1356 default: return 0; 1356 default: return 0;
1357 1357
1358 } 1358 }
1359 1359
1360 } 1360 }
1361} 1361}
1362 1362
1363 1363
1364// Keys::Keys {{{1 1364// Keys::Keys {{{1
1365 1365
1366Keys::Keys() { 1366Keys::Keys() {
1367 1367
1368 Config *config = new Config ("multikey"); 1368 Config *config = new Config ("multikey");
1369 config->setGroup( "keymaps" ); 1369 config->setGroup( "keymaps" );
1370 QString map = config->readEntry( "current" ); 1370 QString map = config->readEntry( "current" );
1371 delete config; 1371 delete config;
1372 1372
1373 if (map.isNull() || !(QFile(map).exists())) { 1373 if (map.isNull() || !(QFile(map).exists())) {
1374 1374
1375 Config *config = new Config("locale"); 1375 Config *config = new Config("locale");
1376 config->setGroup( "Language" ); 1376 config->setGroup( "Language" );
1377 QString l = config->readEntry( "Language" , "en" ); 1377 QString l = config->readEntry( "Language" , "en" );
1378 delete config; 1378 delete config;
1379 1379
1380 map = QPEApplication::qpeDir() + "/share/multikey/" 1380 map = QPEApplication::qpeDir() + "share/multikey/"
1381 + l + ".keymap"; 1381 + l + ".keymap";
1382 1382
1383 } 1383 }
1384 if (map.isNull() || !(QFile(map).exists())) { 1384 if (map.isNull() || !(QFile(map).exists())) {
1385 map = QPEApplication::qpeDir() + "/share/multikey/en.keymap"; 1385 map = QPEApplication::qpeDir() + "share/multikey/en.keymap";
1386 } 1386 }
1387 1387
1388 setKeysFromFile(map); 1388 setKeysFromFile(map);
1389} 1389}
1390 1390
1391Keys::Keys(const char * filename) { 1391Keys::Keys(const char * filename) {
1392 1392
1393 setKeysFromFile(filename); 1393 setKeysFromFile(filename);
1394} 1394}
1395 1395
1396// Keys::setKeysFromFile {{{2 1396// Keys::setKeysFromFile {{{2
1397void Keys::setKeysFromFile(const char * filename) { 1397void Keys::setKeysFromFile(const char * filename) {
1398 1398
1399 QFile f(filename); 1399 QFile f(filename);
1400 1400
1401 if (f.open(IO_ReadOnly)) { 1401 if (f.open(IO_ReadOnly)) {
1402 1402
1403 QTextStream t(&f); 1403 QTextStream t(&f);
1404 int row; 1404 int row;
1405 int qcode; 1405 int qcode;
1406 ushort unicode; 1406 ushort unicode;
1407 int width; 1407 int width;
1408 QString buf; 1408 QString buf;
1409 QString comment; 1409 QString comment;
1410 char * xpm[256]; //couldnt be larger than that... could it? 1410 char * xpm[256]; //couldnt be larger than that... could it?
1411 QImage *xpm2pix = 0; 1411 QImage *xpm2pix = 0;
1412 1412
1413 buf = t.readLine(); 1413 buf = t.readLine();
1414 while (buf) { 1414 while (buf) {
1415 1415
1416 // get rid of comments 1416 // get rid of comments
1417 buf.replace(QRegExp("#.*$", FALSE, FALSE), ""); 1417 buf.replace(QRegExp("#.*$", FALSE, FALSE), "");
1418 1418
1419 // key definition 1419 // key definition
1420 if (buf.contains(QRegExp("^\\d+\\s+[0-1a-fx]+", FALSE, FALSE))) { 1420 if (buf.contains(QRegExp("^\\d+\\s+[0-1a-fx]+", FALSE, FALSE))) {
1421 // no $1 type referencing!!! this implementation of regexp sucks 1421 // no $1 type referencing!!! this implementation of regexp sucks
1422 1422
1423 // dont know of any sscanf() type funcs in Qt lib 1423 // dont know of any sscanf() type funcs in Qt lib
1424 QTextStream tmp (buf, IO_ReadOnly); 1424 QTextStream tmp (buf, IO_ReadOnly);
1425 tmp >> row >> qcode >> unicode >> width >> comment; 1425 tmp >> row >> qcode >> unicode >> width >> comment;
1426 1426
1427 buf = t.readLine(); 1427 buf = t.readLine();
1428 int xpmLineCount = 0; 1428 int xpmLineCount = 0;
1429 xpm2pix = 0; 1429 xpm2pix = 0;
1430 1430
1431 // erase blank space 1431 // erase blank space
1432 while (buf.contains(QRegExp("^\\s*$")) && buf) buf = t.readLine(); 1432 while (buf.contains(QRegExp("^\\s*$")) && buf) buf = t.readLine();
1433 1433