Skip to content

Commit

Permalink
Merge pull request #1248 from deXol/develop
Browse files Browse the repository at this point in the history
Fix build issue for Keyboard Layout Detector <6.0 Qt version
  • Loading branch information
limpkin authored Dec 9, 2024
2 parents 5c2cf87 + 94990a2 commit 3311b88
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils/KeyboardLayoutDetectorUnix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,18 @@ QString KeyboardLayoutDetectorUnix::getKeyboardLayout()
if (!out.isEmpty())
{
const RegExp rx(RESULT_REGEXP);
#if QT_VERSION < 0x060000
if (rx.indexIn(out) != -1)
{
return rx.cap(1);
}
#else
auto match = rx.match(out);
if (match.hasMatch())
{
return match.captured(1);
}
#endif
}

qWarning() << "Keyboard layout was not fetched successfully";
Expand Down

0 comments on commit 3311b88

Please sign in to comment.