summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp5
-rw-r--r--tests/manual/qstorageinfo/main.cpp7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index bbcc29c50b..bf998993d8 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -160,12 +160,15 @@ static bool isPseudoFs(const QStorageIterator &it)
QByteArray type = it.fileSystemType();
if (type == "tmpfs")
- return true;
+ return false;
#if defined(Q_OS_LINUX)
if (type == "rootfs" || type == "rpc_pipefs")
return true;
#endif
+ if (!it.device().startsWith('/'))
+ return true;
+
return false;
}
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", "");