From a34abf663c9b2331da2f4a84f942fd1de69773c0 Mon Sep 17 00:00:00 2001 From: hausmann Date: Mon, 18 Dec 2006 12:25:10 +0000 Subject: [PATCH] merge branches/work/kaction-cleanup-branch: Simplify and clean up KShortcut git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/KDE/kdeaccessibility@614599 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmouth/phrasebook/phrasebookdialog.cpp | 4 ++-- kmouth/phrasebook/phrasetree.cpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/kmouth/phrasebook/phrasebookdialog.cpp b/kmouth/phrasebook/phrasebookdialog.cpp index 31733fd1..080b3188 100644 --- a/kmouth/phrasebook/phrasebookdialog.cpp +++ b/kmouth/phrasebook/phrasebookdialog.cpp @@ -623,8 +623,8 @@ void PhraseBookDialog::capturedShortcut (const KShortcut& cut) { void PhraseBookDialog::setShortcut( const KShortcut& cut ) { // Check whether the shortcut is valid - for (int i = 0; i < cut.toList().count(); i++) { - const QKeySequence& seq = cut.toList()[i]; + for (int i = 0; i < cut.count(); i++) { + const QKeySequence& seq = cut[i]; //const KKey& key = seq.key(0); #ifdef __GNUC__ #warning "kde 4 port it"; diff --git a/kmouth/phrasebook/phrasetree.cpp b/kmouth/phrasebook/phrasetree.cpp index e4c65154..b16b3d8b 100644 --- a/kmouth/phrasebook/phrasetree.cpp +++ b/kmouth/phrasebook/phrasetree.cpp @@ -414,7 +414,7 @@ void PhraseTree::fillBook (PhraseBook *book, bool respectSelection) { do { if (i->isSelected() || !respectSelection || level > 0) { PhraseTreeItem *it = (PhraseTreeItem *)i; - Phrase phrase(it->text(0), it->cut().toStringInternal()); + Phrase phrase(it->text(0), it->cut().toString()); *book += PhraseBookEntry(phrase, level, it->isPhrase()); } @@ -458,11 +458,11 @@ bool PhraseTree::acceptDrag (QDropEvent* event) const { // Returns iSeq index if cut2 has a sequence of equal or higher priority // to a sequence in cut, else -1 static int keyConflict (const KShortcut& cut, const KShortcut& cut2) { - int nbCut = cut.toList().count(); - int nbCut2 = cut2.toList().count(); + int nbCut = cut.count(); + int nbCut2 = cut2.count(); for (int iSeq = 0; iSeq < nbCut; iSeq++) { for (int iSeq2 = 0; iSeq2 <= iSeq && iSeq2 < nbCut2; iSeq2++) { - if (cut.toList()[iSeq] == cut2.toList()[iSeq2]) + if (cut[iSeq] == cut2[iSeq2]) return iSeq; } } @@ -482,15 +482,15 @@ void PhraseTree::_warning (const QKeySequence& cut, QString sAction, const QStr } bool PhraseTree::isStdAccelPresent (const KShortcut& cut, bool warnUser) { - for (int iSeq = 0; iSeq < cut.toList().count(); iSeq++) { - const QKeySequence& seq = cut.toList()[iSeq]; + for (int iSeq = 0; iSeq < cut.count(); iSeq++) { + const QKeySequence& seq = cut[iSeq]; KStdAccel::StdAccel id = KStdAccel::findStdAccel( seq ); if( id != KStdAccel::AccelNone && keyConflict (cut, KStdAccel::shortcut(id)) > -1) { if (warnUser) - _warning (cut.toList()[iSeq], + _warning (cut[iSeq], i18n("the standard \"%1\" action", KStdAccel::label(id)), i18n("Conflict with Standard Application Shortcut")); return true; @@ -506,7 +506,7 @@ bool PhraseTree::isGlobalKeyPresent (const KShortcut& cut, bool warnUser) { int iSeq = keyConflict (cut, KShortcut(*it)); if (iSeq > -1) { if (warnUser) - _warning (cut.toList()[iSeq], + _warning (cut[iSeq], i18n("the global \"%1\" action", it.key()), i18n("Conflict with Global Shortcuts")); return true; @@ -522,7 +522,7 @@ bool PhraseTree::isPhraseKeyPresent (const KShortcut& cut, PhraseTreeItem* cutIt int iSeq = keyConflict (cut, item->cut()); if (iSeq > -1) { if (warnUser) - _warning (cut.toList()[iSeq], + _warning (cut[iSeq], i18n("an other phrase"), i18n("Key Conflict")); return true; -- 2.11.4.GIT