Rename x11 auto-type plugin to xcb.

This matches what QGuiApplication::platformName() returns.
This commit is contained in:
Felix Geyer 2015-07-23 00:11:05 +02:00
parent 20b13a4a2e
commit ba1ca4ec08
9 changed files with 12 additions and 33 deletions

View File

@ -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";

View File

@ -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()

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AutoTypeX11.h"
#include "AutoTypeXCB.h"
#include "KeySymMap.h"
#include <time.h>

View File

@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEEPASSX_AUTOTYPEX11_H
#define KEEPASSX_AUTOTYPEX11_H
#ifndef KEEPASSX_AUTOTYPEXCB_H
#define KEEPASSX_AUTOTYPEXCB_H
#include <QApplication>
#include <QSet>
@ -128,4 +128,4 @@ private:
AutoTypePlatformX11* const m_platform;
};
#endif // KEEPASSX_AUTOTYPEX11_H
#endif // KEEPASSX_AUTOTYPEXCB_H

View File

@ -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)

View File

@ -17,7 +17,7 @@
#include "Tools.h"
#include <QApplication>
#include <QCoreApplication>
#include <QImageReader>
#include <QIODevice>
#include <QLocale>
@ -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

View File

@ -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