Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/win/winstoragevolume.cpp
Show All 15 Lines | 1 | /* | |||
---|---|---|---|---|---|
16 | 16 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "winstoragevolume.h" | 21 | #include "winstoragevolume.h" | ||
22 | 22 | | |||
23 | #include "windevicemanager.h" | 23 | #include "windevicemanager.h" | ||
24 | #include "winutils_p.h" | ||||
24 | 25 | | |||
25 | #include <qt_windows.h> | 26 | #include <qt_windows.h> | ||
26 | 27 | | |||
27 | #include <iostream> | 28 | #include <iostream> | ||
28 | 29 | | |||
29 | using namespace Solid::Backends::Win; | 30 | using namespace Solid::Backends::Win; | ||
30 | 31 | | |||
31 | WinStorageVolume::WinStorageVolume(WinDevice *device) | 32 | WinStorageVolume::WinStorageVolume(WinDevice *device) | ||
Show All 24 Lines | 54 | { | |||
56 | DWORD serial; | 57 | DWORD serial; | ||
57 | DWORD flags; | 58 | DWORD flags; | ||
58 | //TODO:get correct name | 59 | //TODO:get correct name | ||
59 | wchar_t dLetter[MAX_PATH]; | 60 | wchar_t dLetter[MAX_PATH]; | ||
60 | int dLetterSize = WinBlock::driveLetterFromUdi(m_device->udi()).toWCharArray(dLetter); | 61 | int dLetterSize = WinBlock::driveLetterFromUdi(m_device->udi()).toWCharArray(dLetter); | ||
61 | dLetter[dLetterSize] = (wchar_t)'\\'; | 62 | dLetter[dLetterSize] = (wchar_t)'\\'; | ||
62 | dLetter[dLetterSize + 1] = 0; | 63 | dLetter[dLetterSize + 1] = 0; | ||
63 | 64 | | |||
65 | // block error dialogs from GetDiskFreeSpaceEx & other WinAPI, see bug 371012 | ||||
66 | WinErrorBlocker block; | ||||
67 | | ||||
64 | if (GetVolumeInformation(dLetter, label, MAX_PATH, &serial, NULL, &flags, fs, MAX_PATH)) { | 68 | if (GetVolumeInformation(dLetter, label, MAX_PATH, &serial, NULL, &flags, fs, MAX_PATH)) { | ||
65 | m_label = QString::fromWCharArray(label); | 69 | m_label = QString::fromWCharArray(label); | ||
66 | m_fs = QString::fromWCharArray(fs); | 70 | m_fs = QString::fromWCharArray(fs); | ||
67 | m_uuid = QString::number(serial, 16); | 71 | m_uuid = QString::number(serial, 16); | ||
68 | } | 72 | } | ||
69 | 73 | | |||
70 | ULARGE_INTEGER size; | 74 | ULARGE_INTEGER size; | ||
71 | if (GetDiskFreeSpaceEx(dLetter, NULL, &size, NULL)) { | 75 | if (GetDiskFreeSpaceEx(dLetter, NULL, &size, NULL)) { | ||
Show All 28 Lines |