diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kandy/src/commandset.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kandy/src/commandset.cpp')
-rw-r--r-- | kandy/src/commandset.cpp | 46 |
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"); |