From 9d62a533260e7188d672a5b228e24e15dc58691f Mon Sep 17 00:00:00 2001 From: Sakari Poussa Date: Tue, 3 Nov 2009 21:22:10 +0200 Subject: [PATCH] logging changes --- scorecard.qrc | 4 ---- src/data.cpp | 2 +- src/main-window.cpp | 20 ++++++++++---------- src/main.cpp | 1 - src/score-dialog.cpp | 3 +-- src/table-model.cpp | 1 - src/xml-dom-parser.cpp | 10 +++++----- 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/scorecard.qrc b/scorecard.qrc index 352faf5..d574b3a 100644 --- a/scorecard.qrc +++ b/scorecard.qrc @@ -1,8 +1,4 @@ - images/next.png - images/qgn_plat_notebook_button_next.png - images/qgn_plat_breadcrumb_arrow_normal.png - images/qgn_plat_scroll_thumbsize_vertical_down_arrow_normal.png diff --git a/src/data.cpp b/src/data.cpp index 782f3da..9885c75 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -198,7 +198,7 @@ const QString& Score::getDate() const void Score::dump() { - qDebug() << club << " " << course << " " << date ; + qDebug() << club << course << date ; for (int i=0; idump(); } diff --git a/src/main-window.cpp b/src/main-window.cpp index 035caed..5b4b546 100644 --- a/src/main-window.cpp +++ b/src/main-window.cpp @@ -81,10 +81,10 @@ void MainWindow::loadSettings(void) QDir dir(dataDir); if (!dir.exists()) if (!dir.mkpath(dataDir)) { - qDebug() << "Unable to create: " + dataDir; + qWarning() << "Unable to create: " + dataDir; return; } - qDebug() << "Data is at: " + dataDir; + qDebug() << "Data is at:" + dataDir; } void MainWindow::createLayout(QWidget *parent) @@ -383,12 +383,12 @@ void MainWindow::newScore() Club *club = findClub(clubName); if (!club) { - qDebug() << "Error: no such club: " << clubName; + qWarning() << "Error: no such club:" << clubName; return; } Course *course = club->getCourse(courseName); if (!course) { - qDebug() << "Error: no such course: " << courseName; + qWarning() << "Error: no such course:" << courseName; return; } scoreDialog->init(course); @@ -450,7 +450,7 @@ void MainWindow::loadScoreFile(QString &fileName, QList &list) ScoreXmlHandler handler(list); if (handler.parse(fileName)) - qDebug() << "File loaded: " << fileName << " entries: " << list.size(); + qDebug() << "File loaded:" << fileName << " entries:" << list.size(); } void MainWindow::saveScoreFile(QString &fileName, QList &list) @@ -459,9 +459,9 @@ void MainWindow::saveScoreFile(QString &fileName, QList &list) if (handler.save(fileName)) // TODO: banner - qDebug() << "File saved: " << fileName << " entries: " << list.size(); + qDebug() << "File saved:" << fileName << " entries:" << list.size(); else - qDebug() << "Unable to save: " << fileName; + qWarning() << "Unable to save:" << fileName; } void MainWindow::loadClubFile(QString &fileName, QList &list) @@ -469,7 +469,7 @@ void MainWindow::loadClubFile(QString &fileName, QList &list) ClubXmlHandler handler(list); if (handler.parse(fileName)) - qDebug() << "File loaded: " << fileName << " entries: " << list.size(); + qDebug() << "File loaded:" << fileName << " entries:" << list.size(); } void MainWindow::saveClubFile(QString &fileName, QList &list) @@ -478,8 +478,8 @@ void MainWindow::saveClubFile(QString &fileName, QList &list) if (handler.save(fileName)) // TODO: banner - qDebug() << "File saved: " << fileName << " entries: " << list.size(); + qDebug() << "File saved:" << fileName << " entries:" << list.size(); else - qDebug() << "Unable to save: " << fileName; + qWarning() << "Unable to save:" << fileName; } diff --git a/src/main.cpp b/src/main.cpp index bc3fad8..448864b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,7 +12,6 @@ int main(int argc, char *argv[]) QStringList keys = QInputContextFactory::keys(); qDebug() << "Input Context Factory keys: " << keys; QInputContext *hildonInputContext=0; - //QHildonInputContext *hildonInputContext=QInputContextFactory::create("hildon"); hildonInputContext=QInputContextFactory::create("hildon", 0); app.setInputContext(hildonInputContext); #endif diff --git a/src/score-dialog.cpp b/src/score-dialog.cpp index 78b3be1..d0b6d51 100644 --- a/src/score-dialog.cpp +++ b/src/score-dialog.cpp @@ -235,7 +235,7 @@ void ScoreDialog::up(void) QTableWidgetItem *item = table->currentItem(); if (!item) { - qDebug() << "ERROR: no current item"; + qWarning() << "ERROR: no current item"; return; } @@ -285,7 +285,6 @@ void ScoreDialog::moveToNextCell(QTableWidgetItem *item) col = 0; row = (row == ROW_SCORE_2) ? ROW_SCORE : ROW_SCORE_2; } - //qDebug() << "new cell: " << row << "/" << col; table->setCurrentCell(row, col); } diff --git a/src/table-model.cpp b/src/table-model.cpp index 077ca02..e2f3d8d 100644 --- a/src/table-model.cpp +++ b/src/table-model.cpp @@ -169,7 +169,6 @@ QModelIndex ScoreTableModel::index(int row, int column, const QModelIndex &paren { if (hasIndex(row, column, parent)) { int flag = (parent.column() > 0) ? parent.column() : 0; - //qDebug() << "index() " << row << "/" << column << "/ flag: " << flag <<"//" << parent; return createIndex(row, column, flag); } else { diff --git a/src/xml-dom-parser.cpp b/src/xml-dom-parser.cpp index e0426fa..fb42735 100644 --- a/src/xml-dom-parser.cpp +++ b/src/xml-dom-parser.cpp @@ -10,12 +10,12 @@ int ScoreXmlHandler::parse(QString &fileName) QFile file(fileName); if (!file.open(QFile::ReadOnly)) { - qDebug() << "Unable to open : " << fileName; + qWarning() << "Unable to open :" << fileName; return false; } else if (!doc.setContent(&file)) { file.close(); - qDebug() << "Unable set content : " << fileName; + qWarning() << "Unable set content :" << fileName; return false; } else { @@ -76,17 +76,17 @@ int ClubXmlHandler::parse(QString &fileName) QFile file(fileName); if (!file.open(QFile::ReadOnly)) { - qDebug() << "Unable to open : " << fileName; + qWarning() << "Unable to open :" << fileName; return false; } else if (!doc.setContent(&file)) { file.close(); - qDebug() << "Unable set content : " << fileName; + qWarning() << "Unable set content :" << fileName; return false; } else { file.close(); - qDebug() << "File ready for XML : " << fileName; + qDebug() << "File ready for XML :" << fileName; } root = doc.documentElement(); // this is for reading -- 1.7.9.5