remove uselesscode

the gdDebug gdWarning method,  set the QTextCodec, does not seem to take effect
This commit is contained in:
Xiao YiFang 2022-06-02 20:38:55 +08:00
parent 3262fe4fe4
commit 5fdfaa5aec

View file

@ -11,30 +11,14 @@
#endif
QFile * logFilePtr;
static QTextCodec * utf8Codec;
void gdWarning( const char * msg, ... )
{
va_list ap;
va_start( ap, msg );
QTextCodec *localeCodec = 0;
if( logFilePtr && logFilePtr->isOpen() )
{
if( utf8Codec == 0 )
utf8Codec = QTextCodec::codecForName( "UTF8" );
localeCodec = QTextCodec::codecForLocale();
QTextCodec::setCodecForLocale( utf8Codec );
}
qWarning() << QString().vasprintf( msg, ap );
if( logFilePtr && logFilePtr->isOpen() )
{
QTextCodec::setCodecForLocale( localeCodec );
}
va_end( ap );
}
@ -42,23 +26,8 @@ void gdDebug(const char *msg, ...)
{
va_list ap;
va_start( ap, msg );
// QTextCodec *localeCodec = 0;
// if( logFilePtr && logFilePtr->isOpen() )
// {
// if( utf8Codec == 0 )
// utf8Codec = QTextCodec::codecForName( "UTF8" );
// localeCodec = QTextCodec::codecForLocale();
// QTextCodec::setCodecForLocale( utf8Codec );
// }
qDebug().noquote() << QString().vasprintf( msg, ap );
// if( logFilePtr && logFilePtr->isOpen() )
// {
// QTextCodec::setCodecForLocale( localeCodec );
// }
va_end( ap );
}