summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2023-03-01 22:02:40 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2023-03-01 22:02:40 +0200
commit09b20bd9c157f8b7dde5f534a4d2366b27a33a2b (patch)
tree04bda80b1fe597d1b9bc183d9bee7fec5a1c8092 /tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
parent22b60030490cf4b6418e9faab1559b658db1a887 (diff)
parenta4aeb081769cd0f5817c8e84b4740f315aa3b673 (diff)
Merge remote-tracking branch 'origin/tqtc/lts-6.2.6' into tqtc/lts-6.2-opensource
Diffstat (limited to 'tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp')
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 877c61fb64..a2f11aa477 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -443,7 +443,18 @@ void tst_QFiledialog::completer_data()
QTest::newRow("goto root") << QString() << rootPath << -1;
QTest::newRow("start at root") << rootPath << QString() << -1;
- QFileInfoList list = QDir::root().entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
+ QDir dir = QDir::root();
+#ifdef Q_OS_ANDROID
+ // Android 11 and above doesn't allow accessing root filesystem as before,
+ // so let's opt int for the app's home.
+ if (QNativeInterface::QAndroidApplication::sdkVersion() >= 30) {
+ const auto homePaths = QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
+ QVERIFY(!homePaths.isEmpty());
+ dir = QDir(homePaths.first());
+ }
+#endif
+
+ QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
QVERIFY(!list.isEmpty());
const QString folder = list.first().absoluteFilePath();
QTest::newRow("start at one below root r") << folder << "r" << -1;