Skip to content

Commit

Permalink
patch for all the android versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Jan 10, 2024
1 parent 8eed701 commit 30e1cde
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/homeform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ homeform::homeform(QQmlApplicationEngine *engine, bluetooth *bl) {
}

#ifdef Q_OS_ANDROID
// Android 13 restrics access to /Android/data folder
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Android, 13)) {
// from sept 2023 android restrics access to /Android/data folder
{
QDirIterator itAndroid(getAndroidDataAppDir(), QDirIterator::Subdirectories);
QDir().mkdir(getWritableAppDir());
QDir().mkdir(getProfileDir());
Expand Down Expand Up @@ -856,13 +856,9 @@ void homeform::pelotonWorkoutChanged(const QString &name, const QString &instruc
QString homeform::getWritableAppDir() {
QString path = QLatin1String("");
#if defined(Q_OS_ANDROID)
// Android 13 restrics access to /Android/data folder
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Android, 13)) {
path = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/QZ/";
QDir().mkdir(path);
} else {
path = getAndroidDataAppDir() + "/";
}
// from sept 2023 android restrics access to /Android/data folder
path = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/QZ/";
QDir().mkdir(path);
#elif defined(Q_OS_MACOS) || defined(Q_OS_OSX)
path = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + "/";
#elif defined(Q_OS_IOS)
Expand Down

0 comments on commit 30e1cde

Please sign in to comment.