summaryrefslogtreecommitdiffstats
path: root/kandy/src/commandset.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kandy/src/commandset.cpp')
-rw-r--r--kandy/src/commandset.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/kandy/src/commandset.cpp b/kandy/src/commandset.cpp
index f44899cac..17a50b811 100644
--- a/kandy/src/commandset.cpp
+++ b/kandy/src/commandset.cpp
@@ -22,9 +22,9 @@
without including the source code for Qt in the source distribution.
*/
-#include <qdom.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#include <kdebug.h>
@@ -51,12 +51,12 @@ void CommandSet::deleteCommand(ATCommand *command)
mList.removeRef(command);
}
-bool CommandSet::loadFile(const QString& filename)
+bool CommandSet::loadFile(const TQString& filename)
{
// kdDebug(5960) << "CommandSet::loadFile(): " << filename << endl;
- QDomDocument doc("Kandy");
- QFile f(filename);
+ TQDomDocument doc("Kandy");
+ TQFile f(filename);
if (!f.open(IO_ReadOnly))
return false;
if (!doc.setContent(&f)) {
@@ -65,9 +65,9 @@ bool CommandSet::loadFile(const QString& filename)
}
f.close();
- QDomNodeList commands = doc.elementsByTagName("command");
+ TQDomNodeList commands = doc.elementsByTagName("command");
for(uint i=0;i<commands.count();++i) {
- QDomElement c = commands.item(i).toElement();
+ TQDomElement c = commands.item(i).toElement();
if (!c.isNull()) {
ATCommand *cmd = new ATCommand;
loadCommand(cmd,&c);
@@ -78,24 +78,24 @@ bool CommandSet::loadFile(const QString& filename)
return true;
}
-bool CommandSet::saveFile(const QString& filename)
+bool CommandSet::saveFile(const TQString& filename)
{
kdDebug(5960) << "CommandSet::saveFile(): " << filename << endl;
- QDomDocument doc("Kandy");
- QDomElement set = doc.createElement("commandset");
+ TQDomDocument doc("Kandy");
+ TQDomElement set = doc.createElement("commandset");
doc.appendChild(set);
for(uint i=0; i<mList.count();++i) {
saveCommand(mList.at(i),&doc,&set);
}
- QFile xmlfile(filename);
+ TQFile xmlfile(filename);
if (!xmlfile.open(IO_WriteOnly)) {
kdDebug(5960) << "Error opening file for write." << endl;
return false;
}
- QTextStream ts(&xmlfile);
+ TQTextStream ts(&xmlfile);
doc.documentElement().save(ts,2);
xmlfile.close();
@@ -107,15 +107,15 @@ void CommandSet::clear()
mList.clear();
}
-void CommandSet::loadCommand(ATCommand *command,QDomElement *c)
+void CommandSet::loadCommand(ATCommand *command,TQDomElement *c)
{
command->setCmdName(c->attribute("name","unknown"));
command->setCmdString(c->attribute("string","at"));
command->setHexOutput(c->attribute("hexoutput","n") == "y");
- QDomNode n = c->firstChild();
+ TQDomNode n = c->firstChild();
while(!n.isNull()) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if (!e.isNull()) {
ATParameter *p = new ATParameter;
p->setName(e.attribute("name","unnamed"));
@@ -128,25 +128,25 @@ void CommandSet::loadCommand(ATCommand *command,QDomElement *c)
}
}
-void CommandSet::saveCommand(ATCommand *command,QDomDocument *doc,
- QDomElement *parent)
+void CommandSet::saveCommand(ATCommand *command,TQDomDocument *doc,
+ TQDomElement *parent)
{
- QDomElement c = doc->createElement("command");
+ TQDomElement c = doc->createElement("command");
c.setAttribute("name",command->cmdName());
c.setAttribute("string",command->cmdString());
c.setAttribute("hexoutput",command->hexOutput() ? "y" : "n");
parent->appendChild(c);
- QPtrList<ATParameter> paras = command->parameters();
+ TQPtrList<ATParameter> paras = command->parameters();
for(uint i=0;i<paras.count();++i) {
saveParameter(paras.at(i),doc,&c);
}
}
-void CommandSet::saveParameter(ATParameter *p, QDomDocument *doc,
- QDomElement *parent)
+void CommandSet::saveParameter(ATParameter *p, TQDomDocument *doc,
+ TQDomElement *parent)
{
- QDomElement e = doc->createElement("parameter");
+ TQDomElement e = doc->createElement("parameter");
e.setAttribute("name",p->name());
e.setAttribute("value",p->value());
e.setAttribute("userinput",p->userInput() ? "y" : "n");