From cf385cd48bf81614855d79a85853bc2d9b990c02 Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Tue, 28 Jun 2011 21:31:33 +0000 Subject: [PATCH] Removed many of the qDebug() output lines (see ticket #10). --- src/gui/conferenceeditor.cpp | 1 - src/gui/daynavigatorwidget.cpp | 3 --- src/gui/eventdialog.cpp | 4 ---- src/gui/mainwindow.cpp | 6 ++---- src/gui/searchhead.cpp | 1 - src/mvc/eventmodel.cpp | 8 -------- src/mvc/treeview.cpp | 6 ------ src/orm/ormrecord.h | 5 ----- src/sql/sqlengine.cpp | 21 ++------------------- 9 files changed, 4 insertions(+), 51 deletions(-) diff --git a/src/gui/conferenceeditor.cpp b/src/gui/conferenceeditor.cpp index cfc690f..d99628a 100644 --- a/src/gui/conferenceeditor.cpp +++ b/src/gui/conferenceeditor.cpp @@ -198,7 +198,6 @@ void ConferenceEditor::showParsingProgress(int progress) void ConferenceEditor::importFinished(const QString& title) { - qDebug() << __PRETTY_FUNCTION__ << title; addBtn->show(); // removeItem should be shown later, but it takes some time, // and not looks good diff --git a/src/gui/daynavigatorwidget.cpp b/src/gui/daynavigatorwidget.cpp index 288d988..0f416f2 100644 --- a/src/gui/daynavigatorwidget.cpp +++ b/src/gui/daynavigatorwidget.cpp @@ -42,7 +42,6 @@ void DayNavigatorWidget::setDates(const QDate &aStartDate, const QDate &aEndDate { Q_ASSERT(aStartDate<=aEndDate); - //qDebug() << "DayNavigatorWidget::setDates(): " << aStartDate << ", " << aEndDate; mStartDate = aStartDate; mEndDate = aEndDate; mCurDate = aStartDate; @@ -66,7 +65,6 @@ void DayNavigatorWidget::setDates(const QDate &aStartDate, const QDate &aEndDate void DayNavigatorWidget::prevDayButtonClicked() { - //qDebug() << mStartDate << ":" << mCurDate << ":" << mEndDate; if(mCurDate>mStartDate) { mCurDate = mCurDate.addDays(-1); @@ -88,7 +86,6 @@ void DayNavigatorWidget::prevDayButtonClicked() void DayNavigatorWidget::nextDayButtonClicked() { - //qDebug() << mStartDate << ":" << mCurDate << ":" << mEndDate; if(mCurDate " << event.isFavourite(); - // have to emit 'eventHasChanged' signal on all events in conflict for(int i=0; i " << event.hasAlarm(); // since the Alarm icon has changed, update TreeView accordingly // all TreeViews have to listen on this signal emit(eventHasChanged(event.id())); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 74db6b9..aa4af8c 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -69,10 +69,12 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent) if(!AppSettings::contains("proxyIsDirectConnection")) AppSettings::setDirectConnection(true); + /* if(AppSettings::isDirectConnection()) { qDebug() << "Setting-up proxy: " << AppSettings::proxyAddress() << ":" << AppSettings::proxyPort(); } + */ QNetworkProxy proxy( AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy, AppSettings::proxyAddress(), @@ -221,7 +223,6 @@ void MainWindow::setup() SettingsDialog dialog; dialog.exec(); - qDebug() << "Setting-up proxy: " << AppSettings::proxyAddress() << ":" << AppSettings::proxyPort(); QNetworkProxy proxy( AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy, AppSettings::proxyAddress(), @@ -278,7 +279,6 @@ void MainWindow::networkQueryFinished(QNetworkReply *aReply) } else { - qDebug() << __PRETTY_FUNCTION__ << ": have data"; importData(aReply->readAll(), aReply->url().toEncoded()); } } @@ -290,7 +290,6 @@ void MainWindow::importData(const QByteArray &aData, const QString& url) void MainWindow::importFromNetwork(const QString& url) { - qDebug() << __PRETTY_FUNCTION__; QNetworkRequest request; request.setUrl(QUrl(url)); @@ -300,7 +299,6 @@ void MainWindow::importFromNetwork(const QString& url) void MainWindow::importFromFile(const QString& filename) { - qDebug() << __PRETTY_FUNCTION__; QFile file(filename); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { static const QString format("Cannot read \"%1\": error %2"); diff --git a/src/gui/searchhead.cpp b/src/gui/searchhead.cpp index ee16ca9..6e73dcc 100644 --- a/src/gui/searchhead.cpp +++ b/src/gui/searchhead.cpp @@ -40,6 +40,5 @@ SearchHead::~SearchHead() void SearchHead::searchButtonClicked() { - // qDebug() << "SearchHead::searchButtonClicked()"; emit( searchClicked() ); } diff --git a/src/mvc/eventmodel.cpp b/src/mvc/eventmodel.cpp index 9302989..074c51a 100644 --- a/src/mvc/eventmodel.cpp +++ b/src/mvc/eventmodel.cpp @@ -200,7 +200,6 @@ int EventModel::rowCount (const QModelIndex & parent) const void EventModel::clearModel() { - // qDebug() << __PRETTY_FUNCTION__ << this << mEvents.count(); mGroups.clear(); mEvents.clear(); mParents.clear(); @@ -214,7 +213,6 @@ void EventModel::loadEvents(const QDate &aDate, int aConferenceId) // check for existence of the conference in the DB if(Conference::getAll().count()) { - qDebug() << "Loading Conference Data: [" << Conference::getById(aConferenceId).title() << "] " << aDate; mEvents = Event::getByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "start"); } createTimeGroups(); @@ -226,7 +224,6 @@ void EventModel::loadFavEvents(const QDate &aDate, int aConferenceId) // check for existence of the conference in the DB if(Conference::getAll().count()) { - qDebug() << "Loading FAV Conference Data: [" << Conference::getById(aConferenceId).title() << "] " << aDate; mEvents = Event::getFavByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId); } createTimeGroups(); @@ -238,7 +235,6 @@ int EventModel::loadSearchResultEvents(const QDate &aDate, int aConferenceId) // check for existence of the conference in the DB if(Conference::getAll().count()) { - // qDebug() << "Loading search result Data: [" << Conference::getById(aConferenceId).title() << "] " << aDate; try{ mEvents = Event::getSearchResultByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "start"); } @@ -261,7 +257,6 @@ void EventModel::loadEventsByTrack(const QDate &aDate, int aConferenceId) clearModel(); if (Conference::getAll().count()) { - qDebug() << "Loading Conference Data (by Track): [" << Conference::getById(aConferenceId).title() << "] " << aDate; mEvents = Event::getByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "xid_track, start"); } createTrackGroups(); @@ -272,7 +267,6 @@ void EventModel::loadEventsByRoom(const QDate &aDate, int aConferenceId) clearModel(); if (Conference::getAll().count()) { - qDebug() << "Loading Conference Data (by Room): [" << Conference::getById(aConferenceId).title() << "] " << aDate; mEvents = Event::getByDateAndRoom(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId); } createRoomGroups(); @@ -284,7 +278,6 @@ void EventModel::loadNowEvents(int aConferenceId) // check for existence of the conference in the DB if(Conference::getAll().count()) { - qDebug() << "Loading Conference Data: [" << Conference::getById(aConferenceId).title() << "] scheduled NOW"; mEvents = Event::nowEvents(aConferenceId, "start"); } createTimeGroups(); @@ -296,7 +289,6 @@ void EventModel::loadConflictEvents(int aEventId, int aConferenceId) // check for existence of the conference in the DB if(Conference::getAll().count()) { - qDebug() << "Loading Conference Data: [" << Conference::getById(aConferenceId).title() << "] in conflict with " << aEventId; mEvents = Event::conflictEvents(aEventId, aConferenceId); } createTimeGroups(); diff --git a/src/mvc/treeview.cpp b/src/mvc/treeview.cpp index 480c91a..956e49f 100644 --- a/src/mvc/treeview.cpp +++ b/src/mvc/treeview.cpp @@ -76,8 +76,6 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP event.setFavourite(true); event.update("favourite"); - qDebug() << " FAVOURITE [" << qVariantValue(aIndex.data()) << "] -> " << event.isFavourite(); - if(event.isFavourite()) { // event has became 'favourite' and so 'conflicts' list may have changed @@ -118,11 +116,9 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP Alarm alarm; //int cookie = alarm.addAlarm(event.id(),QDateTime::currentDateTime().addSecs(10)); // testing int cookie = alarm.addAlarm(event.id(),event.start().addSecs(-15*60)); // 15 minutes before real start - qDebug() << "cookie: " << cookie; #endif /* MAEMO */ } event.update("alarm"); - qDebug() << " ALARM [" << qVariantValue(aIndex.data()) << "] -> " << event.hasAlarm(); // since the Alarm icon has changed, update TreeView accordingly // all TreeViews have to listen on this signal emit(eventHasChanged(event.id())); @@ -132,7 +128,6 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP case Delegate::MapControl: { // handle Alarm Control clicked - qDebug() << "MAP CLICKED: " << qVariantValue(aIndex.data()); emit(requestForMap(aIndex)); handled = true; } @@ -140,7 +135,6 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP case Delegate::WarningControl: { - qDebug() << "WARNING CLICKED: " << qVariantValue(aIndex.data()); emit(requestForConflicts(aIndex)); handled = true; } diff --git a/src/orm/ormrecord.h b/src/orm/ormrecord.h index 5f7184c..4f5828d 100644 --- a/src/orm/ormrecord.h +++ b/src/orm/ormrecord.h @@ -151,10 +151,6 @@ QList OrmRecord::load(QSqlQuery query) qDebug() << "Error: " << query.lastError().driverText() << "; Type: " << query.lastError().type(); throw OrmSqlException(query.lastError().text()); } - else - { - /*qDebug() << "SQL OK";*/ - } } QList objects; @@ -162,7 +158,6 @@ QList OrmRecord::load(QSqlQuery query) { objects << hydrate(query.record()); } - /*qDebug() << "Fetch done";*/ return objects; } diff --git a/src/sql/sqlengine.cpp b/src/sql/sqlengine.cpp index 810f716..f85d1f6 100644 --- a/src/sql/sqlengine.cpp +++ b/src/sql/sqlengine.cpp @@ -132,8 +132,6 @@ void SqlEngine::addConferenceToDB(QHash &aConference) void SqlEngine::addEventToDB(QHash &aEvent) { - //LOG_DEBUG(QString("Adding event '%1' to DB").arg(*aEvent)); - QSqlDatabase db = QSqlDatabase::database(); if (db.isValid() && db.isOpen()) @@ -147,18 +145,15 @@ void SqlEngine::addEventToDB(QHash &aEvent) { track = Track::retrieveByName(conference, name); trackId = track.id(); - /*qDebug() << QString("DEBUG: Track %1 in DB").arg(name);*/ } catch (OrmNoObjectException &e) { track.setConference(conference); track.setName(name); trackId = track.insert(); - /*qDebug() << QString("DEBUG: Track %1 added to DB").arg(name);*/ } QDateTime startDateTime; startDateTime.setTimeSpec(Qt::UTC); startDateTime = QDateTime(QDate::fromString(aEvent["date"],DATE_FORMAT),QTime::fromString(aEvent["start"],TIME_FORMAT),Qt::UTC); - // qDebug() << "startDateTime: " << startDateTime.toString(); bool event_exists = false; { @@ -275,7 +270,6 @@ void SqlEngine::addRoomToDB(QHash &aRoom) query.bindValue(":event_id", aRoom["event_id"]); query.bindValue(":room_id", aRoom["id"]); if (!query.exec()) qDebug() << "Could not 'execute insert into event_room' query:" << query.lastError(); - //LOG_AUTOTEST(query); } } @@ -293,7 +287,6 @@ void SqlEngine::addLinkToDB(QHash &aLink) query.bindValue(":name", aLink["name"]); query.bindValue(":url", aLink["url"]); if (!query.exec()) qDebug() << "Error executing 'insert into link' query: " << query.lastError(); - //LOG_AUTOTEST(query); } } @@ -387,23 +380,16 @@ void SqlEngine::deleteConference(int id) bool SqlEngine::execQuery(QSqlDatabase &aDatabase, const QString &aQuery) { - //qDebug() << "\nSQL: " << aQuery; - QSqlQuery sqlQuery(aDatabase); if( !sqlQuery.exec(aQuery) ){ qDebug() << "SQL ERR: " << sqlQuery.lastError().number() << ", " << sqlQuery.lastError().text(); return false; } - else{ - //qDebug() << "SQL OK.\n"; - return true; - } + return true; } bool SqlEngine::execQueryWithParameter(QSqlDatabase &aDatabase, const QString &aQuery, const QHash& params) { - qDebug() << "SQL:" << aQuery << "params:" << params; - QSqlQuery sqlQuery(aDatabase); sqlQuery.prepare(aQuery); foreach (QString param_key, params.keys()) { @@ -413,10 +399,7 @@ bool SqlEngine::execQueryWithParameter(QSqlDatabase &aDatabase, const QString &a qDebug() << "SQL ERR: " << sqlQuery.lastError().number() << ", " << sqlQuery.lastError().text(); return false; } - else{ - //qDebug() << "SQL OK.\n"; - return true; - } + return true; } void SqlEngine::checkConferenceMap(QSqlDatabase &aDatabase) -- 2.39.5