]> git.sesse.net Git - vlc/commitdiff
Qt/EPG: Try to display intelligently the short and long event description with the...
authorAdrien Maglo <magsoft@videolan.org>
Wed, 28 Jul 2010 18:25:16 +0000 (20:25 +0200)
committerAdrien Maglo <magsoft@videolan.org>
Wed, 28 Jul 2010 18:25:34 +0000 (20:25 +0200)
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

index 6f45929d4a377bf9161368bc073fa5c52ade7e58..01143a7e385d347e3a2c5b3d87cbdcf8761ad064 100644 (file)
@@ -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()