Fix activated status toggling
authorChristophe Dumez <dchris@gmail.com>
Sat, 10 Jul 2010 20:38:12 +0000 (22:38 +0200)
committerChristophe Dumez <dchris@gmail.com>
Sat, 10 Jul 2010 20:38:12 +0000 (22:38 +0200)
switchingeventlist.cpp

index 8773bcb..022b7d9 100644 (file)
@@ -70,8 +70,8 @@ void SwitchingEventList::editEvent(QModelIndex index) {
   QByteArray edited_id = model->data(model->index(index.row(), EV_ID)).toByteArray();
   if(index.column() == EV_STATUS) {
     // Toggle activated state
-    const bool new_status = !index.data().toBool();
-    model->setData(index, new_status);
+    const bool new_status = !index.data(Qt::UserRole).toBool();
+    model->setData(index, new_status, Qt::UserRole);
     // Alter Alarmd events
     if(new_status) {
       // Was activated