aboutsummaryrefslogtreecommitdiff
path: root/src/file_functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_functions.cpp')
-rw-r--r--src/file_functions.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/file_functions.cpp b/src/file_functions.cpp
index 95e9b5f4..92e598f8 100644
--- a/src/file_functions.cpp
+++ b/src/file_functions.cpp
@@ -26,3 +26,23 @@ bool exists(QString p_path)
return file.exists();
}
+
+QString get_base_path()
+{
+ QString base_path = "";
+#ifdef ANDROID
+ QString sdcard_storage = getenv("SECONDARY_STORAGE");
+ if (dir_exists(sdcard_storage + "/base/")) {
+ base_path = sdcard_storage + "/base/";
+ }
+ else {
+ QString external_storage = getenv("EXTERNAL_STORAGE");
+ base_path = external_storage + "/base/";
+ }
+#elif defined(__APPLE__)
+ base_path = QCoreApplication::applicationDirPath() + "/../../../base/";
+#else
+ base_path = QCoreApplication::applicationDirPath() + "/base/";
+#endif
+ return base_path;
+}