Added some comments, removed and added some debug information.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Thu, 23 Jun 2011 12:23:57 +0000 (12:23 +0000)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Thu, 23 Jun 2011 12:23:57 +0000 (12:23 +0000)
src/gui/mainwindow.cpp
src/gui/tabcontainer.h
src/mvc/eventmodel.cpp
src/mvc/eventmodel.h
src/orm/ormrecord.h

index 2cee85cd38410b210ee231660e262fa5531ebbe7..c6952993b7a23440e6c3e3909a889f59ed4a6aae 100644 (file)
@@ -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?
index c4a4b882a8a55f81ada8d934bed0830650e9f096..da5045bdb2c3b3d77295a6c39288b83b80c3b408 100644 (file)
@@ -41,7 +41,7 @@ protected:
     {
         Q_UNUSED(aDate);
         Q_UNUSED(aConferenceId);
-    };
+    }
 
 signals:
     void eventHasChanged(int aEventId, bool aReloadModel);
index c57702afd79e881bdd92a5b3e8cb16a57e221645..7b24436000ce081e516cb971852aec9f53b651ba 100644 (file)
@@ -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();
index 5a21f36cef423c04a5fe2ec9c6d25e735290751a..318cfde5dbe601ccd191cd680873e0d96506a72e 100644 (file)
@@ -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;
index dfafc94bced31f606ed12af19aa6b4f996e8f1b8..054c200e35d4712aabc7b945999bbc160e86f2df 100644 (file)
@@ -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 <typename T>