diff options
Diffstat (limited to 'kexi/kexiutils/identifier.cpp')
-rw-r--r-- | kexi/kexiutils/identifier.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/kexi/kexiutils/identifier.cpp b/kexi/kexiutils/identifier.cpp index 12c5b4da..e09df22a 100644 --- a/kexi/kexiutils/identifier.cpp +++ b/kexi/kexiutils/identifier.cpp @@ -23,48 +23,48 @@ using namespace KexiUtils; -bool KexiUtils::isIdentifier(const QString& s) +bool KexiUtils::isIdentifier(const TQString& s) { uint i; for (i=0; i<s.length(); i++) { - QChar c = s.at(i).lower(); - if (!(c=='_' || c>='a' && c<='z' || i>0 && c>='0' && c<='9')) + TQChar c = s.tqat(i).lower(); + if (!((int)c=='_' || (int)c>='a' && (int)c<='z' || i>0 && (int)c>='0' && (int)c<='9')) break; } return i>0 && i==s.length(); } -QString KexiUtils::string2FileName(const QString &s) +TQString KexiUtils::string2FileName(const TQString &s) { - QString fn( s.simplifyWhiteSpace() ); - fn.replace(' ',"_"); fn.replace('$',"_"); - fn.replace('\\',"-"); fn.replace('/',"-"); - fn.replace(':',"-"); fn.replace('*',"-"); + TQString fn( s.simplifyWhiteSpace() ); + fn.tqreplace(' ',"_"); fn.tqreplace('$',"_"); + fn.tqreplace('\\',"-"); fn.tqreplace('/',"-"); + fn.tqreplace(':',"-"); fn.tqreplace('*',"-"); return fn; } -inline QString char2Identifier(const QChar& c) +inline TQString char2Identifier(const TQChar& c) { - if (c.unicode() >= TRANSLITERATION_TABLE_SIZE) - return QString(QChar('_')); - const char *const s = transliteration_table[c.unicode()]; - return s ? QString::fromLatin1(s) : QString(QChar('_')); + if (c.tqunicode() >= TRANSLITERATION_TABLE_SIZE) + return TQString(TQChar('_')); + const char *const s = transliteration_table[c.tqunicode()]; + return s ? TQString::tqfromLatin1(s) : TQString(TQChar('_')); } -QString KexiUtils::string2Identifier(const QString &s) +TQString KexiUtils::string2Identifier(const TQString &s) { if (s.isEmpty()) - return QString::null; - QString r, id = s.simplifyWhiteSpace(); + return TQString(); + TQString r, id = s.simplifyWhiteSpace(); if (id.isEmpty()) - return QString::null; + return TQString(); r.reserve(id.length()); - id.replace(' ',"_"); - QChar c = id[0]; - QString add; + id.tqreplace(' ',"_"); + TQChar c = id[0]; + TQString add; bool wasUnderscore = false; - if (c>='0' && c<='9') { + if ((int)c>='0' && (int)c<='9') { r+='_'; r+=c; } else { @@ -85,16 +85,16 @@ QString KexiUtils::string2Identifier(const QString &s) //-------------------------------------------------------------------------------- -QString KexiUtils::identifierExpectedMessage(const QString &valueName, const QVariant& v) +TQString KexiUtils::identifierExpectedMessage(const TQString &valueName, const TQVariant& v) { - return "<p>"+i18n("Value of \"%1\" column must be an identifier.").arg(valueName) - +"</p><p>"+i18n("\"%1\" is not a valid identifier.").arg(v.toString())+"</p>"; + return "<p>"+i18n("Value of \"%1\" column must be an identifier.").tqarg(valueName) + +"</p><p>"+i18n("\"%1\" is not a valid identifier.").tqarg(v.toString())+"</p>"; } //-------------------------------------------------------------------------------- -IdentifierValidator::IdentifierValidator(QObject * parent, const char * name) -: Validator(parent,name) +IdentifierValidator::IdentifierValidator(TQObject * tqparent, const char * name) +: Validator(tqparent,name) { } @@ -102,7 +102,7 @@ IdentifierValidator::~IdentifierValidator() { } -QValidator::State IdentifierValidator::validate( QString& input, int& pos ) const +TQValidator::State IdentifierValidator::validate( TQString& input, int& pos ) const { uint i; for (i=0; i<input.length() && input.at(i)==' '; i++) @@ -120,8 +120,8 @@ QValidator::State IdentifierValidator::validate( QString& input, int& pos ) cons } Validator::Result IdentifierValidator::internalCheck( - const QString &valueName, const QVariant& v, - QString &message, QString & /*details*/) + const TQString &valueName, const TQVariant& v, + TQString &message, TQString & /*details*/) { if (isIdentifier(v.toString())) return Validator::Ok; |