[vlc-commits] Qt: check colorDialog return function

Jean-Baptiste Kempf git at videolan.org
Sat Dec 17 04:00:02 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Dec 17 03:59:00 2011 +0100| [bb12c0023452e86a26e407d6e728d961e4544f5e] | committer: Jean-Baptiste Kempf

Qt: check colorDialog return function

Close #5679

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

 modules/gui/qt4/components/preferences_widgets.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 1db7a9a..bc8cb61 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -1175,10 +1175,13 @@ int ColorConfigControl::getValue() const
 void ColorConfigControl::selectColor()
 {
     QColor color = QColorDialog::getColor( QColor( i_color ) );
-    i_color = (color.red() << 16) + (color.green() << 8) + color.blue();
+    if( color.isValid() )
+    {
+        i_color = (color.red() << 16) + (color.green() << 8) + color.blue();
 
-    color_px->fill( QColor( i_color ) );
-    color_but->setIcon( QIcon( *color_px ) );
+        color_px->fill( QColor( i_color ) );
+        color_but->setIcon( QIcon( *color_px ) );
+    }
 }
 
 



More information about the vlc-commits mailing list