summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-11-17 22:25:04 -0800
committerThiago Macieira <thiago.macieira@intel.com>2016-05-09 06:04:26 +0000
commitd9f6b6d1f836c25a8179ae7a6df18ee9cceebfb1 (patch)
tree77a2905f4ed8040e8eec89c3a352f167d2ecef60 /tests
parentb168c6c8248662da31dbaaf2afb8e771a9ecdc85 (diff)
QStorageInfo: update the detection of pseudo filesystems
Allow tmpfs filesystems to be reported, as they're often usable by the user, mounted in /tmp and in /run (the fs for $XDG_RUNTIME_DIR). But disallow anything whose device is not a pathname. This catches most of everything else that wasn't specifically tested for before, like virtual fuse filesystems, like GVFS. Change-Id: I3e15a26e0e424169ac2bffff1417b7cee0f8ec97 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/qstorageinfo/main.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/manual/qstorageinfo/main.cpp b/tests/manual/qstorageinfo/main.cpp
index 884e5559ce..5c106ff45b 100644
--- a/tests/manual/qstorageinfo/main.cpp
+++ b/tests/manual/qstorageinfo/main.cpp
@@ -66,10 +66,11 @@ int main(int argc, char *argv[])
printf("Filesystem (Type) Size Available BSize Label Mounted on\n");
foreach (const QStorageInfo &info, volumes) {
- const QString fsAndType = info.device() + QLatin1String(" (") +
- info.fileSystemType() + QLatin1Char(')');
+ QByteArray fsAndType = info.device();
+ if (info.fileSystemType() != fsAndType)
+ fsAndType += " (" + info.fileSystemType() + ')';
- printf("%-19s R%c ", qPrintable(fsAndType), info.isReadOnly() ? 'O' : 'W');
+ printf("%-19s R%c ", fsAndType.constData(), info.isReadOnly() ? 'O' : 'W');
if (fsAndType.size() > 19)
printf("\n%23s", "");