diff options
Diffstat (limited to 'kommander/widget/functionlib.cpp')
-rw-r--r-- | kommander/widget/functionlib.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/kommander/widget/functionlib.cpp b/kommander/widget/functionlib.cpp index 416207b7..81613785 100644 --- a/kommander/widget/functionlib.cpp +++ b/kommander/widget/functionlib.cpp @@ -52,7 +52,7 @@ static ParseNode f_stringLength(Parser*, const ParameterList& params) static ParseNode f_stringContains(Parser*, const ParameterList& params) { - return params[0].toString().contains(params[1].toString()); + return params[0].toString().tqcontains(params[1].toString()); } static ParseNode f_stringCompare(Parser*, const ParameterList& params) @@ -71,12 +71,12 @@ static ParseNode f_stringCompare(Parser*, const ParameterList& params) static ParseNode f_stringFind(Parser*, const ParameterList& params) { - return params[0].toString().find(params[1].toString(), params.count() == 3 ? params[2].toInt() : 0); + return params[0].toString().tqfind(params[1].toString(), params.count() == 3 ? params[2].toInt() : 0); } static ParseNode f_stringFindRev(Parser*, const ParameterList& params) { - return params[0].toString().findRev(params[1].toString(), + return params[0].toString().tqfindRev(params[1].toString(), params.count() == 3 ? params[2].toInt() : params[0].toString().length()); } @@ -102,7 +102,7 @@ static ParseNode f_stringRemove(Parser*, const ParameterList& params) static ParseNode f_stringReplace(Parser*, const ParameterList& params) { - return params[0].toString().replace(params[1].toString(), params[2].toString()); + return params[0].toString().tqreplace(params[1].toString(), params[2].toString()); } static ParseNode f_stringLower(Parser*, const ParameterList& params) @@ -129,11 +129,11 @@ static ParseNode f_stringSection(Parser*, const ParameterList& params) static ParseNode f_stringArgs(Parser*, const ParameterList& params) { if (params.count() == 2) - return params[0].toString().arg(params[1].toString()); + return params[0].toString().tqarg(params[1].toString()); else if (params.count() == 3) - return params[0].toString().arg(params[1].toString()).arg(params[2].toString()); + return params[0].toString().tqarg(params[1].toString()).tqarg(params[2].toString()); else - return params[0].toString().arg(params[1].toString()).arg(params[2].toString()).arg(params[3].toString()); + return params[0].toString().tqarg(params[1].toString()).tqarg(params[2].toString()).tqarg(params[3].toString()); } static ParseNode f_stringIsNumber(Parser*, const ParameterList& params) @@ -250,7 +250,7 @@ static ParseNode f_executeSlot(Parser* parser, const ParameterList& params) TQObject *object = widget->object(); if (!object) return ParseNode::error("unknown widget"); - TQStrList slotSignatures = object->metaObject()->slotNames(true); + TQStrList slotSignatures = object->tqmetaObject()->slotNames(true); TQStringList slotNames = TQStringList::fromStrList(slotSignatures); int slotNum = -1; uint i = 0; @@ -353,15 +353,15 @@ static ParseNode f_dcop(Parser*, const ParameterList& params) byteDataStream << params[i++].toDouble(); else if (*it == "bool") byteDataStream << (bool)params[i++].toInt(); - else if (*it == "TQStringList") - if (params[i].toString().find('\n') != -1) + else if (*it == TQSTRINGLIST_OBJECT_NAME_STRING) + if (params[i].toString().tqfind('\n') != -1) byteDataStream << TQStringList::split("\n", params[i++].toString(), true); else byteDataStream << TQStringList::split("\\n", params[i++].toString(), true); else byteDataStream << params[i++].toString(); } - function.append(TQString("(%1)").arg(items.join(","))); + function.append(TQString("(%1)").tqarg(items.join(","))); TQCString replyType, byteReply; DCOPClient* cl = KApplication::dcopClient(); if (!cl || !cl->call(appId, object, function.latin1(), @@ -371,7 +371,7 @@ static ParseNode f_dcop(Parser*, const ParameterList& params) return ParseNode(); } TQDataStream byteReplyStream(byteReply, IO_ReadOnly); - if (replyType == "TQString") + if (replyType == TQSTRING_OBJECT_NAME_STRING) { TQString text; byteReplyStream >> text; @@ -389,7 +389,7 @@ static ParseNode f_dcop(Parser*, const ParameterList& params) byteReplyStream >> b; return b; } - else if (replyType == "TQStringList") + else if (replyType == TQSTRINGLIST_OBJECT_NAME_STRING) { TQStringList text; byteReplyStream >> text; @@ -397,7 +397,7 @@ static ParseNode f_dcop(Parser*, const ParameterList& params) } else if(replyType != "void") { - qDebug("%s", TQString("DCOP return type %1 is not yet implemented.").arg(replyType.data()).latin1()); + qDebug("%s", TQString("DCOP return type %1 is not yet implemented.").tqarg(replyType.data()).latin1()); } return ParseNode(); @@ -407,12 +407,12 @@ static ParseNode f_createWidget(Parser* p, const ParameterList& params) { TQString widgetName = params[0].toString(); TQString widgetType = params[1].toString(); - TQString parentName = params[2].toString(); - KommanderWidget *widget = p->currentWidget()->widgetByName(parentName); + TQString tqparentName = params[2].toString(); + KommanderWidget *widget = p->currentWidget()->widgetByName(tqparentName); if (!widget) return ParseNode::error("unknown widget"); - TQWidget *parent = dynamic_cast<TQWidget*>(widget->object()); - TQWidget *w = KommanderFactory::createWidget(widgetType, parent, widgetName.latin1()); + TQWidget *tqparent = dynamic_cast<TQWidget*>(widget->object()); + TQWidget *w = KommanderFactory::createWidget(widgetType, tqparent, widgetName.latin1()); if (w) w->adjustSize(); return ParseNode(); @@ -429,9 +429,9 @@ static ParseNode f_widgetExists(Parser* p, const ParameterList& params) static ParseNode f_connect(Parser* p, const ParameterList& params) { TQString sender = params[0].toString(); - TQString signal = TQString::number(QSIGNAL_CODE) + params[1].toString(); + TQString signal = TQString::number(TQSIGNAL_CODE) + params[1].toString(); TQString receiver = params[2].toString(); - TQString slot = TQString::number(QSLOT_CODE) + params[3].toString(); + TQString slot = TQString::number(TQSLOT_CODE) + params[3].toString(); KommanderWidget *senderW = p->currentWidget()->widgetByName(sender); if (!senderW) return ParseNode::error("unknown widget"); @@ -445,9 +445,9 @@ static ParseNode f_connect(Parser* p, const ParameterList& params) static ParseNode f_disconnect(Parser* p, const ParameterList& params) { TQString sender = params[0].toString(); - TQString signal = TQString::number(QSIGNAL_CODE) + params[1].toString(); + TQString signal = TQString::number(TQSIGNAL_CODE) + params[1].toString(); TQString receiver = params[2].toString(); - TQString slot = TQString::number(QSLOT_CODE) + params[3].toString(); + TQString slot = TQString::number(TQSLOT_CODE) + params[3].toString(); KommanderWidget *senderW = p->currentWidget()->widgetByName(sender); if (!senderW) return ParseNode::error("unknown widget"); @@ -499,7 +499,7 @@ static ParseNode f_dialog(Parser* P, const ParameterList& params) return TQString(); } TQString cmd = TQString("kmdr-executor %1 %2 _PARENTPID=%3 _PARENTDCOPID=kmdr-executor-%4") - .arg(pFileName).arg(a_params).arg(getpid()).arg(getpid()); + .tqarg(pFileName).tqarg(a_params).tqarg(getpid()).tqarg(getpid()); MyProcess proc(P->currentWidget()); TQString text; @@ -571,7 +571,7 @@ static ParseNode f_arrayToString(Parser* P, const ParameterList& params) TQValueList<ParseNode>::Iterator itval = values.begin(); while (*it) { - array += TQString("%1\t%2\n").arg(*it).arg((*itval).toString()); + array += TQString("%1\t%2\n").tqarg(*it).tqarg((*itval).toString()); ++it; ++itval; } @@ -648,7 +648,7 @@ static ParseNode f_arrayIndexedRemoveElements(Parser* P, const ParameterList& pa return ParseNode(); //out of index range for (int i = 0; i < count; i++) { - if (keys.contains(TQString::number(i)) != 1) + if (keys.tqcontains(TQString::number(i)) != 1) return ParseNode(); //array is not indexed } for (int i = key; i <= key + num; i++) @@ -704,7 +704,7 @@ static ParseNode f_inputColor(Parser*, const ParameterList& params) if (params.count()) color.setNamedColor(params[0].toString()); KColorDialog::getColor(color); - return color.name(); + return TQString(color.name()); } static ParseNode f_inputText(Parser*, const ParameterList& params) @@ -721,7 +721,7 @@ static ParseNode f_inputPassword(Parser*, const ParameterList& params) if (params.count() > 1) value = params[1].toString().local8Bit(); KPasswordDialog::getPassword(value, params[0].toString()); - return TQString::fromLocal8Bit(value); + return TQString(TQString::fromLocal8Bit(value)); } static ParseNode f_inputValue(Parser*, const ParameterList& params) @@ -910,15 +910,15 @@ static ParseNode f_write_setting(Parser* parser, const ParameterList& params) void ParserData::registerStandardFunctions() { registerFunction("str_length", Function(&f_stringLength, ValueInt, ValueString)); - registerFunction("str_contains", Function(&f_stringContains, ValueInt, ValueString, ValueString)); + registerFunction("str_tqcontains", Function(&f_stringContains, ValueInt, ValueString, ValueString)); registerFunction("str_compare", Function(&f_stringCompare, ValueInt, ValueString, ValueString)); - registerFunction("str_find", Function(&f_stringFind, ValueInt, ValueString, ValueString, ValueInt, 2)); + registerFunction("str_tqfind", Function(&f_stringFind, ValueInt, ValueString, ValueString, ValueInt, 2)); registerFunction("str_findrev", Function(&f_stringFindRev, ValueInt, ValueString, ValueString, ValueInt, 2)); registerFunction("str_left", Function(&f_stringLeft, ValueString, ValueString, ValueInt)); registerFunction("str_right", Function(&f_stringRight, ValueString, ValueString, ValueInt)); registerFunction("str_mid", Function(&f_stringMid, ValueString, ValueString, ValueInt, ValueInt, 2)); registerFunction("str_remove", Function(&f_stringRemove, ValueString, ValueString, ValueString)); - registerFunction("str_replace", Function(&f_stringReplace, ValueString, ValueString, ValueString, ValueString)); + registerFunction("str_tqreplace", Function(&f_stringReplace, ValueString, ValueString, ValueString, ValueString)); registerFunction("str_lower", Function(&f_stringLower, ValueString, ValueString)); registerFunction("str_upper", Function(&f_stringUpper, ValueString, ValueString)); registerFunction("str_section", Function(&f_stringSection, ValueString, ValueString, ValueString, ValueInt, ValueInt, 3)); @@ -944,7 +944,7 @@ void ParserData::registerStandardFunctions() registerFunction("dcop", Function(&f_dcop, ValueString, ValueString, ValueString, 3, 100)); registerFunction("dcopid", Function(&f_dcopid, ValueString, ValueNone, 0, 0)); registerFunction("pid", Function(&f_pid, ValueString, ValueNone, 0, 0)); - registerFunction("parentPid", Function(&f_parentPid, ValueString, ValueNone, 0, 0)); + registerFunction("tqparentPid", Function(&f_parentPid, ValueString, ValueNone, 0, 0)); registerFunction("dialog", Function(&f_dialog, ValueString, ValueString, ValueString, 1, 2)); registerFunction("exec", Function(&f_exec, ValueString, ValueString, ValueString, 1, 2)); registerFunction("execBackground", Function(&f_execBackground, ValueString, ValueString, ValueString, 1, 2)); |