[vlc-commits] commit: Qt/EPG: Try to display intelligently the short and long event description with the dedicated widgets . (Adrien Maglo )

git at videolan.org git at videolan.org
Wed Jul 28 20:25:51 CEST 2010


vlc | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed Jul 28 20:25:16 2010 +0200| [ec1859e9991185b43b3b05815654e8326dd6728c] | committer: Adrien Maglo 

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ec1859e9991185b43b3b05815654e8326dd6728c
---

 modules/gui/qt4/dialogs/epg.cpp |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index 6f45929..01143a7 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()



More information about the vlc-commits mailing list