From 87916ccf71bd35f41a84c1e8f0fe211b5279c558 Mon Sep 17 00:00:00 2001 From: Jan Darmochwal Date: Wed, 6 Oct 2010 11:01:33 +0200 Subject: Remove debug printfs --- src/vsession.cpp | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'src/vsession.cpp') diff --git a/src/vsession.cpp b/src/vsession.cpp index 35292d2..bd86610 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -15,8 +15,6 @@ #include "vsession.h" bool VSession::init(const QString& xml, const QString& baseDirPath) { - printf("VSession::init(xml, %s)\n", baseDirPath.toAscii().data()); - //printf("xml = %s\n", xml.toAscii().data()); this->baseDirPath_ = baseDirPath; return this->doc_.setContent(xml); } @@ -25,24 +23,15 @@ void VSession::addNodeWithAttribute(const QString& nodeName, const QString& value, const QString& attribute, bool replace) { - - printf("VSession:addNodeWithAttribute(%s, %s, %s, %d)\n", - nodeName.toUtf8().data(), - value.toUtf8().data(), - attribute.toUtf8().data(), - replace); - QDomElement node = this->doc_.namedItem("eintrag").namedItem(nodeName).toElement(); if (replace == false || node.isNull()) { - printf(" creating new node\n"); // create a new node node = this->doc_.createElement(nodeName); this->doc_.namedItem("eintrag").appendChild(node); } - printf(" setting attribute\n"); node.setAttribute(attribute, value); } @@ -52,19 +41,12 @@ QString VSession::toXml() const { QString VSession::getAttribute(const QString &nodeName, const QString &attribute) const { - printf ("VSession::getAttribute(%s, %s)\n", nodeName.toAscii().data(), attribute.toAscii().data()); QDomDocument doc = this->doc_; - //printf (" doc xml:\n%s\n", doc.toString().toAscii().data()); QDomNode n = doc.namedItem("eintrag").namedItem(nodeName); if (n.isNull()) { - printf(" failed to find node\n"); + // TODO } - printf(" node name: %s\n", n.nodeName().toAscii().data()); - printf(" node type: %d\n", n.nodeType()); - printf(" node value: %s\n", n.nodeValue().toAscii().data()); - printf(" attribute %s=%s\n", attribute.toUtf8().data(), this->doc_.namedItem("eintrag").namedItem(nodeName).toElement().attribute(attribute).toUtf8().data()); - //printf (" --> %s\n", this->doc_.namedItem("eintrag").namedItem(nodeName).namedItem(attribute).toAttr().value()); return this->doc_.namedItem("eintrag").namedItem(nodeName).toElement().attribute(attribute); } @@ -174,7 +156,6 @@ void VSession::addScanners(const QString& script) { } void VSession::addUserAndHostname() { - printf("VSession::addUserAndHostname()\n"); QString username(getpwuid(geteuid())->pw_name); this->addNodeWithAttribute("username", username); @@ -199,8 +180,6 @@ void VSession::addUserAndHostname() { } bool VSession::run() const { - - printf("VSession::run()\n"); QString command = getAttribute("command"); if (! command.isEmpty()) { if (QProcess::startDetached(command)) { @@ -242,19 +221,16 @@ bool VSession::run() const { } QList VSession::readXmlFile(const QString& filepath) { - printf("VSession::readXmlFile(%s)\n", filepath.toAscii().data()); QList retval; QDomDocument doc; QFile file(filepath); if (!file.open(QIODevice::ReadOnly)) { // TODO: error message - printf("error: cannot open file\n"); return retval; } if (!doc.setContent(&file)) { // TODO: error message - printf("error: cannot parse file\n"); file.close(); return retval; } @@ -266,12 +242,10 @@ QList VSession::readXmlFile(const QString& filepath) { for (QDomElement el(settingsNode.firstChildElement("eintrag")); !el.isNull(); el = el.nextSiblingElement("eintrag")) { - printf("reading %s node\n", el.tagName().toAscii().data()); QDomDocument dummy; dummy.appendChild(dummy.importNode(el, true)); VSession* e = new VSession; if (e->init(dummy.toString(), dirName)) { - printf("appending node\n"); retval.append(e); } } @@ -284,7 +258,6 @@ QList VSession::readXmlFile(const QString& filepath) { * - reads all xml files and creates for each its own VSession-struct */ QList VSession::readXmlDir(const QString& path) { - printf("VSession::readXmlDir(%s)\n", path.toAscii().data()); QList retval; QDir appDir(QApplication::applicationDirPath()); @@ -310,7 +283,6 @@ QList VSession::readXmlDir(const QString& path) { } } - printf("VSession::readXmlDir(%s), read %d entries\n", path.toAscii().data(), retval.size()); return retval; } -- cgit v1.2.3-55-g7522