From 2aece7ff1b372382b7e7f48052d7455c9a5a0cb4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 9 Sep 2020 11:47:50 +0200 Subject: [PATCH] [keyboard] Warn if QRC is not available --- src/modules/keyboard/SetKeyboardLayoutJob.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/keyboard/SetKeyboardLayoutJob.cpp b/src/modules/keyboard/SetKeyboardLayoutJob.cpp index a36604926..cabe0b5c0 100644 --- a/src/modules/keyboard/SetKeyboardLayoutJob.cpp +++ b/src/modules/keyboard/SetKeyboardLayoutJob.cpp @@ -82,13 +82,18 @@ SetKeyboardLayoutJob::findConvertedKeymap( const QString& convertedKeymapPath ) STATICTEST QString 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; QString name; 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 ); while ( !stream.atEnd() ) {