Diffstat (limited to 'noncore/apps/keyz-cfg/zkb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/keyz-cfg/zkb.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp index f315d4b..8382615 100644 --- a/noncore/apps/keyz-cfg/zkb.cpp +++ b/noncore/apps/keyz-cfg/zkb.cpp | |||
@@ -343,49 +343,49 @@ QStringList Keymap::listLabels() { | |||
343 | 343 | ||
344 | return ret; | 344 | return ret; |
345 | } | 345 | } |
346 | 346 | ||
347 | State* Keymap::getStateByLabel(const QString& label) { | 347 | State* Keymap::getStateByLabel(const QString& label) { |
348 | QMap<QString, QString>::Iterator lit = labels.find(label); | 348 | QMap<QString, QString>::Iterator lit = labels.find(label); |
349 | State* state = 0; | 349 | State* state = 0; |
350 | 350 | ||
351 | if (lit == labels.end()) { | 351 | if (lit == labels.end()) { |
352 | return 0; | 352 | return 0; |
353 | } | 353 | } |
354 | 354 | ||
355 | QString name = lit.data(); | 355 | QString name = lit.data(); |
356 | 356 | ||
357 | int n = name.find(":*"); | 357 | int n = name.find(":*"); |
358 | if (n>=0 && n==(int)(name.length()-2)) { | 358 | if (n>=0 && n==(int)(name.length()-2)) { |
359 | name=name.left(name.length() - 1); | 359 | name=name.left(name.length() - 1); |
360 | 360 | ||
361 | n = currentStateName.findRev(":"); | 361 | n = currentStateName.findRev(":"); |
362 | if (n >= 0) { | 362 | if (n >= 0) { |
363 | name += currentStateName.mid(n+1); | 363 | name += currentStateName.mid(n+1); |
364 | } | 364 | } |
365 | } | 365 | } |
366 | 366 | ||
367 | //qDebug("look for: %s\n", (const char*) name.utf8()); | 367 | //odebug << "look for: " << (const char*) name.utf8() << "\n" << oendl; |
368 | QMap<QString, State*>::Iterator sit = states.find(name); | 368 | QMap<QString, State*>::Iterator sit = states.find(name); |
369 | if (sit != states.end()) { | 369 | if (sit != states.end()) { |
370 | state = sit.data(); | 370 | state = sit.data(); |
371 | } | 371 | } |
372 | 372 | ||
373 | return state; | 373 | return state; |
374 | } | 374 | } |
375 | 375 | ||
376 | bool Keymap::addState(const QString& name, State* state) { | 376 | bool Keymap::addState(const QString& name, State* state) { |
377 | if (states.find(name) != states.end()) { | 377 | if (states.find(name) != states.end()) { |
378 | return false; | 378 | return false; |
379 | } | 379 | } |
380 | 380 | ||
381 | states.insert(name, state); | 381 | states.insert(name, state); |
382 | lsmapInSync = false; | 382 | lsmapInSync = false; |
383 | 383 | ||
384 | if (currentState == 0) { | 384 | if (currentState == 0) { |
385 | setCurrentState(state); | 385 | setCurrentState(state); |
386 | } | 386 | } |
387 | 387 | ||
388 | return true; | 388 | return true; |
389 | } | 389 | } |
390 | 390 | ||
391 | State* Keymap::getCurrentState() const { | 391 | State* Keymap::getCurrentState() const { |
@@ -395,49 +395,49 @@ State* Keymap::getCurrentState() const { | |||
395 | QString Keymap::getCurrentLabel() { | 395 | QString Keymap::getCurrentLabel() { |
396 | return currentLabel; | 396 | return currentLabel; |
397 | } | 397 | } |
398 | 398 | ||
399 | bool Keymap::setCurrentState(State* state) { | 399 | bool Keymap::setCurrentState(State* state) { |
400 | QMap<QString, State*>::Iterator it; | 400 | QMap<QString, State*>::Iterator it; |
401 | for(it = states.begin(); it != states.end(); ++it) { | 401 | for(it = states.begin(); it != states.end(); ++it) { |
402 | State* s = it.data(); | 402 | State* s = it.data(); |
403 | if (s == state) { | 403 | if (s == state) { |
404 | currentState = s; | 404 | currentState = s; |
405 | currentStateName = it.key(); | 405 | currentStateName = it.key(); |
406 | 406 | ||
407 | qDebug("state changed: %s\n", (const char*) | 407 | qDebug("state changed: %s\n", (const char*) |
408 | currentStateName.utf8()); | 408 | currentStateName.utf8()); |
409 | 409 | ||
410 | if (!lsmapInSync) { | 410 | if (!lsmapInSync) { |
411 | generateLabelStateMaps(); | 411 | generateLabelStateMaps(); |
412 | } | 412 | } |
413 | 413 | ||
414 | QMap<State*, QString>::Iterator tit; | 414 | QMap<State*, QString>::Iterator tit; |
415 | tit = stateLabelMap.find(state); | 415 | tit = stateLabelMap.find(state); |
416 | if (tit != stateLabelMap.end()) { | 416 | if (tit != stateLabelMap.end()) { |
417 | currentLabel = tit.data(); | 417 | currentLabel = tit.data(); |
418 | } else { | 418 | } else { |
419 | // qDebug("no label for: " + currentStateName + "\n"); | 419 | // odebug << "no label for: " + currentStateName + "\n" << oendl; |
420 | currentLabel = ""; | 420 | currentLabel = ""; |
421 | } | 421 | } |
422 | 422 | ||
423 | return true; | 423 | return true; |
424 | } | 424 | } |
425 | } | 425 | } |
426 | 426 | ||
427 | return false; | 427 | return false; |
428 | } | 428 | } |
429 | 429 | ||
430 | bool Keymap::removeState(const QString& name, bool force) { | 430 | bool Keymap::removeState(const QString& name, bool force) { |
431 | QMap<QString, State*>::Iterator it = states.find(name); | 431 | QMap<QString, State*>::Iterator it = states.find(name); |
432 | 432 | ||
433 | if (it == states.end()) { | 433 | if (it == states.end()) { |
434 | return false; | 434 | return false; |
435 | } | 435 | } |
436 | 436 | ||
437 | State* state = it.data(); | 437 | State* state = it.data(); |
438 | QList<Action> acts = findStateUsage(state); | 438 | QList<Action> acts = findStateUsage(state); |
439 | 439 | ||
440 | if (!acts.isEmpty()) { | 440 | if (!acts.isEmpty()) { |
441 | if (!force) { | 441 | if (!force) { |
442 | return false; | 442 | return false; |
443 | } else { | 443 | } else { |