diff --git a/src/core/Config.cpp b/src/core/Config.cpp index 819b64e69..3cb763408 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -71,7 +71,7 @@ Config::Config(QObject* parent) userPath += "/keepassx/"; #else userPath = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); - userPath += "/keepassx/"; + // storageLocation() appends the application name ("/keepassx/") to the end #endif userPath += "keepassx2.ini"; diff --git a/src/main.cpp b/src/main.cpp index c00e8f7ad..abe7ceb4e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,7 @@ #include +#include "config-keepassx.h" #include "core/Config.h" #include "core/qcommandlineparser.h" #include "core/Tools.h" @@ -31,8 +32,10 @@ int main(int argc, char** argv) #endif Application app(argc, argv); - // don't set applicationName or organizationName as that changes - // QDesktopServices::storageLocation() + Application::setApplicationName("keepassx"); + Application::setApplicationVersion(KEEPASSX_VERSION); + // don't set organizationName as that changes the return value of + // QDesktopServices::storageLocation(QDesktopServices::DataLocation) Crypto::init(); @@ -51,6 +54,7 @@ int main(int argc, char** argv) "keyfile"); parser.addHelpOption(); + parser.addVersionOption(); parser.addOption(configOption); parser.addOption(passwordOption); parser.addOption(keyfileOption);