aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core/android.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-07 10:50:44 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-07 10:52:19 -0800
commitaaac2cbe9c031a64a100b169b836fe6afdcffab2 (patch)
treebf7a2a45b8b03c633328b5b54a12be6d905a20ba /subsurface-core/android.cpp
parent787b12cff446d7b877b4b5e25c1fcaa072df767d (diff)
downloadsubsurface-aaac2cbe9c031a64a100b169b836fe6afdcffab2.tar.gz
Android: go back to using Qt's DataLocation
It appears that the default path we tried to use on Android since commit 80056278f7a2 ("android.cpp: update path retriaval scheme") didn't work - so let's just go back to what we used to do as that was perfectly fine. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/android.cpp')
-rw-r--r--subsurface-core/android.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/subsurface-core/android.cpp b/subsurface-core/android.cpp
index 4b5877ab5..3631b07a1 100644
--- a/subsurface-core/android.cpp
+++ b/subsurface-core/android.cpp
@@ -44,18 +44,12 @@ void subsurface_user_info(struct user_info *user)
static const char *system_default_path_append(const char *append)
{
- /* Replace this when QtCore/QStandardPaths getExternalStorageDirectory landed */
- QAndroidJniObject externalStorage = QAndroidJniObject::callStaticObjectMethod("android/os/Environment", "getExternalStorageDirectory", "()Ljava/io/File;");
- QAndroidJniObject externalStorageAbsolute = externalStorage.callObjectMethod("getAbsolutePath", "()Ljava/lang/String;");
- QString path = externalStorageAbsolute.toString();
- QAndroidJniEnvironment env;
- if (env->ExceptionCheck()) {
- // FIXME: Handle exception here.
- env->ExceptionClear();
- path = QString("/sdcard");
- }
+ // Qt appears to find a working path for us - let's just go with that
+ QString path = QStandardPaths::standardLocations(QStandardPaths::DataLocation).first();
+
if (append)
path += QString("/%1").arg(append);
+
return strdup(path.toUtf8().data());
}