Android: Make sure that the root file system is in the list of volumes

On Android (at least in the emulator), the root file system is reported
to be of type rootfs, which we usually ignore on Linux as legacy.

Also, it's a read-only file system with bytesTotal reported as zero. We
usually ignore such volumes, but as the root file system is expected to
be in the list, we should never ignore it.

This fixes the failing QStorageInfo test.

Change-Id: I778ee9e76e385649e58d5e5ac7e0ae2d8e0ba92b
Fixes: QTBUG-73563
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Volker Hilsheimer 2019-06-18 23:03:01 +02:00
parent cdfe8c76af
commit 6275e037bf
1 changed files with 2 additions and 2 deletions

View File

@ -220,7 +220,7 @@ static bool shouldIncludeFs(const QStorageIterator &it)
return false;
}
#ifdef Q_OS_LINUX
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
if (it.fileSystemType() == "rootfs")
return false;
#endif
@ -846,7 +846,7 @@ QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes()
const QString mountDir = it.rootPath();
QStorageInfo info(mountDir);
if (info.bytesTotal() == 0)
if (info.bytesTotal() == 0 && info != root())
continue;
volumes.append(info);
}