Changeset dc66a91


Ignore:
Timestamp:
10/17/11 20:15:33 (11 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
c81f30a
Parents:
264f5e7
Message:

The favorite tab gets updated again after changing the favorite state.

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    r264f5e7 rdc66a91  
    8585
    8686    // event details have changed
    87     connect(dayTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool)));
    88     connect(favsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool)));
    89     connect(tracksTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool)));
    90     connect(roomsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool)));
    91     connect(searchTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool)));
     87    connect(dayTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool)));
     88    connect(favsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool)));
     89    connect(tracksTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool)));
     90    connect(roomsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool)));
     91    connect(searchTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool)));
    9292
    9393    // date has changed
     
    155155
    156156
    157 
    158 void MainWindow::redisplayEvent(int aEventId, bool aReloadModel)
    159 {
     157void MainWindow::onEventChanged(int aEventId, bool favouriteChanged) {
    160158    dayTabContainer->redisplayEvent(aEventId);
    161     favsTabContainer->redisplayEvent(aEventId,aReloadModel);
     159    if (favouriteChanged) favsTabContainer->redisplayDate(dayNavigator->curDate());
     160    else favsTabContainer->redisplayEvent(aEventId);
    162161    tracksTabContainer->redisplayEvent(aEventId);
    163162    roomsTabContainer->redisplayEvent(aEventId);
    164163    searchTabContainer->redisplayEvent(aEventId);
    165164}
     165
    166166
    167167void MainWindow::useConference(int id)
  • src/gui/mainwindow.h

    r264f5e7 rdc66a91  
    4949    void on_searchAction_triggered();
    5050
    51     void redisplayEvent(int aEventId, bool aReloadModel);
     51    void onEventChanged(int aEventId, bool favouriteChanged);
    5252    // TODO: remove
    5353    void networkQueryFinished(QNetworkReply*);
  • src/gui/tabcontainer.cpp

    r264f5e7 rdc66a91  
    8787
    8888
    89 void TabContainer::redisplayEvent(int aEventId, bool aReloadModel) {
    90     /* if (aReloadModel) updateTreeView(dayNavigator->curDate());
    91     else */ static_cast<EventModel*>(treeView->model())->updateModel(aEventId);
     89void TabContainer::redisplayEvent(int aEventId) {
     90    static_cast<EventModel*>(treeView->model())->updateModel(aEventId);
    9291}
    9392
  • src/gui/tabcontainer.h

    r264f5e7 rdc66a91  
    4545
    4646public slots:
    47     virtual void redisplayEvent(int aEventId, bool aReloadModel = false);
     47    virtual void redisplayEvent(int aEventId);
    4848    void redisplayDate(const QDate& curDate);
    4949
  • src/mvc/treeview.cpp

    r264f5e7 rdc66a91  
    8080                }
    8181
    82                 // have to emit 'eventHasChanged' signal on all events in conflict
     82                // have to emit 'eventChanged' signal on all events in conflict
    8383                for(int i=0; i<conflicts.count(); i++)
    84                     emit(eventHasChanged(conflicts[i].id()));
     84                    emit eventChanged(conflicts[i].id(), false);
    8585
    8686                // since the Favourite icon has changed, update TreeViews accordingly
    8787                // all TreeViews have to listen on this signal
    88                 emit(eventHasChanged(event.id(),true));
     88                emit eventChanged(event.id(), true);
    8989
    9090                handled = true;
     
    119119                // since the Alarm icon has changed, update TreeView accordingly
    120120                // all TreeViews have to listen on this signal
    121                 emit(eventHasChanged(event.id()));
     121                emit eventChanged(event.id(), false);
    122122                handled = true;
    123123            }
  • src/mvc/treeview.h

    r264f5e7 rdc66a91  
    3838signals:
    3939    void requestForConflicts(const QModelIndex &aIndex);
    40     void eventHasChanged(int aEventId, bool aReloadModel = false); // emited when user changes some event details, eg. sets it Favourite
     40    void eventChanged(int aEventId, bool favouriteChanged); // emited when user changes some event details, eg. sets it Favourite
    4141};
    4242
Note: See TracChangeset for help on using the changeset viewer.