summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_csv/csv.cpp
diff options
context:
space:
mode:
authorDonovan Baarda <abo@minkirri.apana.org.au>2014-10-15 14:07:20 +1100
committerDonovan Baarda <abo@minkirri.apana.org.au>2014-10-15 14:07:20 +1100
commitdbd04e283082ab869a22abf03c4c6280b03935bb (patch)
tree3951c6f91f76047e655f35e04db4eecd576c49df /ftnoir_csv/csv.cpp
parentd880464fbe9180aefde94594330126e115066dc3 (diff)
parent051a2e4392bc75b246cc5cb897ae0bbb1f92042e (diff)
Merge branch 'unstable' of https://github.com/opentrack/opentrack into dev/kalman
Conflicts: ftnoir_filter_kalman/ftnoir_filter_kalman.h
Diffstat (limited to 'ftnoir_csv/csv.cpp')
-rw-r--r--ftnoir_csv/csv.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/ftnoir_csv/csv.cpp b/ftnoir_csv/csv.cpp
index 66823d24..b59b5083 100644
--- a/ftnoir_csv/csv.cpp
+++ b/ftnoir_csv/csv.cpp
@@ -25,9 +25,9 @@
#define INSIDE_CSV
#include "csv.h"
#include <QTextDecoder>
-#include <QDebug>
#include <QFile>
#include <QCoreApplication>
+#include <QDebug>
CSV::CSV(QIODevice * device)
{
@@ -46,12 +46,10 @@ CSV::CSV(QString &string){
CSV::~CSV()
{
- //delete m_codec;
}
void CSV::setCodec(const char* codecName){
- //delete m_codec;
m_codec = QTextCodec::codecForName(codecName);
}
@@ -59,7 +57,6 @@ QString CSV::readLine(){
QString line;
if(m_string.isNull()){
- //READ DATA FROM DEVICE
if(m_device && m_device->isReadable()){
QTextDecoder dec(m_codec);
m_string = dec.toUnicode(m_device->readAll());
@@ -67,8 +64,6 @@ QString CSV::readLine(){
return QString();
}
}
-
- //PARSE
if((m_pos = m_rx.indexIn(m_string,m_pos)) != -1) {
line = m_rx.cap(1);
m_pos += m_rx.matchedLength();
@@ -111,12 +106,9 @@ void CSV::getGameData( const int id, unsigned char* table, QString& gamename)
QStringList gameLine;
qDebug() << "getGameData, ID = " << gameID;
- //
- // Open the supported games list, to get the Name.
- //
QFile file(QCoreApplication::applicationDirPath() + "/settings/facetracknoir supported games.csv");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)){
- return;
+ return;
}
CSV csv(&file);
gameLine = csv.parseLine();
@@ -131,9 +123,6 @@ void CSV::getGameData( const int id, unsigned char* table, QString& gamename)
//qDebug() << "Column 6: " << gameLine.at(6); // International ID
//qDebug() << "Column 7: " << gameLine.at(7); // FaceTrackNoIR ID
- //
- // If the gameID was found, fill the shared memory
- //
if (gameLine.count() > 6) {
if (gameLine.at(6).compare( gameID, Qt::CaseInsensitive ) == 0) {
QByteArray id = gameLine.at(7).toLatin1();
@@ -172,9 +161,6 @@ void CSV::getGameData( const int id, unsigned char* table, QString& gamename)
gameLine = csv.parseLine();
}
- //
- // If the gameID was NOT found, fill only the name "Unknown game connected"
- //
qDebug() << "Unknown game connected" << gameID;
file.close();
}