1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 14:46:33 +02:00

Add more ASSERTs to track correct JSON generation

This commit is contained in:
Uwe L. Korn
2014-05-05 12:40:39 +01:00
parent 537dd17b08
commit 101c89d97a

View File

@@ -159,7 +159,9 @@ ScriptResolver::sendConfig()
hosts << host; hosts << host;
m.insert( "noproxyhosts", hosts ); m.insert( "noproxyhosts", hosts );
QByteArray data = TomahawkUtils::toJson( m ); bool ok;
QByteArray data = TomahawkUtils::toJson( m, &ok );
Q_ASSERT( ok );
sendMsg( data ); sendMsg( data );
} }
@@ -181,7 +183,9 @@ ScriptResolver::running() const
void void
ScriptResolver::sendMessage( const QVariantMap& map ) ScriptResolver::sendMessage( const QVariantMap& map )
{ {
QByteArray data = TomahawkUtils::toJson( map ); bool ok;
QByteArray data = TomahawkUtils::toJson( map, &ok );
Q_ASSERT( ok );
sendMsg( data ); sendMsg( data );
} }
@@ -528,7 +532,9 @@ ScriptResolver::saveConfig()
m.insert( "_msgtype", "setpref" ); m.insert( "_msgtype", "setpref" );
QVariant widgets = configMsgFromWidget( m_configWidget.data() ); QVariant widgets = configMsgFromWidget( m_configWidget.data() );
m.insert( "widgets", widgets ); m.insert( "widgets", widgets );
QByteArray data = TomahawkUtils::toJson( m ); bool ok;
QByteArray data = TomahawkUtils::toJson( m, &ok );
Q_ASSERT( ok );
sendMsg( data ); sendMsg( data );
} }