mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
* Fixed opening logfile with local8bit.
This commit is contained in:
@@ -174,28 +174,28 @@ logFile()
|
|||||||
void
|
void
|
||||||
setupLogfile()
|
setupLogfile()
|
||||||
{
|
{
|
||||||
if ( QFileInfo( logFile().toLocal8Bit() ).size() > LOGFILE_SIZE )
|
if ( QFileInfo( logFile() ).size() > LOGFILE_SIZE )
|
||||||
{
|
{
|
||||||
QByteArray lc;
|
QByteArray lc;
|
||||||
{
|
{
|
||||||
QFile f( logFile().toLocal8Bit() );
|
QFile f( logFile() );
|
||||||
f.open( QIODevice::ReadOnly | QIODevice::Text );
|
f.open( QIODevice::ReadOnly | QIODevice::Text );
|
||||||
f.seek( f.size() - ( LOGFILE_SIZE - ( LOGFILE_SIZE / 4 ) ) );
|
f.seek( f.size() - ( LOGFILE_SIZE - ( LOGFILE_SIZE / 4 ) ) );
|
||||||
lc = f.readAll();
|
lc = f.readAll();
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile::remove( logFile().toLocal8Bit() );
|
QFile::remove( logFile() );
|
||||||
|
|
||||||
{
|
{
|
||||||
QFile f( logFile().toLocal8Bit() );
|
QFile f( logFile() );
|
||||||
f.open( QIODevice::WriteOnly | QIODevice::Text );
|
f.open( QIODevice::WriteOnly | QIODevice::Text );
|
||||||
f.write( lc );
|
f.write( lc );
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logfile.open( logFile().toLocal8Bit(), ios::app );
|
logfile.open( logFile().toUtf8().constData(), ios::app );
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||||
qInstallMessageHandler( TomahawkLogHandler );
|
qInstallMessageHandler( TomahawkLogHandler );
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user