]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/gui/eventdialog.cpp
MAEMO: work on alarm
[toast/confclerk.git] / src / gui / eventdialog.cpp
index a997dbf6c04d5ea9b452e9ff797672180abcfa4d..90658161403ed0d6eba2fc5f6f5954e1fda78f04 100644 (file)
@@ -2,12 +2,15 @@
 
 #include <QScrollBar>
 
-EventDialog::EventDialog(const QModelIndex &aIndex, QWidget *aParent)
+EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
     : QDialog(aParent)
-    , mIndex(aIndex)
+    , mEventId(aEventId)
 {
     setupUi(this);
 
+    const int confId = 1;
+    Event event = Event::getById(aEventId,confId);
+
     abstract->setStyleSheet("background-color : transparent;");
     description->setStyleSheet("background-color : transparent;");
 
@@ -27,10 +30,9 @@ EventDialog::EventDialog(const QModelIndex &aIndex, QWidget *aParent)
     abstract->verticalScrollBar()->setPalette(p2);
     description->verticalScrollBar()->setPalette(p2);
 
-    Event *event = static_cast<Event *>(mIndex.internalPointer());
-    title->setText(event->title());
-    persons->setText(event->persons().join(" and "));
-    abstract->setPlainText(event->abstract());
-    description->setPlainText(event->description());
+    title->setText(event.title());
+    persons->setText(event.persons().join(" and "));
+    abstract->setPlainText(event.abstract());
+    description->setPlainText(event.description());
 }