7#include "winstoragevolume.h"
9#include "windevicemanager.h"
10#include "winutils_p.h"
12#include <qt_windows.h>
16using namespace Solid::Backends::Win;
18WinStorageVolume::WinStorageVolume(WinDevice *device)
25WinStorageVolume::~WinStorageVolume()
29bool WinStorageVolume::isIgnored()
const
31 return WinBlock::driveLetterFromUdi(m_device->udi()).isNull();
36 return Solid::StorageVolume::FileSystem;
39void WinStorageVolume::updateCache()
41 wchar_t label[MAX_PATH];
46 wchar_t dLetter[MAX_PATH];
47 int dLetterSize = WinBlock::driveLetterFromUdi(m_device->udi()).
toWCharArray(dLetter);
48 dLetter[dLetterSize] = (wchar_t)
'\\';
49 dLetter[dLetterSize + 1] = 0;
52 WinErrorBlocker block;
54 if (GetVolumeInformation(dLetter, label, MAX_PATH, &serial, NULL, &flags, fs, MAX_PATH)) {
61 if (GetDiskFreeSpaceEx(dLetter, NULL, &size, NULL)) {
62 m_size = size.QuadPart;
66QString WinStorageVolume::fsType()
const
71QString WinStorageVolume::label()
const
76QString WinStorageVolume::uuid()
const
81qulonglong WinStorageVolume::size()
const
86QString WinStorageVolume::encryptedContainerUdi()
const
91#include "moc_winstoragevolume.cpp"
UsageType
This enum type defines the how a volume is used.
QString fromWCharArray(const wchar_t *string, qsizetype size)
QString number(double n, char format, int precision)
qsizetype toWCharArray(wchar_t *array) const const