From a0f3e328b3cf489002937fb2fa82c73706f480c3 Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Thu, 23 Jun 2011 12:23:57 +0000 Subject: [PATCH] Added some comments, removed and added some debug information. --- src/gui/mainwindow.cpp | 7 ++++--- src/gui/tabcontainer.h | 2 +- src/mvc/eventmodel.cpp | 2 +- src/mvc/eventmodel.h | 8 ++++---- src/orm/ormrecord.h | 12 ++++++------ 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 2cee85c..c695299 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -95,9 +95,10 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent) useConference(Conference::activeConference()); // optimization, see useConference() code try { - initTabs(); - } catch (OrmException) { - clearTabs(); + initTabs(); + } catch (const OrmException& e) { + qDebug() << "OrmException:" << e.text(); + clearTabs(); } // TODO: open conferences at startup? diff --git a/src/gui/tabcontainer.h b/src/gui/tabcontainer.h index c4a4b88..da5045b 100644 --- a/src/gui/tabcontainer.h +++ b/src/gui/tabcontainer.h @@ -41,7 +41,7 @@ protected: { Q_UNUSED(aDate); Q_UNUSED(aConferenceId); - }; + } signals: void eventHasChanged(int aEventId, bool aReloadModel); diff --git a/src/mvc/eventmodel.cpp b/src/mvc/eventmodel.cpp index c57702a..7b24436 100644 --- a/src/mvc/eventmodel.cpp +++ b/src/mvc/eventmodel.cpp @@ -199,7 +199,7 @@ int EventModel::rowCount (const QModelIndex & parent) const void EventModel::clearModel() { - qDebug() << __PRETTY_FUNCTION__ << this << mEvents.count(); + // qDebug() << __PRETTY_FUNCTION__ << this << mEvents.count(); mGroups.clear(); mEvents.clear(); mParents.clear(); diff --git a/src/mvc/eventmodel.h b/src/mvc/eventmodel.h index 5a21f36..318cfde 100644 --- a/src/mvc/eventmodel.h +++ b/src/mvc/eventmodel.h @@ -26,7 +26,7 @@ class EventModel : public QAbstractItemModel { public: - static const QString COMMA_SEPARATOR; + static const QString COMMA_SEPARATOR; // ", " public: EventModel(); QVariant data(const QModelIndex& index, int role) const; @@ -49,9 +49,9 @@ private: Group(const QString & title, int firstEventIndex) : - mTitle(title), - mFirstEventIndex(firstEventIndex), - mChildCount(0) + mTitle(title), // e.g. "16:00 - 17:30" + mFirstEventIndex(firstEventIndex), // first index within mEvents + mChildCount(0) // number of events in mEvents {} QString mTitle; diff --git a/src/orm/ormrecord.h b/src/orm/ormrecord.h index dfafc94..054c200 100644 --- a/src/orm/ormrecord.h +++ b/src/orm/ormrecord.h @@ -30,8 +30,8 @@ class OrmException { public: - OrmException(const QString& text) : mText(text) {}; - virtual ~OrmException(){}; + OrmException(const QString& text) : mText(text) {} + virtual ~OrmException(){} virtual const QString& text() const { return mText; } private: QString mText; @@ -40,15 +40,15 @@ private: class OrmNoObjectException : public OrmException { public: - OrmNoObjectException() : OrmException("No object exception"){}; - ~OrmNoObjectException(){}; + OrmNoObjectException() : OrmException("No object exception"){} + ~OrmNoObjectException(){} }; class OrmSqlException : public OrmException { public: - OrmSqlException(const QString& text) : OrmException( QString("Sql error: ") + text ) {}; - ~OrmSqlException(){}; + OrmSqlException(const QString& text) : OrmException( QString("Sql error: ") + text ) {} + ~OrmSqlException(){} }; template -- 2.39.5