mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
using strbuf for loading/saving cached values
This commit is contained in:
+1
-1
@@ -50,6 +50,6 @@ void ffPrintCPU(FFinstance* instance)
|
||||
);
|
||||
}
|
||||
|
||||
ffPrintAndSaveCachedValue(instance, "CPU", cpu.chars);
|
||||
ffPrintAndSaveCachedValue(instance, "CPU", &cpu);
|
||||
ffStrbufDestroy(&cpu);
|
||||
}
|
||||
+1
-1
@@ -39,7 +39,7 @@ static void handleGPU(FFinstance* instance, struct pci_access* pacc, struct pci_
|
||||
);
|
||||
}
|
||||
|
||||
ffPrintAndSaveCachedValue(instance, key, gpu.chars);
|
||||
ffPrintAndSaveCachedValue(instance, key, &gpu);
|
||||
ffStrbufDestroy(&gpu);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ void ffPrintHost(FFinstance* instance)
|
||||
ffStrbufSetF(&host, "%s %s", name.chars, version.chars);
|
||||
}
|
||||
|
||||
ffPrintAndSaveCachedValue(instance, "Host", host.chars);
|
||||
ffPrintAndSaveCachedValue(instance, "Host", &host);
|
||||
ffStrbufDestroy(&host);
|
||||
|
||||
ffStrbufDestroy(&family);
|
||||
|
||||
@@ -55,6 +55,6 @@ void ffPrintLocale(FFinstance* instance)
|
||||
}
|
||||
|
||||
|
||||
ffPrintAndSaveCachedValue(instance, "Locale", locale.chars);
|
||||
ffPrintAndSaveCachedValue(instance, "Locale", &locale);
|
||||
ffStrbufDestroy(&locale);
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,6 +29,6 @@ void ffPrintOS(FFinstance* instance)
|
||||
ffStrbufSetF(&os, "%s %s", name, instance->state.utsname.machine);
|
||||
}
|
||||
|
||||
ffPrintAndSaveCachedValue(instance, "OS", os.chars);
|
||||
ffPrintAndSaveCachedValue(instance, "OS", &os);
|
||||
ffStrbufDestroy(&os);
|
||||
}
|
||||
@@ -95,6 +95,6 @@ void ffPrintResolution(FFinstance* instance)
|
||||
ffStrbufAppendF(&resolution, " @ %iHz", currentRate);
|
||||
}
|
||||
|
||||
ffPrintAndSaveCachedValue(instance, "Resolution", resolution.chars);
|
||||
ffPrintAndSaveCachedValue(instance, "Resolution", &resolution);
|
||||
ffStrbufDestroy(&resolution);
|
||||
}
|
||||
+1
-1
@@ -43,6 +43,6 @@ void ffPrintShell(FFinstance* instance)
|
||||
ffStrbufSetS(&shell, shellName);
|
||||
}
|
||||
|
||||
ffPrintAndSaveCachedValue(instance, "Shell", shell.chars);
|
||||
ffPrintAndSaveCachedValue(instance, "Shell", &shell);
|
||||
ffStrbufDestroy(&shell);
|
||||
}
|
||||
Reference in New Issue
Block a user