From e41b7f7d6cdff5fbbb32cada75a7697fe06a1a9a Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Thu, 7 Apr 2022 16:33:20 +0200 Subject: [PATCH] Machine_info add disk and partition informations --- sources/machine_info.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sources/machine_info.cpp b/sources/machine_info.cpp index da6e3dbbd..d7ae428d1 100644 --- a/sources/machine_info.cpp +++ b/sources/machine_info.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef Q_OS_WIN #include @@ -149,6 +150,28 @@ void MachineInfo::send_info_to_debug() + QString::number(pc.screen.height[ii]) + " )"; } + + foreach (const QStorageInfo &storage, QStorageInfo::mountedVolumes()) { + if (storage.isReadOnly()) + qDebug() << "isReadOnly:" << storage.isReadOnly(); + + qInfo() << "DISK :" << storage.rootPath().toLocal8Bit().constData() << " "; + qInfo() << "FileSystemType:" << storage.fileSystemType(); + qInfo() << "SizeTotal:" << storage.bytesFree() /1024/1024/1024 << "GB"; + qInfo() << "AvailableSize:" << storage.bytesAvailable()/1024/1024/1024 << "GB"; + } + + QStorageInfo storage(qApp->applicationDirPath()); + + if (storage.isReadOnly()) + qDebug() << "isReadOnly:" << storage.isReadOnly(); + + qInfo() << "DISK USED:" << storage.rootPath().toLocal8Bit().constData() << " "; + qInfo() << "FileSystemType:" << storage.fileSystemType(); + qInfo() << "SizeTotal:" << storage.bytesFree()/1024/1024/1024 << "GB"; + qInfo() << "AvailableSize:" << storage.bytesAvailable()/1024/1024/1024 << "GB"; + + } /** @@ -243,6 +266,9 @@ void MachineInfo::init_get_cpu_info_linux() QString linuxGPURAMOutput = linuxgpuRAM.readAllStandardOutput(); pc.gpu.RAM=QString(linuxGPURAMOutput.toLocal8Bit().constData()); linuxgpuRAM.close(); + + + } /**