summaryrefslogtreecommitdiffstats
path: root/kdeui/knumvalidator.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-07 03:45:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-07 03:45:53 +0000
commit10308be19ef7fa44699562cc75946e7ea1fdf6b9 (patch)
tree4bc444c00a79e88105f2cfce5b6209994c413ca0 /kdeui/knumvalidator.cpp
parent307136d8eef0ba133b78ceee8e901138d4c996a1 (diff)
downloadtdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.tar.gz
tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.zip
Revert automated changes
Sorry guys, they are just not ready for prime time Work will continue as always git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1212479 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/knumvalidator.cpp')
-rw-r--r--kdeui/knumvalidator.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/kdeui/knumvalidator.cpp b/kdeui/knumvalidator.cpp
index e60730eed..436f95431 100644
--- a/kdeui/knumvalidator.cpp
+++ b/kdeui/knumvalidator.cpp
@@ -67,7 +67,7 @@ TQValidator::State KIntValidator::validate ( TQString &str, int & ) const
if (_base > 10)
newStr = newStr.upper();
- if (newStr == TQString::tqfromLatin1("-")) // a special case
+ if (newStr == TQString::fromLatin1("-")) // a special case
if ((_min || _max) && _min >= 0)
ok = false;
else
@@ -209,12 +209,12 @@ TQValidator::State KFloatValidator::validate ( TQString &str, int & ) const
TQString newStr;
newStr = str.stripWhiteSpace();
- if (newStr == TQString::tqfromLatin1("-")) // a special case
+ if (newStr == TQString::fromLatin1("-")) // a special case
if ((_min || _max) && _min >= 0)
ok = false;
else
return TQValidator::Acceptable;
- else if (newStr == TQString::tqfromLatin1(".") || (d->acceptLocalizedNumbers && newStr==KGlobal::locale()->decimalSymbol())) // another special case
+ else if (newStr == TQString::fromLatin1(".") || (d->acceptLocalizedNumbers && newStr==KGlobal::locale()->decimalSymbol())) // another special case
return TQValidator::Acceptable;
else if (newStr.length())
{
@@ -339,30 +339,30 @@ TQValidator::State KDoubleValidator::validate( TQString & input, int & p ) const
t = l->thousandsSeparator();
// 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, tqreplace the d's and n's
- if ( ( !n.isEmpty() && n.tqfind('.') != -1 ) ||
- ( !d.isEmpty() && d.tqfind('-') != -1 ) ) {
- // make sure we don't tqreplace something twice:
- kdWarning() << "KDoubleValidator: decimal symbol tqcontains '-' or "
- "negative sign tqcontains '.' -> improve algorithm" << endl;
+ // then, replace the d's and n's
+ if ( ( !n.isEmpty() && n.find('.') != -1 ) ||
+ ( !d.isEmpty() && d.find('-') != -1 ) ) {
+ // make sure we don't replace something twice:
+ 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(), '-' );
}
return base::validate( s, p );