aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index e3917f80..0e996b84 100644
--- a/main.cpp
+++ b/main.cpp
@@ -57,13 +57,18 @@ int main(int argc, char *argv[])
// 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");
+ QString moneroAccountsDir = moneroAccountsRootDir.at(0) + "/Monero Accounts";
+ QDir tempDir;
+ tempDir.mkpath(moneroAccountsDir);
+ engine.rootContext()->setContextProperty("moneroAccountsDir", moneroAccountsDir);
}
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());