1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-19 15:31:59 +02:00

* Fixed opening logfile with local8bit.

This commit is contained in:
Christian Muehlhaeuser 2014-09-18 09:05:48 +02:00
parent f4c05165dc
commit 684c1da4fe

View File

@ -174,28 +174,28 @@ logFile()
void
setupLogfile()
{
if ( QFileInfo( logFile().toLocal8Bit() ).size() > LOGFILE_SIZE )
if ( QFileInfo( logFile() ).size() > LOGFILE_SIZE )
{
QByteArray lc;
{
QFile f( logFile().toLocal8Bit() );
QFile f( logFile() );
f.open( QIODevice::ReadOnly | QIODevice::Text );
f.seek( f.size() - ( LOGFILE_SIZE - ( LOGFILE_SIZE / 4 ) ) );
lc = f.readAll();
f.close();
}
QFile::remove( logFile().toLocal8Bit() );
QFile::remove( logFile() );
{
QFile f( logFile().toLocal8Bit() );
QFile f( logFile() );
f.open( QIODevice::WriteOnly | QIODevice::Text );
f.write( lc );
f.close();
}
}
logfile.open( logFile().toLocal8Bit(), ios::app );
logfile.open( logFile().toUtf8().constData(), ios::app );
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
qInstallMessageHandler( TomahawkLogHandler );
#else