From ffe8a83e053396df448e9413828527613ca3bd46 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:46:43 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kate/part/katecmds.cpp | 80 +++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'kate/part/katecmds.cpp') diff --git a/kate/part/katecmds.cpp b/kate/part/katecmds.cpp index 17846dd7d..b64b5414e 100644 --- a/kate/part/katecmds.cpp +++ b/kate/part/katecmds.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include //BEGIN CoreCommands @@ -50,7 +50,7 @@ static void setDocFlag( KateDocumentConfig::ConfigFlags flag, bool enable, // this returns wheather the string s could be converted to // a bool value, one of on|off|1|0|true|false. the argument val is // set to the extracted value in case of success -static bool getBoolArg( QString s, bool *val ) +static bool getBoolArg( TQString s, bool *val ) { bool res( false ); s = s.lower(); @@ -69,9 +69,9 @@ static bool getBoolArg( QString s, bool *val ) return false; } -QStringList KateCommands::CoreCommands::cmds() +TQStringList KateCommands::CoreCommands::cmds() { - QStringList l; + TQStringList l; l << "indent" << "unindent" << "cleanindent" << "comment" << "uncomment" << "goto" << "kill-line" << "set-tab-width" << "set-replace-tabs" << "set-show-tabs" @@ -87,8 +87,8 @@ QStringList KateCommands::CoreCommands::cmds() } bool KateCommands::CoreCommands::exec(Kate::View *view, - const QString &_cmd, - QString &errorMsg) + const TQString &_cmd, + TQString &errorMsg) { #define KCC_ERR(s) { errorMsg=s; return false; } // cast it hardcore, we know that it is really a kateview :) @@ -98,8 +98,8 @@ bool KateCommands::CoreCommands::exec(Kate::View *view, KCC_ERR( i18n("Could not access view") ); //create a list of args - QStringList args( QStringList::split( QRegExp("\\s+"), _cmd ) ); - QString cmd ( args.first() ); + TQStringList args( TQStringList::split( TQRegExp("\\s+"), _cmd ) ); + TQString cmd ( args.first() ); args.remove( args.first() ); // ALL commands that takes no arguments. @@ -157,7 +157,7 @@ bool KateCommands::CoreCommands::exec(Kate::View *view, } else if ( cmd == "set-highlight" ) { - QString val = _cmd.section( ' ', 1 ).lower(); + TQString val = _cmd.section( ' ', 1 ).lower(); for ( uint i=0; i < v->doc()->hlModeCount(); i++ ) { if ( v->doc()->hlModeName( i ).lower() == val ) @@ -279,12 +279,12 @@ bool KateCommands::CoreCommands::exec(Kate::View *view, KCC_ERR( i18n("Unknown command '%1'").arg(cmd) ); } -KCompletion *KateCommands::CoreCommands::completionObject( const QString &cmd, Kate::View *view ) +KCompletion *KateCommands::CoreCommands::completionObject( const TQString &cmd, Kate::View *view ) { if ( cmd == "set-highlight" ) { KateView *v = (KateView*)view; - QStringList l; + TQStringList l; for ( uint i = 0; i < v->doc()->hlModeCount(); i++ ) l << v->doc()->hlModeName( i ); @@ -298,7 +298,7 @@ KCompletion *KateCommands::CoreCommands::completionObject( const QString &cmd, K //END CoreCommands //BEGIN SedReplace -static void replace(QString &s, const QString &needle, const QString &with) +static void replace(TQString &s, const TQString &needle, const TQString &with) { int pos=0; while (1) @@ -311,7 +311,7 @@ static void replace(QString &s, const QString &needle, const QString &with) } -static int backslashString(const QString &haystack, const QString &needle, int index) +static int backslashString(const TQString &haystack, const TQString &needle, int index) { int len=haystack.length(); int searchlen=needle.length(); @@ -339,7 +339,7 @@ static int backslashString(const QString &haystack, const QString &needle, int i } // exchange "\t" for the actual tab character, for example -static void exchangeAbbrevs(QString &str) +static void exchangeAbbrevs(TQString &str) { // the format is (findreplace)*[nullzero] const char *magic="a\x07t\tn\n"; @@ -348,9 +348,9 @@ static void exchangeAbbrevs(QString &str) { int index=0; char replace=magic[1]; - while ((index=backslashString(str, QChar(*magic), index))!=-1) + while ((index=backslashString(str, TQChar(*magic), index))!=-1) { - str.replace(index, 2, QChar(replace)); + str.replace(index, 2, TQChar(replace)); index++; } magic++; @@ -359,7 +359,7 @@ static void exchangeAbbrevs(QString &str) } int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, - const QString &find, const QString &repOld, const QString &delim, + const TQString &find, const TQString &repOld, const TQString &delim, bool noCase, bool repeat, uint startcol, int endcol ) { @@ -376,7 +376,7 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, // * handle capatures by putting them in one list. // * the existing insertion is fine, including the line calculation. - QStringList patterns = QStringList::split( QRegExp("(^\\\\n|(?![^\\\\])\\\\n)"), find, true ); + TQStringList patterns = TQStringList::split( TQRegExp("(^\\\\n|(?![^\\\\])\\\\n)"), find, true ); if ( patterns.count() > 1 ) { @@ -391,7 +391,7 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, } } - QRegExp matcher(patterns[0], noCase); + TQRegExp matcher(patterns[0], noCase); uint len; int matches = 0; @@ -405,19 +405,19 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, matches++; - QString rep=repOld; + TQString rep=repOld; // now set the backreferences in the replacement - QStringList backrefs=matcher.capturedTexts(); + TQStringList backrefs=matcher.capturedTexts(); int refnum=1; - QStringList::Iterator i = backrefs.begin(); + TQStringList::Iterator i = backrefs.begin(); ++i; for (; i!=backrefs.end(); ++i) { // I need to match "\\" or "", but not "\" - QString number=QString::number(refnum); + TQString number=TQString::number(refnum); int index=0; while (index!=-1) @@ -468,11 +468,11 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, return matches; } -bool KateCommands::SedReplace::exec (Kate::View *view, const QString &cmd, QString &msg) +bool KateCommands::SedReplace::exec (Kate::View *view, const TQString &cmd, TQString &msg) { kdDebug(13025)<<"SedReplace::execCmd( "<insertText(QString(buf)); + view->insertText(TQString(buf)); } else { // do the unicode thing - QChar c(number); - view->insertText(QString(&c, 1)); + TQChar c(number); + view->insertText(TQString(&c, 1)); } return true; @@ -588,15 +588,15 @@ bool KateCommands::Character::exec (Kate::View *view, const QString &_cmd, QStri //END Character //BEGIN Date -bool KateCommands::Date::exec (Kate::View *view, const QString &cmd, QString &) +bool KateCommands::Date::exec (Kate::View *view, const TQString &cmd, TQString &) { if (cmd.left(4) != "date") return false; - if (QDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5)).length() > 0) - view->insertText(QDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5))); + if (TQDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5)).length() > 0) + view->insertText(TQDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5))); else - view->insertText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); + view->insertText(TQDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); return true; } -- cgit v1.2.1