~ubuntu-branches/ubuntu/precise/konsole/precise-proposed

« back to all changes in this revision

Viewing changes to src/KeyboardTranslator.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-16 13:14:43 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20111216131443-rhdplbmmuxntat3k
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
}
57
57
QString KeyboardTranslatorManager::findTranslatorPath(const QString& name)
58
58
{
59
 
    return KGlobal::dirs()->findResource("data","konsole/"+name+".keytab");
 
59
    return KStandardDirs::locate("data","konsole/"+name+".keytab");
60
60
}
61
61
void KeyboardTranslatorManager::findTranslators()
62
62
{
73
73
        QString translatorPath = listIter.next();
74
74
 
75
75
        QString name = QFileInfo(translatorPath).baseName();
76
 
       
 
76
 
77
77
        if ( !_translators.contains(name) ) 
78
78
            _translators.insert(name,0);
79
79
    }
117
117
    {
118
118
        KeyboardTranslatorWriter writer(&destination);
119
119
        writer.writeHeader(translator->description());
120
 
    
 
120
 
121
121
        QListIterator<KeyboardTranslator::Entry> iter(translator->entries());
122
122
        while ( iter.hasNext() )
123
123
            writer.writeEntry(iter.next());
304
304
        command = KeyboardTranslator::ScrollLineUpCommand;
305
305
    else if ( text.compare("scrolllinedown",Qt::CaseInsensitive) == 0 )
306
306
        command = KeyboardTranslator::ScrollLineDownCommand;
 
307
    else if ( text.compare("scrolluptotop",Qt::CaseInsensitive) == 0 )
 
308
        command = KeyboardTranslator::ScrollUpToTopCommand;
 
309
    else if ( text.compare("scrolldowntobottom",Qt::CaseInsensitive) == 0 )
 
310
        command = KeyboardTranslator::ScrollDownToBottomCommand;
307
311
    else if ( text.compare("scrolllock",Qt::CaseInsensitive) == 0 )
308
312
        command = KeyboardTranslator::ScrollLockCommand;
309
313
    else
512
516
        text.remove(commentPos,text.length());
513
517
 
514
518
    text = text.simplified();
515
 
   
 
519
 
516
520
    // title line: keyboard "title"
517
521
    static QRegExp title("keyboard\\s+\"(.*)\"");
518
522
    // key line: key KeySequence : "output"
529
533
    {
530
534
        Token titleToken = { Token::TitleKeyword , QString() };
531
535
        Token textToken = { Token::TitleText , title.capturedTexts()[1] };
532
 
    
 
536
 
533
537
        list << titleToken << textToken;
534
538
    }
535
539
    else if  ( key.exactMatch(text) )
617
621
        if ( wantAnyModifier != anyModifiersSet )
618
622
           return false;
619
623
    }
620
 
    
 
624
 
621
625
    return true;
622
626
}
623
627
QByteArray KeyboardTranslator::Entry::escapedText(bool expandWildCards,Qt::KeyboardModifiers modifiers) const
768
772
        return "ScrollLineUp";
769
773
    else if ( _command == ScrollLineDownCommand )
770
774
        return "ScrollLineDown";
 
775
    else if ( _command == ScrollUpToTopCommand )
 
776
        return "ScrollUpToTop";
 
777
    else if ( _command == ScrollDownToBottomCommand)
 
778
        return "ScrollDownToBottom";
771
779
    else if ( _command == ScrollLockCommand )
772
780
        return "ScrollLock";
773
781