[vlc-commits] Qt: check colorDialog return function
Jean-Baptiste Kempf
git at videolan.org
Sat Dec 17 04:10:25 CET 2011
vlc/vlc-1.2 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Dec 17 03:59:00 2011 +0100| [83a5c06365b90b9085117a364d43b3a97590d43a] | committer: Jean-Baptiste Kempf
Qt: check colorDialog return function
Close #5679
(cherry picked from commit bb12c0023452e86a26e407d6e728d961e4544f5e)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=83a5c06365b90b9085117a364d43b3a97590d43a
---
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