mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 03:36:36 +00:00
LibKeyboard: Don't assert on failure
This commit is contained in:
parent
d9e7e13fb2
commit
0e3408d4d6
Notes:
sideshowbarker
2024-07-18 22:40:18 +09:00
Author: https://github.com/BenWiederhake
Commit: 0e3408d4d6
Pull-request: https://github.com/SerenityOS/serenity/pull/5192
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bcoles
Reviewed-by: https://github.com/emanuele6
Reviewed-by: https://github.com/linusg
4 changed files with 21 additions and 16 deletions
|
@ -65,10 +65,17 @@ int main(int argc, char** argv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
Keyboard::CharacterMap character_map(path);
|
||||
int rc = character_map.set_system_map();
|
||||
if (rc != 0)
|
||||
auto character_map = Keyboard::CharacterMap::load_from_file(path);
|
||||
if (!character_map.has_value()) {
|
||||
warnln("Cannot read keymap {}", path);
|
||||
warnln("Hint: Must be either a keymap name (e.g. 'en') or a full path.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int rc = character_map.value().set_system_map();
|
||||
if (rc != 0) {
|
||||
perror("setkeymap");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue