bool Controller::modifyEvent( const Event& e ) { if ( m_storage->modifyEvent( e ) ) { emit eventModified( e ); return true; } else { return false; } }
void connectControllerAndModel( Controller* controller, CharmDataModel* model ) { QObject::connect( controller, SIGNAL(eventAdded(Event)), model, SLOT(addEvent(Event)) ); QObject::connect( controller, SIGNAL(eventModified(Event)), model, SLOT(modifyEvent(Event)) ); QObject::connect( controller, SIGNAL(eventDeleted(Event)), model, SLOT(deleteEvent(Event)) ); QObject::connect( controller, SIGNAL(allEvents(EventList)), model, SLOT(setAllEvents(EventList)) ); QObject::connect( controller, SIGNAL(definedTasks(TaskList)), model, SLOT(setAllTasks(TaskList)) ); QObject::connect( controller, SIGNAL(taskAdded(Task)), model, SLOT(addTask(Task)) ); QObject::connect( controller, SIGNAL(taskUpdated(Task)), model, SLOT(modifyTask(Task)) ); QObject::connect( controller, SIGNAL(taskDeleted(Task)), model, SLOT(deleteTask(Task)) ); }