some performance optimizations
[toast/confclerk.git] / src / gui / nowtabcontainer.cpp
1
2 #include <QTimer>
3 #include "nowtabcontainer.h"
4
5 NowTabContainer::NowTabContainer( QWidget *aParent ) : TabContainer( aParent )
6 {
7     QTimer *timer = new QTimer( this );
8     connect( timer, SIGNAL(timeout()), SLOT(timerUpdateTreeView()) );
9     timer->start( 30000); // 30 seconds timer
10 }
11
12 void NowTabContainer::loadEvents( const QDate &aDate, const int aConferenceId )
13 {
14     Q_UNUSED( aDate );
15
16     static_cast<EventModel*>(treeView->model())->loadNowEvents( aConferenceId );
17     dayNavigator->hide();
18 }
19
20 void NowTabContainer::timerUpdateTreeView()
21 {
22     updateTreeView( QDate() );
23 }
24
25 void NowTabContainer::updateTreeView(const QDate &aDate)
26 {
27     TabContainer::updateTreeView(aDate);
28     treeView->setAllExpanded(true);
29 }
30