From 30e1cde995d703ff26fe29a57aac56ce327713fc Mon Sep 17 00:00:00 2001 From: Roberto Viola Date: Wed, 10 Jan 2024 15:03:15 +0100 Subject: [PATCH] patch for all the android versions --- src/homeform.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/homeform.cpp b/src/homeform.cpp index eff27d903..fd96b20bb 100644 --- a/src/homeform.cpp +++ b/src/homeform.cpp @@ -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()); @@ -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)