Changeset View
Changeset View
Standalone View
Standalone View
src/engine/experimental/databasesanitizer.cpp
Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | 43 | public: | |||
---|---|---|---|---|---|
152 | } | 152 | } | ||
153 | 153 | | |||
154 | QStorageInfo getStorageInfo(const quint32 id) { | 154 | QStorageInfo getStorageInfo(const quint32 id) { | ||
155 | static QMap<quint32, QStorageInfo> storageInfos = []() { | 155 | static QMap<quint32, QStorageInfo> storageInfos = []() { | ||
156 | QMap<quint32, QStorageInfo> result; | 156 | QMap<quint32, QStorageInfo> result; | ||
157 | const auto volumes = QStorageInfo::mountedVolumes(); | 157 | const auto volumes = QStorageInfo::mountedVolumes(); | ||
158 | for (const auto& vol : volumes) { | 158 | for (const auto& vol : volumes) { | ||
159 | const QByteArray rootPath = QFile::encodeName(vol.rootPath()); | 159 | const QByteArray rootPath = QFile::encodeName(vol.rootPath()); | ||
160 | const auto fsinfo = filePathToStat(rootPath); | 160 | const auto id = filePathToId(rootPath); | ||
161 | const quint32 id = static_cast<quint32>(fsinfo.st_dev); | 161 | const quint32 deviceId = idToDeviceId(id); | ||
162 | // qDebug() << vol; | 162 | // qDebug() << vol; | ||
163 | result[id] = vol; | 163 | result[deviceId] = vol; | ||
164 | } | 164 | } | ||
165 | return result; | 165 | return result; | ||
166 | }(); | 166 | }(); | ||
167 | 167 | | |||
168 | QStorageInfo info = storageInfos.value(id); | 168 | QStorageInfo info = storageInfos.value(id); | ||
169 | return info; | 169 | return info; | ||
170 | } | 170 | } | ||
171 | 171 | | |||
▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines |