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