X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Fxmlwriter.cpp;h=3abe02ac1380e1b7314a4ce1e5d97f4a5f6df5e7;hp=fd46a6d04146dcb30092921504a287aa99bfcab2;hb=69cb07ccffb899f28e122e1fe2ea1a94dce4a07a;hpb=b8104711348ebb86e8c93b23067af8f699870626 diff --git a/Client/xmlwriter.cpp b/Client/xmlwriter.cpp index fd46a6d..3abe02a 100644 --- a/Client/xmlwriter.cpp +++ b/Client/xmlwriter.cpp @@ -2,21 +2,20 @@ * Xml writer * * @author Tiina Kivilinna-Korhola + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * license http://opensource.org/licenses/gpl-license.php GNU Public License */ #include "xmlwriter.h" - - /** *@brief Constructor, connects object to GUI *@param Pointer to carmainwindow, which is temporarily used during development */ XmlWriter::XmlWriter() { - tmpvalue = 3010; + } /** @@ -59,13 +58,12 @@ void XmlWriter::writeRegistering(QBuffer *netbuf, QString usr, QString psswd, QS xmlwriter.writeEndDocument(); } - /** *@brief Writes Speed Freek results items as tags and contents into a buffer. *@todo Consider looping when writing many values. *@todo Replace test value to finally used variables. */ -void XmlWriter::writeResult(QBuffer *netbuf) +void XmlWriter::writeResult(QBuffer *netbuf, double result) { qDebug() << "_writeResult"; @@ -73,14 +71,11 @@ void XmlWriter::writeResult(QBuffer *netbuf) xmlwriter.writeStartDocument(); xmlwriter.writeStartElement("result"); - tmpvalue++; - qDebug() << tmpvalue; - xmlwriter.writeAttribute("value", QString::number(tmpvalue)); + xmlwriter.writeAttribute("value", QString::number(result)); xmlwriter.writeEndElement(); xmlwriter.writeEndDocument(); } - /** *@brief Write track to server. *@param netbuf where to write. @@ -117,7 +112,6 @@ void XmlWriter::writeGpsTrack(QBuffer *netbuf, int counter, int start, int stop, xmlwriter.writeEndDocument(); } - /** *@brief Opens and closes a file, when xml information is written into a file, *and passes file to writeXmlFile() @@ -160,7 +154,6 @@ bool XmlWriter::writeXmlFile(QIODevice *device) return true; } - /** *@brief Writes Speed Freek results items as tags and contents to earlier defined target. *@todo Consider looping when writing many values. @@ -174,4 +167,3 @@ void XmlWriter::writeItems() xmlwriter.writeAttribute("date", QDateTime::currentDateTime().toString()); xmlwriter.writeEndElement(); } -