Commit 02651e28 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: epg: don't hide EPG when there's still data.

parent 002da356
...@@ -104,6 +104,11 @@ const QDateTime& EPGView::baseTime() ...@@ -104,6 +104,11 @@ const QDateTime& EPGView::baseTime()
return m_baseTime; return m_baseTime;
} }
bool EPGView::hasValidData()
{
return !epgitemsByChannel.empty();
}
static void cleanOverlapped( EPGEventByTimeQMap *epgItemByTime, EPGItem *epgItem, QGraphicsScene *scene ) static void cleanOverlapped( EPGEventByTimeQMap *epgItemByTime, EPGItem *epgItem, QGraphicsScene *scene )
{ {
/* Clean overlapped programs */ /* Clean overlapped programs */
......
...@@ -66,6 +66,7 @@ public: ...@@ -66,6 +66,7 @@ public:
void updateDuration(); void updateDuration();
void reset(); void reset();
void cleanup(); void cleanup();
bool hasValidData();
signals: signals:
void startTimeChanged( const QDateTime& startTime ); void startTimeChanged( const QDateTime& startTime );
......
...@@ -102,7 +102,6 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type ) ...@@ -102,7 +102,6 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
b_input_type_known = true; b_input_type_known = true;
m_epgView->cleanup(); /* expire items and flags */ m_epgView->cleanup(); /* expire items and flags */
rootWidget->setCurrentIndex( ( i_epg > 0 ) ? 0 : 1 );
for ( int i = 0; i < i_epg; ++i ) for ( int i = 0; i < i_epg; ++i )
{ {
...@@ -117,6 +116,9 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type ) ...@@ -117,6 +116,9 @@ void EPGWidget::updateEPG( vlc_epg_t **pp_epg, int i_epg, uint8_t i_input_type )
} }
} }
/* toggle our widget view */
rootWidget->setCurrentIndex( m_epgView->hasValidData() ? 0 : 1 );
// Update the global duration and start time. // Update the global duration and start time.
m_epgView->updateDuration(); m_epgView->updateDuration();
m_epgView->updateStartTime(); m_epgView->updateStartTime();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment