diff --git a/src/core/system_data.cpp b/src/core/system_data.cpp index fc7e09d..f7c090b 100644 --- a/src/core/system_data.cpp +++ b/src/core/system_data.cpp @@ -36,6 +36,7 @@ namespace os { return config.weather.getWeatherInfo(); }); + // TODO: make this use the user's timezone this->date = std::format("{:%B %d}", year_month_day { floor(system_clock::now()) }); this->host = hostFut.get(); this->kernelVersion = kernelFut.get(); diff --git a/src/main.cpp b/src/main.cpp index d212686..71c639a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -196,7 +196,7 @@ namespace { 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)); else error_at(data.host.error()); diff --git a/src/os/linux.cpp b/src/os/linux.cpp index e023482..903acae 100644 --- a/src/os/linux.cpp +++ b/src/os/linux.cpp @@ -424,7 +424,7 @@ namespace os { 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( DracError(DracErrorCode::ParseError, std::format("DMI product identifier file ('{}') is empty", path)) ); @@ -478,12 +478,12 @@ namespace os { if (Result linuxCount = linux::GetTotalPackageCount()) count += *linuxCount; else - return Err(linuxCount.error()); + debug_at(linuxCount.error()); if (Result sharedCount = shared::GetPackageCount()) count += *sharedCount; else - return Err(sharedCount.error()); + debug_at(sharedCount.error()); return count; }