1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-22 13:43:11 +02:00

Don't crash if we could not add a font.

This commit is contained in:
Uwe L. Korn
2014-05-05 11:40:49 +01:00
parent 90556ffb1a
commit 6ba2a9c639

View File

@@ -213,8 +213,15 @@ TomahawkStyle::loadFonts()
QDir dir( ":/data/fonts" ); QDir dir( ":/data/fonts" );
foreach ( const QString& fileName, dir.entryList() ) foreach ( const QString& fileName, dir.entryList() )
{ {
tDebug() << "Trying to add font resource:" << fileName; tDebug( LOGVERBOSE ) << "Trying to add font resource:" << fileName;
const int id = QFontDatabase::addApplicationFont( ":/data/fonts/" + fileName ); const int id = QFontDatabase::addApplicationFont( ":/data/fonts/" + fileName );
tDebug() << "Added font:" << id << QFontDatabase::applicationFontFamilies( id ).first(); if ( id >= 0 )
{
tDebug( LOGVERBOSE ) << "Added font:" << id << QFontDatabase::applicationFontFamilies( id ).first();
}
else
{
tDebug() << "Could not add font resource:" << fileName;
}
} }
} }