:3333
This commit is contained in:
parent
1926ef4a92
commit
bedf45b831
5 changed files with 101 additions and 236 deletions
11
src/main.cpp
11
src/main.cpp
|
@ -48,16 +48,14 @@ fn GetDate() -> string {
|
|||
}
|
||||
|
||||
fn main() -> int {
|
||||
using WeatherOutput = Weather::WeatherOutput;
|
||||
|
||||
const Config& config = Config::getInstance();
|
||||
|
||||
auto weatherFuture =
|
||||
std::async(std::launch::async, [&config]() { return config.getWeather().getWeatherInfo(); });
|
||||
std::async(std::launch::async, [&config]() { return config.weather.get().getWeatherInfo(); });
|
||||
|
||||
auto osVersionFuture = std::async(std::launch::async, GetOSVersion);
|
||||
auto nowPlayingEnabledFuture =
|
||||
std::async(std::launch::async, [&config]() { return config.getNowPlaying().getEnabled(); });
|
||||
std::async(std::launch::async, [&config]() { return config.now_playing.get().enabled; });
|
||||
|
||||
auto dateFuture = std::async(std::launch::async, GetDate);
|
||||
auto memInfoFuture = std::async(std::launch::async, GetMemInfo);
|
||||
|
@ -66,8 +64,9 @@ fn main() -> int {
|
|||
const long temp = std::lround(json.main.temp);
|
||||
const std::string townName = json.name;
|
||||
|
||||
const char* version = osVersionFuture.get();
|
||||
const std::string name = config.getGeneral().getName();
|
||||
const char* version = osVersionFuture.get();
|
||||
|
||||
const std::string name = config.general.value().name.get();
|
||||
const bool nowPlayingEnabled = nowPlayingEnabledFuture.get();
|
||||
|
||||
fmt::println("Hello {}!", name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue