2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 Intel Corporation
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2015-11-18 06:21:53 +00:00
|
|
|
|
|
|
|
#include <QtCore/QCoreApplication>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2016-04-12 22:58:32 +00:00
|
|
|
#include "printvolumes.cpp"
|
|
|
|
|
2015-11-18 06:21:53 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QCoreApplication a(argc, argv);
|
|
|
|
|
|
|
|
QList<QStorageInfo> volumes;
|
|
|
|
QStringList args = a.arguments();
|
|
|
|
args.takeFirst(); // skip application name
|
|
|
|
|
|
|
|
foreach (const QString &path, args) {
|
|
|
|
QStorageInfo info(path);
|
|
|
|
if (!info.isValid()) {
|
|
|
|
// no error string...
|
|
|
|
fprintf(stderr, "Could not get info on %s\n", qPrintable(path));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
volumes << info;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (volumes.isEmpty())
|
|
|
|
volumes = QStorageInfo::mountedVolumes();
|
|
|
|
|
2016-04-12 22:58:32 +00:00
|
|
|
printVolumes(volumes, printf);
|
2015-11-18 06:21:53 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|