[vlmc-devel] Settings: Avoid silent failure when using an unexisting setting

Hugo Beauzée-Luyssen git at videolan.org
Sat Mar 29 16:19:42 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Mar 29 15:48:46 2014 +0200| [f5f881a61b175c68c328644d1faebcbb225da3f7] | committer: Hugo Beauzée-Luyssen

Settings: Avoid silent failure when using an unexisting setting

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

 src/Settings/Settings.cpp |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/Settings/Settings.cpp b/src/Settings/Settings.cpp
index 91e5cfd..69c5a63 100644
--- a/src/Settings/Settings.cpp
+++ b/src/Settings/Settings.cpp
@@ -128,6 +128,7 @@ Settings::setValue(const QString &key, const QVariant &value)
         (*it)->set( value );
         return true;
     }
+    Q_ASSERT_X( false, __FILE__, "setting value without a created variable" );
     return false;
 }
 
@@ -139,6 +140,7 @@ Settings::value(const QString &key)
     SettingMap::iterator it = m_settings.find( key );
     if ( it != m_settings.end() )
         return *it;
+    Q_ASSERT_X( false, __FILE__, "fetching value without a created variable" );
     return NULL;
 }
 



More information about the Vlmc-devel mailing list