Set the application name and version in QApplication.

This commit is contained in:
Felix Geyer 2014-01-18 15:31:24 +01:00
parent c2781274a0
commit 678c4a8ece
2 changed files with 7 additions and 3 deletions

View File

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

View File

@ -17,6 +17,7 @@
#include <QFile>
#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);