summaryrefslogtreecommitdiffstats
path: root/kommander/widget/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/widget/parser.cpp')
-rw-r--r--kommander/widget/parser.cpp44
1 files changed, 22 insertions, 22 deletions
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();
}