use enabled flag instead of repeated criateria check
authorkirilma <kirilma@localhost>
Wed, 5 May 2010 13:59:53 +0000 (13:59 +0000)
committerkirilma <kirilma@localhost>
Wed, 5 May 2010 13:59:53 +0000 (13:59 +0000)
src/mvc/delegate.cpp

index d9d6fa2..cb7923d 100644 (file)
@@ -325,15 +325,11 @@ Delegate::ControlId Delegate::whichControlClicked(const QModelIndex &aIndex, con
     while (i.hasNext())
     {
         ControlId id = i.next();
-        if(mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint))
+        Control *control = mControls[id];
+        if (control->enabled()
+            and control->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint))
         {
-            if(id == WarningControl)
-            {
-                if(static_cast<Event*>(aIndex.internalPointer())->hasTimeConflict())
-                    return id;
-            }
-            else
-                return id;
+            return id;
         }
     }