[vlmc-devel] commit: StringWidget: Check for emptiness if NotEmpty flag is specified. ( =?UTF-8?Q?Hugo=20Beauz=C3=A9e=2DLuyssen?==?UTF-8?Q?=20?=)
git at videolan.org
git at videolan.org
Sun Dec 5 21:29:14 CET 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Dec 5 21:16:34 2010 +0100| [34b0d0bcede4694f2e5e854ab3d2bc396cea470d] | committer: Hugo Beauzée-Luyssen
StringWidget: Check for emptiness if NotEmpty flag is specified.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=34b0d0bcede4694f2e5e854ab3d2bc396cea470d
---
src/Gui/settings/StringWidget.cpp | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/Gui/settings/StringWidget.cpp b/src/Gui/settings/StringWidget.cpp
index 5716e8c..53ea748 100644
--- a/src/Gui/settings/StringWidget.cpp
+++ b/src/Gui/settings/StringWidget.cpp
@@ -38,6 +38,11 @@ StringWidget::StringWidget( SettingValue *s, QWidget *parent /*= NULL*/ ) :
bool
StringWidget::save()
{
+ if ( ( m_setting->flags() & SettingValue::NotEmpty ) != 0 )
+ {
+ if ( m_lineEdit->text().length() == 0 )
+ return false;
+ }
m_setting->set( m_lineEdit->text() );
return true;
}
More information about the Vlmc-devel
mailing list