[vlmc-devel] Settings: Don't assume toString will always return a valid value

Hugo Beauzée-Luyssen git at videolan.org
Sun Mar 30 17:48:41 CEST 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Mar 30 18:46:54 2014 +0300| [182368a55a787e53a1338e447834856f31ed0223] | committer: Hugo Beauzée-Luyssen

Settings: Don't assume toString will always return a valid value

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

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

diff --git a/src/Settings/Settings.cpp b/src/Settings/Settings.cpp
index dcf153e..aed88fc 100644
--- a/src/Settings/Settings.cpp
+++ b/src/Settings/Settings.cpp
@@ -95,6 +95,8 @@ Settings::save( QXmlStreamWriter& project ) const
             continue ;
         project.writeStartElement( "setting" );
         project.writeAttribute( "key", (*it)->key() );
+        if ( (*it)->get().canConvert<QString>() == false )
+            vlmcWarning() << "Can't serialize" << (*it)->key();
         project.writeAttribute( "value", (*it)->get().toString() );
         project.writeEndElement();
     }



More information about the Vlmc-devel mailing list