mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Disk: move physicalType to module DiskIO
Physical type applies to physical disks, not partitions
This commit is contained in:
@@ -112,19 +112,6 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk)
|
||||
bool isExternal = !!(disk->type & FF_DISK_VOLUME_TYPE_EXTERNAL_BIT);
|
||||
bool isHidden = !!(disk->type & FF_DISK_VOLUME_TYPE_HIDDEN_BIT);
|
||||
bool isReadOnly = !!(disk->type & FF_DISK_VOLUME_TYPE_READONLY_BIT);
|
||||
const char* physicalType;
|
||||
switch(disk->physicalType)
|
||||
{
|
||||
case FF_DISK_PHYSICAL_TYPE_HDD:
|
||||
physicalType = "HDD";
|
||||
break;
|
||||
case FF_DISK_PHYSICAL_TYPE_SSD:
|
||||
physicalType = "SSD";
|
||||
break;
|
||||
default:
|
||||
physicalType = "Unknown";
|
||||
break;
|
||||
}
|
||||
ffPrintFormatString(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, FF_DISK_NUM_FORMAT_ARGS, (FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &usedPretty},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &totalPretty},
|
||||
@@ -137,7 +124,6 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk)
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &disk->filesystem},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &disk->name},
|
||||
{FF_FORMAT_ARG_TYPE_BOOL, &isReadOnly},
|
||||
{FF_FORMAT_ARG_TYPE_STRING, physicalType}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -429,19 +415,6 @@ void ffGenerateDiskJson(FFDiskOptions* options, yyjson_mut_doc* doc, yyjson_mut_
|
||||
yyjson_mut_arr_add_str(doc, typeArr, "Hidden");
|
||||
if(item->type & FF_DISK_VOLUME_TYPE_READONLY_BIT)
|
||||
yyjson_mut_arr_add_str(doc, typeArr, "Read-only");
|
||||
|
||||
switch(item->physicalType)
|
||||
{
|
||||
case FF_DISK_PHYSICAL_TYPE_HDD:
|
||||
yyjson_mut_obj_add_str(doc, obj, "physicalType", "HDD");
|
||||
break;
|
||||
case FF_DISK_PHYSICAL_TYPE_SSD:
|
||||
yyjson_mut_obj_add_str(doc, obj, "physicalType", "SSD");
|
||||
break;
|
||||
default:
|
||||
yyjson_mut_obj_add_null(doc, obj, "physicalType");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
FF_LIST_FOR_EACH(FFDisk, item, disks)
|
||||
|
||||
Reference in New Issue
Block a user