From 032971af2f15de231658eebdb12e5f821132238e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 25 Nov 2016 12:56:07 +0100 Subject: tests/manual,auto/qstorageinfo: Use function pointer in print helper Fix warning about unused variable printer in auto-test and redirects output to qInfo() as intended. Amends change a26435d65ceac5d714d5cc7d5af2326e162d7a41. Change-Id: Ia72a93267a54b9c4f9ef37fa058b95ef586ecc75 Reviewed-by: Simon Hausmann --- tests/manual/qstorageinfo/printvolumes.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/manual/qstorageinfo/printvolumes.cpp b/tests/manual/qstorageinfo/printvolumes.cpp index 1b1660b433..6089d5120a 100644 --- a/tests/manual/qstorageinfo/printvolumes.cpp +++ b/tests/manual/qstorageinfo/printvolumes.cpp @@ -42,17 +42,17 @@ void printVolumes(const QList &volumes, int (*printer)(const char // 214958080 39088272 4096 / // /dev/disk1s2 (hfs) RW 488050672 419909696 4096 Macintosh HD2 /Volumes/Macintosh HD2 - printf("Filesystem (Type) Size Available BSize Label Mounted on\n"); + printer("Filesystem (Type) Size Available BSize Label Mounted on\n"); foreach (const QStorageInfo &info, volumes) { QByteArray fsAndType = info.device(); if (info.fileSystemType() != fsAndType) fsAndType += " (" + info.fileSystemType() + ')'; - printf("%-19s R%c ", fsAndType.constData(), info.isReadOnly() ? 'O' : 'W'); + printer("%-19s R%c ", fsAndType.constData(), info.isReadOnly() ? 'O' : 'W'); if (fsAndType.size() > 19) - printf("\n%23s", ""); + printer("\n%23s", ""); - printf("%10llu %10llu %5u ", info.bytesTotal() / 1024, info.bytesFree() / 1024, info.blockSize()); - printf("%-16s %s\n", qPrintable(info.name()), qPrintable(info.rootPath())); + printer("%10llu %10llu %5u ", info.bytesTotal() / 1024, info.bytesFree() / 1024, info.blockSize()); + printer("%-16s %s\n", qPrintable(info.name()), qPrintable(info.rootPath())); } } -- cgit v1.2.3