From 31ac09de874807edc44d24a845ccbcf2d530098d Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 11 Dec 2016 17:13:19 +0100 Subject: [PATCH] Add prefix to PLATFORM_SPECIFIC_CAPSLOCK_DETECTION macro --- CMakeLists.txt | 4 ++-- enterpassworddialog/enterpassworddialog.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 925cafb..00003dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,13 +123,13 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" "${CMAKE_MODUL # configure platform specific capslock detection if(WIN32) # WinAPI provides functions required for capslock detection - list(APPEND META_PRIVATE_COMPILE_DEFINITIONS PLATFORM_SPECIFIC_CAPSLOCK_DETECTION) + list(APPEND META_PRIVATE_COMPILE_DEFINITIONS QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION) else() # X11 can provide functions required for capslock detection under non-Windows environments find_package(X11) if(X11_FOUND) list(APPEND LIBRARIES ${X11_LIBRARIES}) - list(APPEND META_PRIVATE_COMPILE_DEFINITIONS PLATFORM_SPECIFIC_CAPSLOCK_DETECTION) + list(APPEND META_PRIVATE_COMPILE_DEFINITIONS QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION) endif() endif() diff --git a/enterpassworddialog/enterpassworddialog.cpp b/enterpassworddialog/enterpassworddialog.cpp index 45422e7..1688523 100644 --- a/enterpassworddialog/enterpassworddialog.cpp +++ b/enterpassworddialog/enterpassworddialog.cpp @@ -9,7 +9,7 @@ #include #include -#ifdef PLATFORM_SPECIFIC_CAPSLOCK_DETECTION +#ifdef QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION # if defined(Q_OS_WIN32) # include # elif defined(X_AVAILABLE) @@ -49,7 +49,7 @@ EnterPasswordDialog::EnterPasswordDialog(QWidget *parent) : m_ui->password1LineEdit->installEventFilter(this); m_ui->password2LineEdit->installEventFilter(this); // capslock key detection -#ifdef PLATFORM_SPECIFIC_CAPSLOCK_DETECTION +#ifdef QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION m_capslockPressed = isCapslockPressed(); #else m_capslockPressed = false; @@ -302,14 +302,14 @@ void EnterPasswordDialog::confirm() * * \remarks - Returns always false for unsupported platforms. * - This method always returns false when not built with - * PLATFORM_SPECIFIC_CAPSLOCK_DETECTION defined. + * QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION defined. * - This static function will be used internally to detect whether the capslock key is pressed * when initializing the dialog if available. * - The function requires the application to be linked against X11 on Linux/Unix. */ bool EnterPasswordDialog::isCapslockPressed() { -#ifdef PLATFORM_SPECIFIC_CAPSLOCK_DETECTION +#ifdef QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION // platform dependent method of determining if CAPS LOCK is pressed # if defined(Q_OS_WIN32) return GetKeyState(VK_CAPITAL) == 1;