aboutsummaryrefslogtreecommitdiff
path: root/src/main/main.cpp
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2020-11-24 22:41:05 +0000
committerxiphon <xiphon@protonmail.com>2020-11-25 10:50:56 +0000
commitec8cd137cc9592aa910e9829f8e9ce251488c70f (patch)
tree52a9c089a70b85ea0f7f7a66c263f7d34a3ca039 /src/main/main.cpp
parentd5365298d26b33ccb490bc7f8af936c67394e045 (diff)
downloadmonzero-gui-ec8cd137cc9592aa910e9829f8e9ce251488c70f.tar.gz
monzero-gui-ec8cd137cc9592aa910e9829f8e9ce251488c70f.tar.xz
monzero-gui-ec8cd137cc9592aa910e9829f8e9ce251488c70f.zip
portable: use portable storage folder to store QML disk cache
Diffstat (limited to 'src/main/main.cpp')
-rw-r--r--src/main/main.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/main.cpp b/src/main/main.cpp
index 4035e194..79e172ca 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -190,6 +190,20 @@ int main(int argc, char *argv[])
// Turn off colors in monerod log output.
qputenv("TERM", "goaway");
+#if defined(Q_OS_MACOS)
+ QDir::setCurrent(QDir(MacOSHelper::bundlePath() + QDir::separator() + "..").canonicalPath());
+#endif
+
+ if (MoneroSettings::portableConfigExists())
+ {
+ const QString cacheDir(MoneroSettings::portableFolderName() + QDir::separator() + ".cache");
+ if (!qputenv("QML_DISK_CACHE_PATH", cacheDir.toUtf8()))
+ {
+ qCritical() << "Error: failed to set QML disk cache path";
+ return 1;
+ }
+ }
+
MainApp app(argc, argv);
#if defined(Q_OS_WIN)
@@ -326,10 +340,6 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
// start listening
QTimer::singleShot(0, ipc, SLOT(bind()));
-#if defined(Q_OS_MACOS)
- QDir::setCurrent(QDir(MacOSHelper::bundlePath() + QDir::separator() + "..").canonicalPath());
-#endif
-
// screen settings
// Mobile is designed on 128dpi
qreal ref_dpi = 128;