From bd936d6030acafcd383c5b4f5ec1e4fdfb051d00 Mon Sep 17 00:00:00 2001 From: Mathias Hasselmann Date: Tue, 9 Aug 2016 12:51:30 +0200 Subject: [PATCH 1/2] Build fixes for disabled implicit string casts --- gnomekeyring.cpp | 2 +- keychain_unix.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gnomekeyring.cpp b/gnomekeyring.cpp index bf4741b..dd35670 100644 --- a/gnomekeyring.cpp +++ b/gnomekeyring.cpp @@ -63,7 +63,7 @@ GnomeKeyring::gpointer GnomeKeyring::delete_network_password( const gchar* user, } GnomeKeyring::GnomeKeyring() - : QLibrary("gnome-keyring", 0) + : QLibrary(QLatin1String("gnome-keyring"), 0) { static const PasswordSchema schema = { ITEM_NETWORK_PASSWORD, diff --git a/keychain_unix.cpp b/keychain_unix.cpp index ae926e8..a364a7c 100644 --- a/keychain_unix.cpp +++ b/keychain_unix.cpp @@ -44,7 +44,7 @@ enum DesktopEnvironment { // licensed under BSD, see base/nix/xdg_util.cc static DesktopEnvironment getKdeVersion() { - QString value = qgetenv("KDE_SESSION_VERSION"); + QByteArray value = qgetenv("KDE_SESSION_VERSION"); if ( value == "5" ) { return DesktopEnv_Plasma5; } else if (value == "4" ) { @@ -371,11 +371,11 @@ void WritePasswordJobPrivate::scheduledStart() { switch(mode) { case JobPrivate::Text: - type = "plaintext"; + type = QLatin1String("plaintext"); password = data; break; default: - type = "base64"; + type = QLatin1String("base64"); password = data.toBase64(); break; } From ddc4b8e7c6561515cce2d452084334a94227802a Mon Sep 17 00:00:00 2001 From: Mathias Hasselmann Date: Tue, 9 Aug 2016 12:52:05 +0200 Subject: [PATCH 2/2] Add missing Q_OBJECT macro Clazy complains about this. --- CMakeLists.txt | 2 +- gnomekeyring_p.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1c5fb5..4bd5c0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ if(UNIX AND NOT APPLE) list(APPEND qtkeychain_LIBRARIES ${QTDBUS_LIBRARIES} ) endif() -QT_WRAP_CPP(qtkeychain_MOC_OUTFILES keychain.h keychain_p.h) +QT_WRAP_CPP(qtkeychain_MOC_OUTFILES keychain.h keychain_p.h gnomekeyring_p.h) set(qtkeychain_TR_FILES translations/qtkeychain_de.ts diff --git a/gnomekeyring_p.h b/gnomekeyring_p.h index 3f6869b..87c062c 100644 --- a/gnomekeyring_p.h +++ b/gnomekeyring_p.h @@ -4,6 +4,8 @@ #include class GnomeKeyring : private QLibrary { + Q_OBJECT + public: enum Result { RESULT_OK,