From e555631b40972b0264962f5bbd780ddd3aef5a7c Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Mon, 8 Feb 2016 10:58:01 +0300 Subject: wallet directrory in "Documents" for Windows and in "home" for *nix --- main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index ecc8b626..af429df3 100644 --- a/main.cpp +++ b/main.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "clipboardAdapter.h" #include "filter.h" #include "oscursor.h" @@ -46,6 +47,20 @@ int main(int argc, char *argv[]) OSCursor cursor; engine.rootContext()->setContextProperty("globalCursor", &cursor); +// export to QML monero accounts root directory +// wizard is talking about where +// to save the wallet file (.keys, .bin), they have to be user-accessible for +// backups - I reckon we save that in My Documents\Monero Accounts\ on +// Windows, ~/Monero Accounts/ on nix / osx +#ifdef Q_OS_WIN + QStringList moneroAccountsRootDir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation); +#elif defined(Q_OS_UNIX) + QStringList moneroAccountsRootDir = QStandardPaths::standardLocations(QStandardPaths::HomeLocation); +#endif + if (!moneroAccountsRootDir.empty()) { + engine.rootContext()->setContextProperty("moneroAccountsDir", moneroAccountsRootDir.at(0) + "/Monero Accounts"); + } + engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath()); engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); QObject *rootObject = engine.rootObjects().first(); -- cgit v1.2.3