diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
commit | 7e51b6d5ddc01fc3bc69f30bc5d3933a7709dbf2 (patch) | |
tree | 6a288b084438ed144c0fbd4a34a9a22caf4d6b04 /kmymoney2/widgets/kmymoneyedit.cpp | |
parent | 154e6e6105157c321cbd578d238c525da419f868 (diff) | |
download | kmymoney-7e51b6d5ddc01fc3bc69f30bc5d3933a7709dbf2.tar.gz kmymoney-7e51b6d5ddc01fc3bc69f30bc5d3933a7709dbf2.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/widgets/kmymoneyedit.cpp')
-rw-r--r-- | kmymoney2/widgets/kmymoneyedit.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/kmymoney2/widgets/kmymoneyedit.cpp b/kmymoney2/widgets/kmymoneyedit.cpp index 2e59e32..ad51606 100644 --- a/kmymoney2/widgets/kmymoneyedit.cpp +++ b/kmymoney2/widgets/kmymoneyedit.cpp @@ -73,30 +73,30 @@ TQValidator::State kMyMoneyMoneyValidator::validate( TQString & input, int & _p t = l->monetaryThousandsSeparator(); // first, delete p's and t's: if ( !p.isEmpty() ) - for ( int idx = s.tqfind( p ) ; idx >= 0 ; idx = s.tqfind( p, idx ) ) + for ( int idx = s.find( p ) ; idx >= 0 ; idx = s.find( p, idx ) ) s.remove( idx, p.length() ); if ( !t.isEmpty() ) - for ( int idx = s.tqfind( t ) ; idx >= 0 ; idx = s.tqfind( t, idx ) ) + for ( int idx = s.find( t ) ; idx >= 0 ; idx = s.find( t, idx ) ) s.remove( idx, t.length() ); // then, replace the d's and n's - if ( ( !n.isEmpty() && n.tqfind('.') != -1 ) || - ( !d.isEmpty() && d.tqfind('-') != -1 ) ) { + if ( ( !n.isEmpty() && n.find('.') != -1 ) || + ( !d.isEmpty() && d.find('-') != -1 ) ) { // make sure we don't replace something twice: - kdWarning() << "KDoubleValidator: decimal symbol tqcontains '-' or " - "negative sign tqcontains '.' -> improve algorithm" << endl; + kdWarning() << "KDoubleValidator: decimal symbol contains '-' or " + "negative sign contains '.' -> improve algorithm" << endl; return Invalid; } if ( !d.isEmpty() && d != "." ) - for ( int idx = s.tqfind( d ) ; idx >= 0 ; idx = s.tqfind( d, idx + 1 ) ) - s.tqreplace( idx, d.length(), "."); + for ( int idx = s.find( d ) ; idx >= 0 ; idx = s.find( d, idx + 1 ) ) + s.replace( idx, d.length(), "."); if ( !n.isEmpty() && n != "-" ) - for ( int idx = s.tqfind( n ) ; idx >= 0 ; idx = s.tqfind( n, idx + 1 ) ) - s.tqreplace( idx, n.length(), "-" ); + for ( int idx = s.find( n ) ; idx >= 0 ; idx = s.find( n, idx + 1 ) ) + s.replace( idx, n.length(), "-" ); // Take care of monetary parens around the value if selected via // the locale settings. @@ -105,24 +105,24 @@ TQValidator::State kMyMoneyMoneyValidator::validate( TQString & input, int & _p if(l->negativeMonetarySignPosition() == KLocale::ParensAround || l->positiveMonetarySignPosition() == KLocale::ParensAround) { TQRegExp regExp("^(\\()?([\\d-\\.]*)(\\))?$"); - if(s.tqfind(regExp) != -1) { + if(s.find(regExp) != -1) { s = regExp.cap(2); } } // check for non numeric values (TQDoubleValidator allows an 'e', we don't) TQRegExp nonNumeric("[^\\d-\\.]+"); - if(s.tqfind(nonNumeric) != -1) + if(s.find(nonNumeric) != -1) return Invalid; // check for minus sign trailing the number TQRegExp trailingMinus("^([^-]*)\\w*-$"); - if(s.tqfind(trailingMinus) != -1) { + if(s.find(trailingMinus) != -1) { s = TQString("-%1").tqarg(trailingMinus.cap(1)); } // check for the maximum allowed number of decimal places - int decPos = s.tqfind('.'); + int decPos = s.find('.'); if(decPos != -1) { if(decimals() == 0) return Invalid; @@ -144,7 +144,7 @@ TQValidator::State kMyMoneyMoneyValidator::validate( TQString & input, int & _p // only, if the locale settings have it enabled. if(l->negativeMonetarySignPosition() == KLocale::ParensAround || l->positiveMonetarySignPosition() == KLocale::ParensAround) { - int tmp = input.tqcontains('(') - input.tqcontains(')'); + int tmp = input.contains('(') - input.contains(')'); if(tmp > 0) rc = Intermediate; else if(tmp < 0) @@ -369,19 +369,19 @@ void kMyMoneyEdit::ensureFractionalPart(TQString& s) const // followed by the required number of 0s if (!s.isEmpty()) { if(m_prec > 0) { - if (!s.tqcontains(decimalSymbol)) { + if (!s.contains(decimalSymbol)) { s += decimalSymbol; for (int i=0; i < m_prec; i++) s += "0"; } } else if(m_prec == 0) { - while(s.tqcontains(decimalSymbol)) { - int pos = s.tqfindRev(decimalSymbol); + while(s.contains(decimalSymbol)) { + int pos = s.findRev(decimalSymbol); if(pos != -1) { s.truncate(pos); } } - } else if(s.tqcontains(decimalSymbol)) { // m_prec == -1 && fraction + } else if(s.contains(decimalSymbol)) { // m_prec == -1 && fraction // no trailing zeroes while(s.endsWith("0")) { s.truncate(s.length()-1); |