Merge pull request #86 from xiaoyifang/fix/clean-useless-file

remove uselesscode
This commit is contained in:
xiaoyifang 2022-06-02 21:11:36 +08:00 committed by GitHub
commit 86ca8f3e75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,61 +4,30 @@
#include <QString>
#include "gddebug.hh"
#include <QDebug>
#if(QT_VERSION >= QT_VERSION_CHECK(6,0,0))
#if( QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) )
#include <QtCore5Compat/QTextCodec>
#else
#include <QTextCodec>
#endif
QFile * logFilePtr;
static QTextCodec * utf8Codec;
void gdWarning(const char *msg, ...)
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 );
}
va_list ap;
va_start( ap, msg );
qWarning() << QString().vasprintf( msg, ap );
if( logFilePtr && logFilePtr->isOpen() )
{
QTextCodec::setCodecForLocale( localeCodec );
}
va_end(ap);
va_end( ap );
}
void gdDebug(const char *msg, ...)
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 );
// }
va_list ap;
va_start( ap, msg );
qDebug().noquote() << QString().vasprintf( msg, ap );
// if( logFilePtr && logFilePtr->isOpen() )
// {
// QTextCodec::setCodecForLocale( localeCodec );
// }
va_end(ap);
va_end( ap );
}