Skip to content
Snippets Groups Projects
Commit 37f33909 authored by Stéphane Albert's avatar Stéphane Albert
Browse files

COMP: #1502 Fixed warning: format ‘%s’ expects argument of type ‘char*’, but...

COMP: #1502 Fixed warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘const QString*’ [-Wformat=].
parent c6fb361c
No related branches found
No related tags found
1 merge request!3Qt4to5
...@@ -256,13 +256,14 @@ I18nCoreApplication ...@@ -256,13 +256,14 @@ I18nCoreApplication
} }
/*****************************************************************************/ /*****************************************************************************/
/*///////////////Warning signature modification for qt5//////////////////////*/
void void
I18nCoreApplication I18nCoreApplication
::HandleQtMessage( QtMsgType type , ::HandleQtMessage( QtMsgType type ,
const QMessageLogContext & , const QMessageLogContext & ,
const QString & message ) const QString & message )
{ {
std::string msg = ToStdString( message );
switch( type ) switch( type )
{ {
// //
...@@ -270,10 +271,10 @@ I18nCoreApplication ...@@ -270,10 +271,10 @@ I18nCoreApplication
case QtDebugMsg: case QtDebugMsg:
#if ECHO_QDEBUG || FORCE_QDEBUG #if ECHO_QDEBUG || FORCE_QDEBUG
#if _WIN32 #if _WIN32
OutputDebugString( message ); OutputDebugString( msg.c_str() );
OutputDebugString( "\n" ); OutputDebugString( "\n" );
#endif #endif
fprintf( stderr, "%s\n", message ); std::cerr << msg << std::endl;
#endif #endif
#if LOG_QDEBUG #if LOG_QDEBUG
assert( false && "Not yet implemented!" ); assert( false && "Not yet implemented!" );
...@@ -285,10 +286,10 @@ I18nCoreApplication ...@@ -285,10 +286,10 @@ I18nCoreApplication
#if ECHO_QWARNING || FORCE_QWARNING #if ECHO_QWARNING || FORCE_QWARNING
#if _WIN32 #if _WIN32
OutputDebugString( "WARNG> " ); OutputDebugString( "WARNG> " );
OutputDebugString( message ); OutputDebugString( msg.c_str() );
OutputDebugString( "\n" ); OutputDebugString( "\n" );
#endif #endif
fprintf( stderr, tr( "WARNG> %s\n" ).toLatin1().constData(), message ); std::cerr << "WARNG> " << msg << std::endl;
#endif #endif
#if LOG_QWARNING #if LOG_QWARNING
assert( false && "Not yet implemented!" ); assert( false && "Not yet implemented!" );
...@@ -303,7 +304,7 @@ I18nCoreApplication ...@@ -303,7 +304,7 @@ I18nCoreApplication
OutputDebugString( message ); OutputDebugString( message );
OutputDebugString( "\n" ); OutputDebugString( "\n" );
#endif #endif
fprintf( stderr, tr( "ERROR> %s\n" ).toLatin1().constData(), message ); std::cerr << "ERROR> " << msg << std::endl;
#endif #endif
#if LOG_QCRITICAL #if LOG_QCRITICAL
assert( false && "Not yet implemented!" ); assert( false && "Not yet implemented!" );
...@@ -326,11 +327,7 @@ I18nCoreApplication ...@@ -326,11 +327,7 @@ I18nCoreApplication
OutputDebugString( message ); OutputDebugString( message );
OutputDebugString( "\n" ); OutputDebugString( "\n" );
#endif #endif
fprintf( std::cerr << "FATAL> " << msg << std::endl;
stderr,
tr( "FATAL> %s\n" ).toLatin1().constData(),
message
);
#endif #endif
#if LOG_QFATAL #if LOG_QFATAL
assert( false && "Not yet implemented!" ); assert( false && "Not yet implemented!" );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment