This commit is contained in:
Mars 2025-05-01 02:37:26 -04:00
parent 35f045f393
commit 4f6f5e6724
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
3 changed files with 5 additions and 4 deletions

View file

@ -36,6 +36,7 @@ namespace os {
return config.weather.getWeatherInfo(); return config.weather.getWeatherInfo();
}); });
// TODO: make this use the user's timezone
this->date = std::format("{:%B %d}", year_month_day { floor<days>(system_clock::now()) }); this->date = std::format("{:%B %d}", year_month_day { floor<days>(system_clock::now()) });
this->host = hostFut.get(); this->host = hostFut.get();
this->kernelVersion = kernelFut.get(); this->kernelVersion = kernelFut.get();

View file

@ -196,7 +196,7 @@ namespace {
content.push_back(separator() | color(ui::DEFAULT_THEME.border)); content.push_back(separator() | color(ui::DEFAULT_THEME.border));
if (data.host) if (data.host && !data.host->empty())
content.push_back(createRow(hostIcon, "Host", *data.host)); content.push_back(createRow(hostIcon, "Host", *data.host));
else else
error_at(data.host.error()); error_at(data.host.error());

View file

@ -424,7 +424,7 @@ namespace os {
DracError(DracErrorCode::NotFound, std::format("Failed to open DMI product identifier file '{}'", path)) DracError(DracErrorCode::NotFound, std::format("Failed to open DMI product identifier file '{}'", path))
); );
if (!std::getline(file, line)) if (!std::getline(file, line) || line.empty())
return Err( return Err(
DracError(DracErrorCode::ParseError, std::format("DMI product identifier file ('{}') is empty", path)) DracError(DracErrorCode::ParseError, std::format("DMI product identifier file ('{}') is empty", path))
); );
@ -478,12 +478,12 @@ namespace os {
if (Result<u64, DracError> linuxCount = linux::GetTotalPackageCount()) if (Result<u64, DracError> linuxCount = linux::GetTotalPackageCount())
count += *linuxCount; count += *linuxCount;
else else
return Err(linuxCount.error()); debug_at(linuxCount.error());
if (Result<u64, DracError> sharedCount = shared::GetPackageCount()) if (Result<u64, DracError> sharedCount = shared::GetPackageCount())
count += *sharedCount; count += *sharedCount;
else else
return Err(sharedCount.error()); debug_at(sharedCount.error());
return count; return count;
} }