diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kandy/src/atcommand.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kandy/src/atcommand.cpp')
-rw-r--r-- | kandy/src/atcommand.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/kandy/src/atcommand.cpp b/kandy/src/atcommand.cpp index 006fedf15..20e771cc1 100644 --- a/kandy/src/atcommand.cpp +++ b/kandy/src/atcommand.cpp @@ -32,7 +32,7 @@ ATParameter::ATParameter() mUserInput = false; } -ATParameter::ATParameter(const QString &value,const QString &name, +ATParameter::ATParameter(const TQString &value,const TQString &name, bool userInput) { mName = name; @@ -48,7 +48,7 @@ ATCommand::ATCommand() construct(); } -ATCommand::ATCommand(const QString &cmdString) +ATCommand::ATCommand(const TQString &cmdString) { setCmdName(i18n("New Command")); setCmdString(cmdString); @@ -59,7 +59,7 @@ ATCommand::ATCommand(const QString &cmdString) construct(); } -ATCommand::ATCommand(const QString &cmdName,const QString &cmdString, +ATCommand::ATCommand(const TQString &cmdName,const TQString &cmdString, bool hexOutput) { setCmdName(cmdName); @@ -82,18 +82,18 @@ ATCommand::~ATCommand() } -void ATCommand::setCmdName(const QString &cmdName) +void ATCommand::setCmdName(const TQString &cmdName) { mCmdName = cmdName; } -QString ATCommand::cmdName() +TQString ATCommand::cmdName() { return mCmdName; } -void ATCommand::setCmdString(const QString &cmdString) +void ATCommand::setCmdString(const TQString &cmdString) { mCmdString = cmdString; @@ -104,15 +104,15 @@ void ATCommand::setCmdString(const QString &cmdString) // kdDebug() << "ATCommand: Id: " << mId << endl; } -QString ATCommand::cmdString() +TQString ATCommand::cmdString() { return mCmdString; } -QString ATCommand::cmd() +TQString ATCommand::cmd() { if (mParameters.count() > 0) { - QString cmd = cmdString().left(cmdString().find("=") + 1); + TQString cmd = cmdString().left(cmdString().find("=") + 1); // kdDebug() << "--1-cmd: " << cmd << endl; for(uint i=0;i<mParameters.count();++i) { cmd += mParameters.at(i)->value(); @@ -125,7 +125,7 @@ QString ATCommand::cmd() } } -QString ATCommand::id() +TQString ATCommand::id() { return mId; } @@ -140,24 +140,24 @@ bool ATCommand::hexOutput() return mHexOutput; } -void ATCommand::setResultString(const QString &resultString) +void ATCommand::setResultString(const TQString &resultString) { mResultString = resultString; mResultFieldsList.clear(); - QStringList resultFields = QStringList::split("\n",mResultString); + TQStringList resultFields = TQStringList::split("\n",mResultString); - for(QStringList::Iterator it = resultFields.begin(); + for(TQStringList::Iterator it = resultFields.begin(); it != resultFields.end(); ++it) { setResultFields(*it); } } -void ATCommand::setResultFields( QString fieldsString ) +void ATCommand::setResultFields( TQString fieldsString ) { - QString id = mId.upper().left( mId.find( '=' ) ); + TQString id = mId.upper().left( mId.find( '=' ) ); // Truncate the command name prepended to the output by the modem. @@ -168,9 +168,9 @@ void ATCommand::setResultFields( QString fieldsString ) if ( ( fieldsString[ 0 ] == '(' ) && ( fieldsString[ fieldsString.length() - 1 ] == ')' ) ) fieldsString = fieldsString.mid( 1, fieldsString.length() - 2 ); - QStringList *fields = new QStringList; - QStringList TmpFields = QStringList::split( ',', fieldsString ); - QString TmpString = ""; + TQStringList *fields = new QStringList; + TQStringList TmpFields = TQStringList::split( ',', fieldsString ); + TQString TmpString = ""; // Assume a phonebook entry of the mobile phone has the format @@ -181,7 +181,7 @@ void ATCommand::setResultFields( QString fieldsString ) // Hence, the fieldsString needs to be parsed a little bit. Names stored on // the mobile phone are quoted. Commas within a quoted are of the fieldsString // must not be divided into differend fields. - for ( QStringList::Iterator it = TmpFields.begin(); it != TmpFields.end(); it++ ) + for ( TQStringList::Iterator it = TmpFields.begin(); it != TmpFields.end(); it++ ) { // Start of a quoted area if ( ( (*it)[ 0 ] == '\"' ) && ( (*it)[ (*it).length() - 1 ] != '\"' ) ) @@ -206,18 +206,18 @@ void ATCommand::setResultFields( QString fieldsString ) } -QString ATCommand::resultString() +TQString ATCommand::resultString() { return mResultString; } -QString ATCommand::resultField(int index) +TQString ATCommand::resultField(int index) { if (mResultFieldsList.count() == 0) return ""; - QStringList *resultFields = mResultFieldsList.at(0); + TQStringList *resultFields = mResultFieldsList.at(0); - QStringList::Iterator it = resultFields->at(index); + TQStringList::Iterator it = resultFields->at(index); if (it == resultFields->end()) { kdDebug() << "ATCommand::resultField: index " << index << " out of range." << endl; @@ -228,7 +228,7 @@ QString ATCommand::resultField(int index) } -QPtrList<QStringList> *ATCommand::resultFields() +TQPtrList<TQStringList> *ATCommand::resultFields() { return &mResultFieldsList; } @@ -243,12 +243,12 @@ void ATCommand::clearParameters() mParameters.clear(); } -QPtrList<ATParameter> ATCommand::parameters() +TQPtrList<ATParameter> ATCommand::parameters() { return mParameters; } -void ATCommand::setParameter(int index,const QString &value) +void ATCommand::setParameter(int index,const TQString &value) { if (mParameters.count() <= (unsigned int)index) { kdDebug() << "ATCommand " << cmdName() << " has no Parameter " << index @@ -261,19 +261,19 @@ void ATCommand::setParameter(int index,const QString &value) void ATCommand::setParameter(int index,int value) { - setParameter(index,QString::number(value)); + setParameter(index,TQString::number(value)); } -QString ATCommand::processOutput(const QString &output) +TQString ATCommand::processOutput(const TQString &output) { if (hexOutput()) { - QString hexString = output.mid(output.find('\n')+1); + TQString hexString = output.mid(output.find('\n')+1); int i=0; - QString aChar = hexString.mid(i,2); - QString result; + TQString aChar = hexString.mid(i,2); + TQString result; while(!aChar.isEmpty()) { int charValue = aChar.toInt(0,16); - QChar charEncoded(charValue); + TQChar charEncoded(charValue); // result += aChar + ": " + charEncoded + "\n"; result += charEncoded; i += 2; @@ -286,7 +286,7 @@ QString ATCommand::processOutput(const QString &output) } } -QString ATCommand::processOutput() +TQString ATCommand::processOutput() { return processOutput(mResultString); } @@ -298,15 +298,15 @@ void ATCommand::extractParameters() int pos = cmdString().find("="); if (pos < 0) return; - QString paraString = cmdString().mid(pos+1); + TQString paraString = cmdString().mid(pos+1); // kdDebug() << "Para String: " << paraString << endl; - QStringList paraList = QStringList::split(",",paraString); + TQStringList paraList = TQStringList::split(",",paraString); - QStringList::ConstIterator it = paraList.begin(); - QStringList::ConstIterator end = paraList.end(); + TQStringList::ConstIterator it = paraList.begin(); + TQStringList::ConstIterator end = paraList.end(); int argNum = 1; while(it != end) { - addParameter(new ATParameter(*it,i18n("Arg %1").arg(QString::number(argNum++)), + addParameter(new ATParameter(*it,i18n("Arg %1").arg(TQString::number(argNum++)), false)); ++it; } |