From ec1859e9991185b43b3b05815654e8326dd6728c Mon Sep 17 00:00:00 2001 From: Adrien Maglo Date: Wed, 28 Jul 2010 20:25:16 +0200 Subject: [PATCH] Qt/EPG: Try to display intelligently the short and long event description with the dedicated widgets. It depends of the channels. Some use only the short one, others only the long one and others both. --- modules/gui/qt4/dialogs/epg.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp index 6f45929d4a..01143a7e38 100644 --- a/modules/gui/qt4/dialogs/epg.cpp +++ b/modules/gui/qt4/dialogs/epg.cpp @@ -94,14 +94,22 @@ void EpgDialog::showEvent( EPGEvent *event ) { if( !event ) return; + QString titleDescription, textDescription; + if( event->description.isEmpty() ) + textDescription = event->shortDescription; + else + { + textDescription = event->description; + if( !event->shortDescription.isEmpty() ) + titleDescription = " - " + event->shortDescription; + } + QDateTime end = event->start.addSecs( event->duration ); title->setText( event->start.toString( "hh:mm" ) + " - " + end.toString( "hh:mm" ) + " : " - + event->name - + ( event->shortDescription.isEmpty() - ? "" : " - " + event->shortDescription ) ); + + event->name + titleDescription ); - description->setText( event->description ); + description->setText( textDescription ); } void EpgDialog::updateInfos() -- 2.11.4.GIT