Commit 649caed4 authored by jpetrell's avatar jpetrell

[storage] If there is only one internal storage don't avoid dividing the mass...

[storage] If there is only one internal storage don't avoid dividing the mass storage to user and system parts. Contributes to JB#5771
parent e9ff5988
......@@ -332,32 +332,31 @@ void AboutSettings::refreshStorageModels()
m_internalStorage.clear();
m_externalStorage.clear();
int internalPartitionCount = 0;
foreach (const StorageInfo &info, devices) {
if (!info.external) {
QVariantMap row;
internalPartitionCount++;
}
}
foreach (const StorageInfo &info, devices) {
QVariantMap row;
row[QStringLiteral("mounted")] = info.mounted;
row[QStringLiteral("path")] = info.mountPath;
row[QStringLiteral("available")] = info.availableDiskSpace;
row[QStringLiteral("total")] = info.totalDiskSpace;
row[QStringLiteral("filesystem")] = info.filesystem;
row[QStringLiteral("devicePath")] = info.devicePath;
row[QStringLiteral("storageType")] = info.mountPath == QLatin1String("/")
? QStringLiteral("system")
: QStringLiteral("user");
if (!info.external) {
row[QStringLiteral("storageType")] = internalPartitionCount == 1 ? QStringLiteral("mass")
: info.mountPath == QLatin1String("/") ? QStringLiteral("system")
: QStringLiteral("user");
row[QStringLiteral("path")] = info.mountPath;
row[QStringLiteral("mounted")] = info.mounted;
row[QStringLiteral("available")] = info.availableDiskSpace;
row[QStringLiteral("total")] = info.totalDiskSpace;
row[QStringLiteral("filesystem")] = info.filesystem;
row[QStringLiteral("devicePath")] = info.devicePath;
m_internalStorage << QVariant(row);
} else {
QVariantMap row;
row[QStringLiteral("storageType")] = QStringLiteral("card");
row[QStringLiteral("mounted")] = info.mounted;
row[QStringLiteral("path")] = info.mountPath;
row[QStringLiteral("available")] = info.availableDiskSpace;
row[QStringLiteral("total")] = info.totalDiskSpace;
row[QStringLiteral("filesystem")] = info.filesystem;
row[QStringLiteral("devicePath")] = info.devicePath;
m_externalStorage << QVariant(row);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment