[keyboard] Warn if QRC is not available

This commit is contained in:
Adriaan de Groot 2020-09-09 11:47:50 +02:00
parent 0d8e0d9b96
commit 2aece7ff1b

View File

@ -82,13 +82,18 @@ SetKeyboardLayoutJob::findConvertedKeymap( const QString& convertedKeymapPath )
STATICTEST QString STATICTEST QString
findLegacyKeymap( const QString& layout, const QString& model, const QString& variant ) findLegacyKeymap( const QString& layout, const QString& model, const QString& variant )
{ {
cDebug() << "Looking for legacy keymap in QRC"; cDebug() << "Looking for legacy keymap" << layout << model << variant << "in QRC";
int bestMatching = 0; int bestMatching = 0;
QString name; QString name;
QFile file( ":/kbd-model-map" ); QFile file( ":/kbd-model-map" );
file.open( QIODevice::ReadOnly | QIODevice::Text ); if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
cDebug() << Logger::SubEntry << "Could not read QRC";
return QString();
}
QTextStream stream( &file ); QTextStream stream( &file );
while ( !stream.atEnd() ) while ( !stream.atEnd() )
{ {