summaryrefslogtreecommitdiffstats
path: root/kommander/widget
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /kommander/widget
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/widget')
-rw-r--r--kommander/widget/expression.cpp2
-rw-r--r--kommander/widget/functionlib.cpp62
-rw-r--r--kommander/widget/invokeclass.cpp10
-rw-r--r--kommander/widget/invokeclass.h3
-rw-r--r--kommander/widget/kmdrmainwindow.cpp4
-rw-r--r--kommander/widget/kmdrmainwindow.h3
-rw-r--r--kommander/widget/kommanderfunctions.cpp34
-rw-r--r--kommander/widget/kommanderwidget.cpp90
-rw-r--r--kommander/widget/kommanderwidget.h12
-rw-r--r--kommander/widget/myprocess.cpp10
-rw-r--r--kommander/widget/myprocess.h3
-rw-r--r--kommander/widget/parsenode.cpp4
-rw-r--r--kommander/widget/parser.cpp44
-rw-r--r--kommander/widget/parser.h4
-rw-r--r--kommander/widget/parserdata.cpp6
15 files changed, 147 insertions, 144 deletions
diff --git a/kommander/widget/expression.cpp b/kommander/widget/expression.cpp
index d29d94e8..350646e1 100644
--- a/kommander/widget/expression.cpp
+++ b/kommander/widget/expression.cpp
@@ -57,7 +57,7 @@ Expression& Expression::operator=(const TQString& s)
m_parts.append(TQVariant(s.mid(start, i - start).toDouble()));
else
m_parts.append(TQVariant(s.mid(start, i - start).toInt()));
- } else if (single.contains(s[i]))
+ } else if (single.tqcontains(s[i]))
m_parts.append(TQVariant(TQString(s[i++])));
else if (s[i] == '\"')
{
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));
diff --git a/kommander/widget/invokeclass.cpp b/kommander/widget/invokeclass.cpp
index 866f629b..ec08dfff 100644
--- a/kommander/widget/invokeclass.cpp
+++ b/kommander/widget/invokeclass.cpp
@@ -15,7 +15,7 @@
#include <tqcolor.h>
#include <tqregexp.h>
-InvokeClass::InvokeClass(TQObject *parent):TQObject(parent)
+InvokeClass::InvokeClass(TQObject *tqparent):TQObject(tqparent)
{
m_acceptedSlots = acceptedSlots();
}
@@ -23,9 +23,9 @@ InvokeClass::InvokeClass(TQObject *parent):TQObject(parent)
void InvokeClass::invokeSlot(TQObject *object, const TQString& slot, TQStringList args)
{
TQString invokeName = slot;
- invokeName = invokeName.mid(invokeName.find('('));
- invokeName.prepend(TQString::number(QSIGNAL_CODE) + "invoke");
- TQString slotName = TQString::number(QSLOT_CODE) + slot;
+ invokeName = invokeName.mid(invokeName.tqfind('('));
+ invokeName.prepend(TQString::number(TQSIGNAL_CODE) + "invoke");
+ TQString slotName = TQString::number(TQSLOT_CODE) + slot;
connect(this, invokeName.ascii(), object, slotName.ascii());
if (args.count() == 0)
@@ -33,7 +33,7 @@ void InvokeClass::invokeSlot(TQObject *object, const TQString& slot, TQStringLis
else
{
TQString slotArgStr = slot.section(TQRegExp("\\(|\\)"), 1);
- uint argNum = slotArgStr.contains(',') + 1;
+ uint argNum = slotArgStr.tqcontains(',') + 1;
for (uint i = args.count(); i < argNum; i++)
args << "";
//poor man's invokeMetaObject
diff --git a/kommander/widget/invokeclass.h b/kommander/widget/invokeclass.h
index 4b1a8c0b..043ba73b 100644
--- a/kommander/widget/invokeclass.h
+++ b/kommander/widget/invokeclass.h
@@ -18,8 +18,9 @@
class InvokeClass : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- InvokeClass(TQObject *parent);
+ InvokeClass(TQObject *tqparent);
void invokeSlot(TQObject *object, const TQString& slot, TQStringList args);
static TQStringList acceptedSlots()
diff --git a/kommander/widget/kmdrmainwindow.cpp b/kommander/widget/kmdrmainwindow.cpp
index e123a035..603c1326 100644
--- a/kommander/widget/kmdrmainwindow.cpp
+++ b/kommander/widget/kmdrmainwindow.cpp
@@ -13,8 +13,8 @@
#include <tqtimer.h>
-KmdrMainWindow::KmdrMainWindow(TQWidget *parent, const char *name, WFlags f)
- : KMainWindow(parent, name, f)
+KmdrMainWindow::KmdrMainWindow(TQWidget *tqparent, const char *name, WFlags f)
+ : KMainWindow(tqparent, name, f)
{
TQTimer::singleShot(10, this, TQT_SIGNAL(initialize()));
}
diff --git a/kommander/widget/kmdrmainwindow.h b/kommander/widget/kmdrmainwindow.h
index 6637ffc8..4896db2b 100644
--- a/kommander/widget/kmdrmainwindow.h
+++ b/kommander/widget/kmdrmainwindow.h
@@ -20,8 +20,9 @@
class KmdrMainWindow : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
- KmdrMainWindow(TQWidget *parent = 0, const char *name = 0, WFlags f = WType_TopLevel | WDestructiveClose);
+ KmdrMainWindow(TQWidget *tqparent = 0, const char *name = 0, WFlags f = WType_TopLevel | WDestructiveClose);
~KmdrMainWindow();
diff --git a/kommander/widget/kommanderfunctions.cpp b/kommander/widget/kommanderfunctions.cpp
index 6ef6e6f0..7efe5b27 100644
--- a/kommander/widget/kommanderfunctions.cpp
+++ b/kommander/widget/kommanderfunctions.cpp
@@ -52,7 +52,7 @@ TQString KommanderWidget::evalFunction(const TQString& function, const TQStringL
return execCommand(args[0]);
case Kommander::dcop:
return DCOPQuery(args);
- case Kommander::parentPid:
+ case Kommander::tqparentPid:
return global("_PARENTPID").isEmpty() ? TQString().setNum(getppid()) : global("_PARENTPID");
case Kommander::env:
return TQString(getenv(args[0].latin1()));
@@ -66,12 +66,12 @@ TQString KommanderWidget::evalFunction(const TQString& function, const TQStringL
case Kommander::debug:
qDebug("%s", args[0].latin1());
fflush(stderr);
- return TQString::null;
+ return TQString();
case Kommander::echo:
for (uint i=0; i<args.count(); i++)
std::cout << args[i].latin1();
fflush(stdout);
- return TQString::null;
+ return TQString();
case Kommander::readSetting:
{
TQString fname = fileName();
@@ -81,7 +81,7 @@ TQString KommanderWidget::evalFunction(const TQString& function, const TQStringL
cfg.setGroup(fname);
return cfg.readEntry(args[0], args[1]);
}
- return TQString::null;
+ return TQString();
}
case Kommander::writeSetting:
{
@@ -92,7 +92,7 @@ TQString KommanderWidget::evalFunction(const TQString& function, const TQStringL
cfg.setGroup(fname);
cfg.writeEntry(args[0], args[1]);
}
- return TQString::null;
+ return TQString();
}
case Kommander::dialog:
if (args.count() > 1)
@@ -114,7 +114,7 @@ TQString KommanderWidget::evalFunction(const TQString& function, const TQStringL
TQString KommanderWidget::evalExecBlock(const TQStringList& args, const TQString& s, int& pos)
{
- int f = s.find("@execEnd", pos);
+ int f = s.tqfind("@execEnd", pos);
if (f == -1)
{
printError(i18n("Unterminated @execBegin ... @execEnd block."));
@@ -131,7 +131,7 @@ TQString KommanderWidget::evalExecBlock(const TQStringList& args, const TQString
TQString KommanderWidget::evalForEachBlock(const TQStringList& args, const TQString& s, int& pos)
{
- int f = s.find("@end", pos);
+ int f = s.tqfind("@end", pos);
//FIXME: better detection of block boundaries
if (f == -1)
{
@@ -145,9 +145,9 @@ TQString KommanderWidget::evalForEachBlock(const TQStringList& args, const TQStr
TQString var = args[0];
TQStringList loop = TQStringList::split("\n", args[1]);
TQString output;
- TQString block = substituteVariable(s.mid(start, f - start), TQString("%1_count").arg(var),
+ TQString block = substituteVariable(s.mid(start, f - start), TQString("%1_count").tqarg(var),
TQString::number(loop.count()));
- TQString varidx = TQString("%1_index").arg(var);
+ TQString varidx = TQString("%1_index").tqarg(var);
for (uint i=0; i<loop.count(); i++)
output += evalAssociatedText(substituteVariable(substituteVariable(block, varidx, TQString::number(i+1)),
var, loop[i]));
@@ -157,7 +157,7 @@ TQString KommanderWidget::evalForEachBlock(const TQStringList& args, const TQStr
TQString KommanderWidget::evalForBlock(const TQStringList& args, const TQString& s, int& pos)
{
- int f = s.find("@end", pos);
+ int f = s.tqfind("@end", pos);
//FIXME: better detection of block boundaries
if (f == -1)
{
@@ -193,7 +193,7 @@ TQString KommanderWidget::evalForBlock(const TQStringList& args, const TQString&
TQString KommanderWidget::evalIfBlock(const TQStringList& args, const TQString& s, int& pos)
{
- int f = s.find("@endif", pos);
+ int f = s.tqfind("@endif", pos);
//FIXME: better detection of block boundaries; add error message
if (f == -1)
{
@@ -214,7 +214,7 @@ TQString KommanderWidget::evalIfBlock(const TQStringList& args, const TQString&
TQString KommanderWidget::evalSwitchBlock(const TQStringList& args, const TQString& s, int& pos)
{
- int f = s.find("@end", pos);
+ int f = s.tqfind("@end", pos);
//FIXME: better detection of block boundaries; add error message
if (f == -1)
{
@@ -302,7 +302,7 @@ TQString KommanderWidget::evalArrayFunction(const TQString& function, const TQSt
const TQMap<TQString, ParseNode> map = parser.array(array);
TQString arraystring;
for (TQMap<TQString, ParseNode>::ConstIterator it = map.begin(); it != map.end(); ++it)
- arraystring += TQString("%1\t%2\n").arg(it.key()).arg(it.data().toString());
+ arraystring += TQString("%1\t%2\n").tqarg(it.key()).tqarg(it.data().toString());
return arraystring;
}
default:
@@ -317,7 +317,7 @@ TQString KommanderWidget::evalWidgetFunction(const TQString& identifier, const T
KommanderWidget* pWidget = parseWidget(identifier);
if (!pWidget)
{
- printError(i18n("Unknown widget: @%1.").arg(identifier));
+ printError(i18n("Unknown widget: @%1.").tqarg(identifier));
return TQString();
}
if (s[pos] == '.')
@@ -335,13 +335,13 @@ TQString KommanderWidget::evalWidgetFunction(const TQString& identifier, const T
}
else if (pWidget == this)
{
- printError(i18n("Infinite loop: @%1 called inside @%2.").arg(pWidget->widgetName())
- .arg(pWidget->widgetName()));
+ printError(i18n("Infinite loop: @%1 called inside @%2.").tqarg(pWidget->widgetName())
+ .tqarg(pWidget->widgetName()));
return TQString();
}
else if (!pWidget->hasAssociatedText())
{
- printError(i18n("Script for @%1 is empty.").arg(pWidget->widgetName()));
+ printError(i18n("Script for @%1 is empty.").tqarg(pWidget->widgetName()));
return TQString();
}
return pWidget->evalAssociatedText();
diff --git a/kommander/widget/kommanderwidget.cpp b/kommander/widget/kommanderwidget.cpp
index 8f880c40..2fc867f7 100644
--- a/kommander/widget/kommanderwidget.cpp
+++ b/kommander/widget/kommanderwidget.cpp
@@ -74,7 +74,7 @@ TQStringList KommanderWidget::associatedText() const
bool KommanderWidget::hasAssociatedText()
{
- int index = states().findIndex(currentState());
+ int index = states().tqfindIndex(currentState());
if (index == -1 || m_associatedText[index].isEmpty())
return false;
return true;
@@ -113,7 +113,7 @@ void KommanderWidget::setDisplayStates(const TQStringList& a_displayStates)
TQString KommanderWidget::evalAssociatedText() // expands and returns associated text as a string
{
- int index = ( states().findIndex( currentState()) );
+ int index = ( states().tqfindIndex( currentState()) );
if (index == -1)
{
printError(i18n("Invalid state for associated text."));
@@ -131,7 +131,7 @@ TQString KommanderWidget::evalAssociatedText(const TQString& a_text)
p.setWidget(this);
p.setString(a_text);
if (!p.setString(a_text) || !p.parse())
- printError(i18n("Line %1: %2.\n").arg(p.errorLine()+1).arg(p.errorMessage()));
+ printError(i18n("Line %1: %2.\n").tqarg(p.errorLine()+1).tqarg(p.errorMessage()));
return TQString();
}
/* Old macro-only parser is implemented below */
@@ -143,7 +143,7 @@ TQString KommanderWidget::evalAssociatedText(const TQString& a_text)
int pos = 0, baseTextLength = a_text.length();
while (pos < baseTextLength)
{
- int ident = a_text.find(ESCCHAR, pos);
+ int ident = a_text.tqfind(ESCCHAR, pos);
if (ident == -1) {
evalText += a_text.mid(pos);
break;
@@ -164,7 +164,7 @@ TQString KommanderWidget::evalAssociatedText(const TQString& a_text)
if (identifier.isEmpty())
{
if (pos < baseTextLength && a_text[pos] == '#') { // comment
- int newpos = a_text.find('\n', pos+1);
+ int newpos = a_text.tqfind('\n', pos+1);
if (newpos == -1)
newpos = a_text.length();
if (pos > 1 && a_text[pos-2] == '\n')
@@ -241,7 +241,7 @@ TQString KommanderWidget::evalAssociatedText(const TQString& a_text)
}
else
{
- printError(i18n("Unknown special: \'%1\'.").arg(identifier));
+ printError(i18n("Unknown special: \'%1\'.").tqarg(identifier));
return TQString();
}
}
@@ -260,7 +260,7 @@ TQString KommanderWidget::DCOPQuery(const TQStringList& a_query)
// parse function arguments
TQString function = a_query[2], pTypes;
function.remove(' ');
- int start = function.find('(');
+ int start = function.tqfind('(');
bool ok = false;
if (start != -1)
pTypes = parseBrackets(function, start, ok);
@@ -271,13 +271,13 @@ TQString KommanderWidget::DCOPQuery(const TQStringList& a_query)
}
if (!ok)
{
- printError(i18n("Unmatched parenthesis in DCOP call \'%1\'.").arg(a_query[2]));
+ printError(i18n("Unmatched tqparenthesis in DCOP call \'%1\'.").tqarg(a_query[2]));
return TQString();
}
const TQStringList argTypes = parseArgs(pTypes, ok);
if (!ok || argTypes.count() != a_query.count() - 3)
{
- printError(i18n("Incorrect arguments in DCOP call \'%1\'.").arg(a_query[2]));
+ printError(i18n("Incorrect arguments in DCOP call \'%1\'.").tqarg(a_query[2]));
return TQString();
}
@@ -295,8 +295,8 @@ TQString KommanderWidget::DCOPQuery(const TQStringList& a_query)
byteDataStream << a_query[i+3].toDouble();
else if (argTypes[i] == "bool")
byteDataStream << (bool)(a_query[i+3] != "false" && a_query[i+3] != "false" && a_query[i+3] != "0");
- else if (argTypes[i] == "TQStringList")
- if (a_query[i+3].find('\n') != -1)
+ else if (argTypes[i] == TQSTRINGLIST_OBJECT_NAME_STRING)
+ if (a_query[i+3].tqfind('\n') != -1)
byteDataStream << TQStringList::split("\n", a_query[i+3], true);
else
byteDataStream << TQStringList::split("\\n", a_query[i+3], true);
@@ -312,7 +312,7 @@ TQString KommanderWidget::DCOPQuery(const TQStringList& a_query)
}
TQDataStream byteReplyStream(byteReply, IO_ReadOnly);
- if (replyType == "TQString")
+ if (replyType == TQSTRING_OBJECT_NAME_STRING)
{
TQString text;
byteReplyStream >> text;
@@ -330,7 +330,7 @@ TQString KommanderWidget::DCOPQuery(const TQStringList& a_query)
byteReplyStream >> b;
return TQString::number(b);
}
- else if (replyType == "TQStringList")
+ else if (replyType == TQSTRINGLIST_OBJECT_NAME_STRING)
{
TQStringList text;
byteReplyStream >> text;
@@ -338,7 +338,7 @@ TQString KommanderWidget::DCOPQuery(const TQStringList& a_query)
}
else if(replyType != "void")
{
- printError(i18n("DCOP return type %1 is not yet implemented.").arg(replyType.data()));
+ printError(i18n("DCOP return type %1 is not yet implemented.").tqarg(replyType.data()));
}
return TQString();
@@ -392,7 +392,7 @@ TQString KommanderWidget::runDialog(const TQString& a_dialog, const TQString& a_
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());
return execCommand(cmd);
}
@@ -405,26 +405,26 @@ void KommanderWidget::printError(const TQString& a_error) const
KDialogBase::Yes, KDialogBase::No, 0, 0, true, false,
i18n("Continue"), i18n("Continue && Ignore Next Errors"), i18n("Stop"));
switch (KMessageBox::createKMessageBox(dialog, TQMessageBox::Warning,
- i18n("<qt>Error in widget <b>%1</b>:<p><i>%2</i></qt>").arg(TQString(m_thisObject->name()))
- .arg(a_error), TQStringList(), TQString(), 0, 0))
+ i18n("<qt>Error in widget <b>%1</b>:<p><i>%2</i></qt>").tqarg(TQString(m_thisObject->name()))
+ .tqarg(a_error), TQStringList(), TQString(), 0, 0))
{
case KDialogBase::No:
showErrors = false;
case KDialogBase::Yes:
break;
case KDialogBase::Cancel:
- if (parentDialog()->inherits(TQDIALOG_OBJECT_NAME_STRING))
+ if (tqparentDialog()->inherits(TQDIALOG_OBJECT_NAME_STRING))
{
- parentDialog()->close();
+ tqparentDialog()->close();
exit(-1);
}
- else if (parentDialog()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))
+ else if (tqparentDialog()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))
kapp->quit();
}
}
else
{
- kdError() << i18n("Error in widget %1:\n %2\n").arg(m_thisObject->name()).arg(a_error);
+ kdError() << i18n("Error in widget %1:\n %2\n").tqarg(m_thisObject->name()).tqarg(a_error);
}
}
@@ -557,16 +557,16 @@ KommanderWidget* KommanderWidget::widgetByName(const TQString& a_name) const
KommanderWidget* KommanderWidget::parseWidget(const TQString& widgetName) const
{
- if (TQString(parentDialog()->name()) == widgetName)
- return dynamic_cast <KommanderWidget*>(parentDialog());
+ if (TQString(tqparentDialog()->name()) == widgetName)
+ return dynamic_cast <KommanderWidget*>(tqparentDialog());
TQCString s = widgetName.lower() == "self" ? m_thisObject->name() : widgetName.latin1();
- TQObject* childObj = parentDialog()->child(s);
+ TQObject* childObj = tqparentDialog()->child(s);
/* if (!childObj)
{
Parser parser(internalParserData());
TQString variableValue = parser.variable(widgetName).toString();
s = variableValue.lower() == "self" ? m_thisObject->name() : variableValue.latin1();
- childObj = parentDialog()->child(s);
+ childObj = tqparentDialog()->child(s);
}*/
return dynamic_cast <KommanderWidget*>(childObj);
}
@@ -579,7 +579,7 @@ TQStringList KommanderWidget::parseFunction(const TQString& group, const TQStrin
TQString arg = parseBrackets(s, from, ok);
if (!ok)
{
- printError(i18n("Unmatched parenthesis after \'%1\'.").arg(function));
+ printError(i18n("Unmatched tqparenthesis after \'%1\'.").tqarg(function));
return TQString();
}
const TQStringList args = parseArgs(arg, ok);
@@ -588,23 +588,23 @@ TQStringList KommanderWidget::parseFunction(const TQString& group, const TQStrin
bool extraArg = gname == Group::DCOP;
if (!ok)
- printError(i18n("Unmatched quotes in argument of \'%1\'.").arg(function));
+ printError(i18n("Unmatched quotes in argument of \'%1\'.").tqarg(function));
else if (gname == -1)
- printError(i18n("Unknown function group: \'%1\'.").arg(group));
+ printError(i18n("Unknown function group: \'%1\'.").tqarg(group));
else if (fname == -1 && !extraArg)
- printError(i18n("Unknown function: \'%1\' in group '%2'.").arg(function).arg(group));
+ printError(i18n("Unknown function: \'%1\' in group '%2'.").tqarg(function).tqarg(group));
else if (fname == -1 && extraArg)
- printError(i18n("Unknown widget function: \'%1\'.").arg(function));
+ printError(i18n("Unknown widget function: \'%1\'.").tqarg(function));
else if ((int)args.count() + extraArg < SpecialInformation::minArg(gname, fname))
printError(i18n("Not enough arguments for \'%1\' (%2 instead of %3).<p>"
"Correct syntax is: %4")
- .arg(function).arg(args.count() + extraArg).arg(SpecialInformation::minArg(gname, fname))
- .arg(SpecialInformation::prototype(gname, fname, SpecialFunction::ShowArgumentNames)));
+ .tqarg(function).tqarg(args.count() + extraArg).tqarg(SpecialInformation::minArg(gname, fname))
+ .tqarg(SpecialInformation::prototype(gname, fname, SpecialFunction::ShowArgumentNames)));
else if ((int)args.count() + extraArg > SpecialInformation::maxArg(gname, fname))
printError(i18n("Too many arguments for \'%1\' (%2 instead of %3).<p>"
"Correct syntax is: %4")
- .arg(function).arg(args.count() + extraArg).arg(SpecialInformation::maxArg(gname, fname))
- .arg(SpecialInformation::prototype(gname, fname, SpecialFunction::ShowArgumentNames)));
+ .tqarg(function).tqarg(args.count() + extraArg).tqarg(SpecialInformation::maxArg(gname, fname))
+ .tqarg(SpecialInformation::prototype(gname, fname, SpecialFunction::ShowArgumentNames)));
else
success = true;
ok = success;
@@ -616,7 +616,7 @@ int KommanderWidget::parseBlockBoundary(const TQString& s, int from, const TQStr
int shortest = -1;
for (uint i=0; i<args.count(); i++)
{
- int match = s.find(args[i], from);
+ int match = s.tqfind(args[i], from);
if (shortest > match || shortest == -1)
shortest = match;
}
@@ -627,12 +627,12 @@ int KommanderWidget::parseBlockBoundary(const TQString& s, int from, const TQStr
TQString KommanderWidget::substituteVariable(TQString text, TQString variable, TQString value) const
{
- TQString var = TQString("@%1").arg(variable);
+ TQString var = TQString("@%1").tqarg(variable);
TQString newtext;
int newpos, pos = 0;
while (true)
{
- newpos = text.find(var, pos);
+ newpos = text.tqfind(var, pos);
if (newpos != -1)
{
newtext += text.mid(pos, newpos-pos);
@@ -649,12 +649,12 @@ TQString KommanderWidget::substituteVariable(TQString text, TQString variable, T
-TQWidget* KommanderWidget::parentDialog() const
+TQWidget* KommanderWidget::tqparentDialog() const
{
TQObject *superParent = m_thisObject;
- while (superParent->parent())
+ while (superParent->tqparent())
{
- superParent = superParent->parent();
+ superParent = superParent->tqparent();
if (superParent->inherits(TQDIALOG_OBJECT_NAME_STRING) || superParent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING))
break;
}
@@ -692,7 +692,7 @@ TQString KommanderWidget::handleDCOP(const int function, const TQStringList& arg
break;
case DCOP::type:
return current->className();
- case DCOP::children:
+ case DCOP::tqchildren:
{
TQStringList matching;
TQObjectList* widgets = current->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, args.count() == 0 || args[0] != "false");
@@ -707,12 +707,12 @@ TQString KommanderWidget::handleDCOP(const int function, const TQStringList& arg
bool KommanderWidget::isFunctionSupported(int f)
{
- return f == DCOP::setEnabled || f == DCOP::setVisible || f == DCOP::children || f == DCOP::type;
+ return f == DCOP::setEnabled || f == DCOP::setVisible || f == DCOP::tqchildren || f == DCOP::type;
}
bool KommanderWidget::isCommonFunction(int f)
{
- return f == DCOP::setEnabled || f == DCOP::setVisible || f == DCOP::children || f == DCOP::type;
+ return f == DCOP::setEnabled || f == DCOP::setVisible || f == DCOP::tqchildren || f == DCOP::type;
}
ParserData* KommanderWidget::internalParserData() const
@@ -722,7 +722,7 @@ ParserData* KommanderWidget::internalParserData() const
TQString KommanderWidget::fileName()
{
- KommanderWindow* window = dynamic_cast<KommanderWindow*>(parentDialog());
+ KommanderWindow* window = dynamic_cast<KommanderWindow*>(tqparentDialog());
if (window)
return TQString(window->fileName());
else
@@ -732,7 +732,7 @@ TQString KommanderWidget::fileName()
TQString KommanderWidget::widgetName() const
{
if (m_thisObject)
- return TQString::fromLatin1(m_thisObject->name());
+ return TQString::tqfromLatin1(m_thisObject->name());
else
return TQString();
}
diff --git a/kommander/widget/kommanderwidget.h b/kommander/widget/kommanderwidget.h
index c9576010..2087d086 100644
--- a/kommander/widget/kommanderwidget.h
+++ b/kommander/widget/kommanderwidget.h
@@ -115,12 +115,12 @@ protected:
TQString DCOPQuery(const TQStringList& args);
TQString localDCOPQuery(const TQString function, const TQStringList& args = TQStringList());
TQString localDCOPQuery(const TQString function, const TQString& arg1,
- const TQString& arg2, const TQString& arg3 = TQString::null,
- const TQString& arg4 = TQString::null);
+ const TQString& arg2, const TQString& arg3 = TQString(),
+ const TQString& arg4 = TQString());
// Execute given command, return its result
- TQString execCommand(const TQString& a_command, const TQString& a_shell = TQString::null) const;
+ TQString execCommand(const TQString& a_command, const TQString& a_shell = TQString()) const;
// Find and run dialog (with optional parameters)
- TQString runDialog(const TQString& a_dialog, const TQString& a_params = TQString::null);
+ TQString runDialog(const TQString& a_dialog, const TQString& a_params = TQString());
// Display error message a_error; display current class name if no other is given
void printError(const TQString& a_error) const;
// Auxiliary functions for parser
@@ -140,8 +140,8 @@ protected:
// Parse given identifier as widget name
KommanderWidget* parseWidget(const TQString& name) const;
- // Return parent dialog of this widget
- TQWidget* parentDialog() const;
+ // Return tqparent dialog of this widget
+ TQWidget* tqparentDialog() const;
TQString substituteVariable(TQString text, TQString variable, TQString value) const;
ParserData* internalParserData() const;
diff --git a/kommander/widget/myprocess.cpp b/kommander/widget/myprocess.cpp
index 59eb67fb..4914a95a 100644
--- a/kommander/widget/myprocess.cpp
+++ b/kommander/widget/myprocess.cpp
@@ -74,7 +74,7 @@ TQString MyProcess::run(const TQString& a_command, const TQString& a_shell)
// Look for shell
if (at.startsWith("#!")) {
- int eol = at.find("\n");
+ int eol = at.tqfind("\n");
if (eol == -1)
eol = at.length();
shellName = at.mid(2, eol-1).stripWhiteSpace();
@@ -91,7 +91,7 @@ TQString MyProcess::run(const TQString& a_command, const TQString& a_shell)
if(!mProcess->start(KProcess::NotifyOnExit, KProcess::All))
{
- m_atw->printError(i18n("<qt>Failed to start shell process<br><b>%1</b></qt>").arg(shellName));
+ m_atw->printError(i18n("<qt>Failed to start shell process<br><b>%1</b></qt>").tqarg(shellName));
return TQString();
}
mProcess->writeStdin(m_input, m_input.length());
@@ -102,10 +102,10 @@ TQString MyProcess::run(const TQString& a_command, const TQString& a_shell)
else
{
TQWidget dummy(0, 0, WType_Dialog | WShowModal);
- dummy.setFocusPolicy(TQWidget::NoFocus);
+ dummy.setFocusPolicy(TQ_NoFocus);
m_loopStarted = true;
qt_enter_modal(&dummy);
- qApp->enter_loop();
+ tqApp->enter_loop();
qt_leave_modal(&dummy);
if (!m_output.isEmpty() && m_output[m_output.length()-1] == '\n')
@@ -125,7 +125,7 @@ void MyProcess::slotProcessExited(KProcess* process)
{
if (m_loopStarted)
{
- qApp->exit_loop();
+ tqApp->exit_loop();
m_loopStarted = false;
}
delete process;
diff --git a/kommander/widget/myprocess.h b/kommander/widget/myprocess.h
index 36af1b48..c22aa810 100644
--- a/kommander/widget/myprocess.h
+++ b/kommander/widget/myprocess.h
@@ -26,9 +26,10 @@
class KommanderWidget;
-class KOMMANDER_EXPORT MyProcess : public QObject
+class KOMMANDER_EXPORT MyProcess : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
MyProcess(const KommanderWidget *);
// Run given command, using a_shell as a shell (this can be overridden by shebang in the first line)
diff --git a/kommander/widget/parsenode.cpp b/kommander/widget/parsenode.cpp
index 492c00fb..407e0987 100644
--- a/kommander/widget/parsenode.cpp
+++ b/kommander/widget/parsenode.cpp
@@ -38,13 +38,13 @@ ParseNode::ParseNode(double d) : m_type(ValueDouble), m_double(d), m_context(-1)
{
}
-ParseNode::ParseNode(Keyword k) : m_type(ValueKeyword), m_keyword(k), m_string(TQString::null), m_context(-1)
+ParseNode::ParseNode(Keyword k) : m_type(ValueKeyword), m_keyword(k), m_string(TQString()), m_context(-1)
{
}
ParseNode::ParseNode(Keyword k, const TQString& name) : m_type(ValueKeyword), m_keyword(k), m_context(-1)
{
- m_string = (k == Variable) ? name : TQString::null;
+ m_string = (k == Variable) ? name : TQString();
}
ParseNode ParseNode::error(const TQString& s)
diff --git a/kommander/widget/parser.cpp b/kommander/widget/parser.cpp
index 04748e45..07ffb88c 100644
--- a/kommander/widget/parser.cpp
+++ b/kommander/widget/parser.cpp
@@ -24,16 +24,16 @@ using namespace Parse;
TQString unescape(TQString s)
{
- return s.replace("\\\"", "\"").replace("\\t", "\t").replace("\\n", "\n").replace("\\\\", "\\");
+ return s.tqreplace("\\\"", "\"").tqreplace("\\t", "\t").tqreplace("\\n", "\n").tqreplace("\\\\", "\\");
}
-Parser::Parser(ParserData* pData) : m_data(pData), m_start(0), m_error(TQString::null), m_errorPosition(0),
+Parser::Parser(ParserData* pData) : m_data(pData), m_start(0), m_error(TQString()), m_errorPosition(0),
m_widget(0)
{
}
Parser::Parser(ParserData* pData, const TQString& expr) : m_data(pData), m_start(0),
- m_error(TQString::null), m_errorPosition(0), m_widget(0)
+ m_error(TQString()), m_errorPosition(0), m_widget(0)
{
setString(expr);
}
@@ -113,7 +113,7 @@ bool Parser::setString(const TQString& s)
else // Bad character
{
insertNode(s.mid(start, 1), lines);
- setError(i18n("Invalid character: '%1'").arg(s[start]), m_parts.count()-1);
+ setError(i18n("Invalid character: '%1'").tqarg(s[start]), m_parts.count()-1);
return false;
}
}
@@ -220,7 +220,7 @@ ParseNode Parser::parseValue(Mode mode)
return parseWidget(mode, value);
}else if (mode == Execute)
{
- setError(i18n("'%1' (%2) is not a widget").arg(p.variableName()).arg(variable(p.variableName()).toString()));
+ setError(i18n("'%1' (%2) is not a widget").tqarg(p.variableName()).tqarg(variable(p.variableName()).toString()));
return ParseNode();
} else
{
@@ -232,7 +232,7 @@ ParseNode Parser::parseValue(Mode mode)
}
else if (tryKeyword(LeftParenthesis, CheckOnly))
{
- setError(i18n("'%1' is not a function").arg(p.variableName()));
+ setError(i18n("'%1' is not a function").tqarg(p.variableName()));
return ParseNode();
}
else
@@ -423,15 +423,15 @@ ParseNode Parser::parseFunction(Mode mode)
tryKeyword(RightParenthesis);
}
if (f.minArgs() > params.count())
- setError(i18n("in function '%1': %2").arg(name).arg(i18n("too few parameters")), pos);
+ setError(i18n("in function '%1': %2").tqarg(name).tqarg(i18n("too few parameters")), pos);
else if (f.maxArgs() < params.count())
- setError(i18n("in function '%1': %2").arg(name).arg(i18n("too many parameters")), pos);
+ setError(i18n("in function '%1': %2").tqarg(name).tqarg(i18n("too many parameters")), pos);
else if (mode == Execute)
{
ParseNode p = f.execute(this, params);
if (!p.isValid())
{
- setError(i18n("in function '%1': %2").arg(name).arg(p.errorMessage()), pos);
+ setError(i18n("in function '%1': %2").tqarg(name).tqarg(p.errorMessage()), pos);
return ParseNode();
}
else
@@ -471,7 +471,7 @@ ParseNode Parser::parseWidget(Mode mode, const TQString &widgetName)
ParseNode p = f.execute(this, params);
if (!p.isValid())
{
- setError(i18n("in widget function '%1.%2': %3").arg(widget).arg(var).arg(p.errorMessage()), pos);
+ setError(i18n("in widget function '%1.%2': %3").tqarg(widget).tqarg(var).tqarg(p.errorMessage()), pos);
return ParseNode();
}
else
@@ -514,12 +514,12 @@ ParseNode Parser::parseAssignment(Mode mode)
m_start = m_start - 2;
return parseWidget(mode);
} else
- setError(i18n("'%1' is not a widget").arg(var));
+ setError(i18n("'%1' is not a widget").tqarg(var));
}
else if (tryKeyword(LeftParenthesis, CheckOnly))
- setError(i18n("'%1' is not a function").arg(var));
+ setError(i18n("'%1' is not a function").tqarg(var));
else
- setError(i18n("Unexpected symbol after variable '%1'").arg(var));
+ setError(i18n("Unexpected symbol after variable '%1'").tqarg(var));
return ParseNode();
}
@@ -738,9 +738,9 @@ bool Parser::tryKeyword(Keyword k, Mode mode)
if (mode == Execute)
{
if (k == Dot)
- setError(i18n("Expected '%1'<br><br>Possible cause of the error is having a variable with the same name as a widget").arg(m_data->keywordToString(k)));
+ setError(i18n("Expected '%1'<br><br>Possible cause of the error is having a variable with the same name as a widget").tqarg(m_data->keywordToString(k)));
else
- setError(i18n("Expected '%1'").arg(m_data->keywordToString(k)));
+ setError(i18n("Expected '%1'").tqarg(m_data->keywordToString(k)));
}
return false;
}
@@ -785,7 +785,7 @@ bool Parser::isWidget() const
void Parser::reset()
{
m_start = 0;
- m_error = TQString::null;
+ m_error = TQString();
m_errorPosition = 0;
}
@@ -814,9 +814,9 @@ void Parser::setVariable(const TQString& name, ParseNode value)
ParseNode Parser::variable(const TQString& name) const
{
if (isGlobal(name))
- return m_globalVariables.contains(name) ? m_globalVariables[name] : ParseNode();
+ return m_globalVariables.tqcontains(name) ? m_globalVariables[name] : ParseNode();
else
- return m_variables.contains(name) ? m_variables[name] : ParseNode();
+ return m_variables.tqcontains(name) ? m_variables[name] : ParseNode();
}
bool Parser::isGlobal(const TQString& name) const
@@ -826,7 +826,7 @@ bool Parser::isGlobal(const TQString& name) const
bool Parser::isVariable(const TQString& name) const
{
- return m_variables.contains(name) || m_globalVariables.contains(name);
+ return m_variables.tqcontains(name) || m_globalVariables.tqcontains(name);
}
void Parser::unsetVariable(const TQString& key)
@@ -847,7 +847,7 @@ const TQMap<TQString, ParseNode>& Parser::array(const TQString& name) const
bool Parser::isArray(const TQString& name) const
{
- return m_arrays.contains(name) || m_globalArrays.contains(name);
+ return m_arrays.tqcontains(name) || m_globalArrays.tqcontains(name);
}
void Parser::setArray(const TQString& name, const TQString& key, ParseNode value)
@@ -881,9 +881,9 @@ ParseNode Parser::arrayValue(const TQString& name, const TQString& key) const
if (!isArray(name))
return ParseNode();
if (isGlobal(name))
- return m_globalArrays[name].contains(key) ? m_globalArrays[name][key] : ParseNode();
+ return m_globalArrays[name].tqcontains(key) ? m_globalArrays[name][key] : ParseNode();
else
- return m_arrays[name].contains(key) ? m_arrays[name][key] : ParseNode();
+ return m_arrays[name].tqcontains(key) ? m_arrays[name][key] : ParseNode();
}
diff --git a/kommander/widget/parser.h b/kommander/widget/parser.h
index 3ad7d59c..b82188d2 100644
--- a/kommander/widget/parser.h
+++ b/kommander/widget/parser.h
@@ -65,7 +65,7 @@ public:
// set array key
void setArray(const TQString& name, const TQString& key, ParseNode value);
// unset array key or whole array
- void unsetArray(const TQString& name, const TQString& key = TQString::null);
+ void unsetArray(const TQString& name, const TQString& key = TQString());
// array value
ParseNode arrayValue(const TQString& name, const TQString& key) const;
// get associated widget
@@ -110,7 +110,7 @@ private:
// parse parameters
ParseNode parseFunction(Parse::Mode mode = Parse::Execute);
// parse widget function
- ParseNode parseWidget(Parse::Mode mode = Parse::Execute, const TQString &widgetName = TQString::null);
+ ParseNode parseWidget(Parse::Mode mode = Parse::Execute, const TQString &widgetName = TQString());
// parse assignment
ParseNode parseAssignment(Parse::Mode mode = Parse::Execute);
diff --git a/kommander/widget/parserdata.cpp b/kommander/widget/parserdata.cpp
index 274d7220..b5346fd4 100644
--- a/kommander/widget/parserdata.cpp
+++ b/kommander/widget/parserdata.cpp
@@ -19,7 +19,7 @@ using namespace Parse;
KeywordGroup ParserData::keywordGroup(Keyword k) const
{
- if (m_groups.contains(k))
+ if (m_groups.tqcontains(k))
return m_groups[k];
else
return GroupMisc;
@@ -28,7 +28,7 @@ KeywordGroup ParserData::keywordGroup(Keyword k) const
Keyword ParserData::stringToKeyword(const TQString& s) const
{
TQString k = s.lower();
- if (m_keywords.contains(k))
+ if (m_keywords.tqcontains(k))
return m_keywords[k];
else
return Variable;
@@ -116,7 +116,7 @@ ParserData::ParserData()
bool ParserData::isFunction(const TQString& name) const
{
- return m_functions.contains(name.lower());
+ return m_functions.tqcontains(name.lower());
}
const Function& ParserData::function(const TQString& name) const