From ba1ca4ec080b9270e3fb40b1610ad7958753d302 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Thu, 23 Jul 2015 00:11:05 +0200 Subject: [PATCH] Rename x11 auto-type plugin to xcb. This matches what QGuiApplication::platformName() returns. --- src/autotype/AutoType.cpp | 2 +- src/autotype/CMakeLists.txt | 2 +- .../AutoTypeX11.cpp => xcb/AutoTypeXCB.cpp} | 2 +- .../{x11/AutoTypeX11.h => xcb/AutoTypeXCB.h} | 6 ++--- src/autotype/{x11 => xcb}/CMakeLists.txt | 10 ++++----- src/autotype/{x11 => xcb}/KeySymMap.h | 0 src/autotype/{x11 => xcb}/keysymmap.py | 0 src/core/Tools.cpp | 22 +------------------ src/core/Tools.h | 1 - 9 files changed, 12 insertions(+), 33 deletions(-) rename src/autotype/{x11/AutoTypeX11.cpp => xcb/AutoTypeXCB.cpp} (99%) rename src/autotype/{x11/AutoTypeX11.h => xcb/AutoTypeXCB.h} (97%) rename src/autotype/{x11 => xcb}/CMakeLists.txt (53%) rename src/autotype/{x11 => xcb}/KeySymMap.h (100%) rename src/autotype/{x11 => xcb}/keysymmap.py (100%) diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index ce68ae471..92349dc58 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -49,7 +49,7 @@ AutoType::AutoType(QObject* parent, bool test) QString pluginName = "keepassx-autotype-"; if (!test) { - pluginName += Tools::platform(); + pluginName += QApplication::platformName(); } else { pluginName += "test"; diff --git a/src/autotype/CMakeLists.txt b/src/autotype/CMakeLists.txt index 044bf90ba..a129961e2 100644 --- a/src/autotype/CMakeLists.txt +++ b/src/autotype/CMakeLists.txt @@ -6,7 +6,7 @@ if(UNIX AND NOT APPLE) add_feature_info(Qt5X11Extras Qt5X11Extras_FOUND "The Qt5X11Extras library is required for auto-type") if(X11_FOUND AND X11_XTest_FOUND AND Qt5X11Extras_FOUND) - add_subdirectory(x11) + add_subdirectory(xcb) endif() endif() diff --git a/src/autotype/x11/AutoTypeX11.cpp b/src/autotype/xcb/AutoTypeXCB.cpp similarity index 99% rename from src/autotype/x11/AutoTypeX11.cpp rename to src/autotype/xcb/AutoTypeXCB.cpp index 71316e772..22bd81f9d 100644 --- a/src/autotype/x11/AutoTypeX11.cpp +++ b/src/autotype/xcb/AutoTypeXCB.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -#include "AutoTypeX11.h" +#include "AutoTypeXCB.h" #include "KeySymMap.h" #include diff --git a/src/autotype/x11/AutoTypeX11.h b/src/autotype/xcb/AutoTypeXCB.h similarity index 97% rename from src/autotype/x11/AutoTypeX11.h rename to src/autotype/xcb/AutoTypeXCB.h index 424749c10..973c40a55 100644 --- a/src/autotype/x11/AutoTypeX11.h +++ b/src/autotype/xcb/AutoTypeXCB.h @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -#ifndef KEEPASSX_AUTOTYPEX11_H -#define KEEPASSX_AUTOTYPEX11_H +#ifndef KEEPASSX_AUTOTYPEXCB_H +#define KEEPASSX_AUTOTYPEXCB_H #include #include @@ -128,4 +128,4 @@ private: AutoTypePlatformX11* const m_platform; }; -#endif // KEEPASSX_AUTOTYPEX11_H +#endif // KEEPASSX_AUTOTYPEXCB_H diff --git a/src/autotype/x11/CMakeLists.txt b/src/autotype/xcb/CMakeLists.txt similarity index 53% rename from src/autotype/x11/CMakeLists.txt rename to src/autotype/xcb/CMakeLists.txt index cff19167e..3b56b3119 100644 --- a/src/autotype/x11/CMakeLists.txt +++ b/src/autotype/xcb/CMakeLists.txt @@ -1,11 +1,11 @@ include_directories(SYSTEM ${X11_X11_INCLUDE_PATH}) -set(autotype_X11_SOURCES - AutoTypeX11.cpp +set(autotype_XCB_SOURCES + AutoTypeXCB.cpp ) -add_library(keepassx-autotype-x11 MODULE ${autotype_X11_SOURCES}) -target_link_libraries(keepassx-autotype-x11 Qt5::Core Qt5::Widgets Qt5::X11Extras ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_XTest_LIB}) -install(TARGETS keepassx-autotype-x11 +add_library(keepassx-autotype-xcb MODULE ${autotype_XCB_SOURCES}) +target_link_libraries(keepassx-autotype-xcb Qt5::Core Qt5::Widgets Qt5::X11Extras ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_XTest_LIB}) +install(TARGETS keepassx-autotype-xcb BUNDLE DESTINATION . COMPONENT Runtime LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime) diff --git a/src/autotype/x11/KeySymMap.h b/src/autotype/xcb/KeySymMap.h similarity index 100% rename from src/autotype/x11/KeySymMap.h rename to src/autotype/xcb/KeySymMap.h diff --git a/src/autotype/x11/keysymmap.py b/src/autotype/xcb/keysymmap.py similarity index 100% rename from src/autotype/x11/keysymmap.py rename to src/autotype/xcb/keysymmap.py diff --git a/src/core/Tools.cpp b/src/core/Tools.cpp index 3d5ee997f..009d226cd 100644 --- a/src/core/Tools.cpp +++ b/src/core/Tools.cpp @@ -17,7 +17,7 @@ #include "Tools.h" -#include +#include #include #include #include @@ -192,26 +192,6 @@ void wait(int ms) } } -QString platform() -{ - // TODO: move callers to QApplication::platformName() - - QString platform = QApplication::platformName(); - - if (platform == "xcb") { - return "x11"; - } - else if (platform == "cocoa") { - return "mac"; - } - else if (platform == "windows") { - return "win"; - } - else { - return platform; - } -} - void disableCoreDumps() { // default to true diff --git a/src/core/Tools.h b/src/core/Tools.h index 51d6e5adb..07341da02 100644 --- a/src/core/Tools.h +++ b/src/core/Tools.h @@ -36,7 +36,6 @@ QString imageReaderFilter(); bool isHex(const QByteArray& ba); void sleep(int ms); void wait(int ms); -QString platform(); void disableCoreDumps(); } // namespace Tools