diff --git a/src/Core/SystemData.cpp b/src/Core/SystemData.cpp index 112ab71..e9a7350 100644 --- a/src/Core/SystemData.cpp +++ b/src/Core/SystemData.cpp @@ -71,6 +71,7 @@ namespace os { using enum std::launch; using package::GetTotalCount; using util::types::Future, util::types::Err; + using enum util::error::DracErrorCode; Future> hostFut = std::async(async, GetHost); Future> kernelFut = std::async(async, GetKernelVersion); @@ -85,24 +86,20 @@ namespace os { Future> wthrFut = std::async(config.weather.enabled ? async : deferred, [&config]() -> Result { return config.weather.enabled && config.weather.service ? config.weather.service->getWeatherInfo() - : Err(DracError(util::error::DracErrorCode::ApiUnavailable, "Weather API disabled")); + : Err(DracError(ApiUnavailable, "Weather API disabled")); }); - { - using enum util::error::DracErrorCode; - - this->date = getDate(); - this->host = hostFut.get(); - this->kernelVersion = kernelFut.get(); - this->osVersion = osFut.get(); - this->memInfo = memFut.get(); - this->desktopEnv = deFut.get(); - this->windowMgr = wmFut.get(); - this->diskUsage = diskFut.get(); - this->shell = shellFut.get(); - this->packageCount = pkgFut.get(); - this->weather = config.weather.enabled ? wthrFut.get() : Err(DracError(util::error::DracErrorCode::ApiUnavailable, "Weather API disabled")); - this->nowPlaying = config.nowPlaying.enabled ? npFut.get() : Err(DracError(util::error::DracErrorCode::ApiUnavailable, "Now Playing API disabled")); - } + this->date = getDate(); + this->host = hostFut.get(); + this->kernelVersion = kernelFut.get(); + this->osVersion = osFut.get(); + this->memInfo = memFut.get(); + this->desktopEnv = deFut.get(); + this->windowMgr = wmFut.get(); + this->diskUsage = diskFut.get(); + this->shell = shellFut.get(); + this->packageCount = pkgFut.get(); + this->weather = config.weather.enabled ? wthrFut.get() : Err(DracError(ApiUnavailable, "Weather API disabled")); + this->nowPlaying = config.nowPlaying.enabled ? npFut.get() : Err(DracError(ApiUnavailable, "Now Playing API disabled")); } } // namespace os