mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Small improvements to code quality
This commit is contained in:
@@ -87,7 +87,6 @@ static void printBattery(FFinstance* instance, const BatteryResult* result, uint
|
||||
{
|
||||
if(instance->config.batteryFormat.length == 0)
|
||||
{
|
||||
|
||||
ffPrintLogoAndKey(instance, FF_BATTERY_MODULE_NAME, index, &instance->config.batteryKey);
|
||||
|
||||
bool showStatus =
|
||||
|
||||
+2
-2
@@ -197,9 +197,9 @@ static void printGPUResult(FFinstance* instance, uint8_t index, FFcache* cache,
|
||||
ffStrbufSubstrAfterFirstC(&namePretty, '[');
|
||||
|
||||
FFstrbuf gpu;
|
||||
ffStrbufInitA(&gpu, result->vendor.length + namePretty.length);
|
||||
ffStrbufInitA(&gpu, result->vendor.length + 1 + namePretty.length);
|
||||
|
||||
if(*vendorPretty != '\0')
|
||||
if(ffStrSet(vendorPretty))
|
||||
{
|
||||
ffStrbufAppendS(&gpu, vendorPretty);
|
||||
ffStrbufAppendC(&gpu, ' ');
|
||||
|
||||
+8
-18
@@ -22,26 +22,16 @@ void ffPrintWM(FFinstance* instance)
|
||||
{
|
||||
ffPrintLogoAndKey(instance, FF_WM_MODULE_NAME, 0, &instance->config.wmKey);
|
||||
|
||||
if(result->wmPrettyName.length == 0 && result->wmProcessName.length == 0)
|
||||
{
|
||||
ffStrbufPutTo(&result->wmProtocolName, stdout);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(result->wmPrettyName.length > 0)
|
||||
ffStrbufWriteTo(&result->wmPrettyName, stdout);
|
||||
else
|
||||
ffStrbufWriteTo(&result->wmProcessName, stdout);
|
||||
ffStrbufWriteTo(&result->wmPrettyName, stdout);
|
||||
|
||||
if(result->wmProtocolName.length > 0)
|
||||
{
|
||||
fputs(" (", stdout);
|
||||
ffStrbufWriteTo(&result->wmProtocolName, stdout);
|
||||
putchar(')');
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
if(result->wmProtocolName.length > 0)
|
||||
{
|
||||
fputs(" (", stdout);
|
||||
ffStrbufWriteTo(&result->wmProtocolName, stdout);
|
||||
putchar(')');
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user