Simplified config file existence test
This commit is contained in:
parent
780e31b54d
commit
06047e6f0c
5
main.cpp
5
main.cpp
@ -176,8 +176,9 @@ int main(int argc, const char * argv[]) {
|
||||
main_saver = saver.get();
|
||||
main_saver->setup(main_context.get(), {0, 0, WIDTH, HEIGHT});
|
||||
std::string config_path {plugin_dir + "/" + saver_name + ".json"};
|
||||
if (sc::file_exists(config_path)) {
|
||||
std::ifstream config_file {config_path};
|
||||
std::ifstream config_file {config_path};
|
||||
if (config_file) {
|
||||
std::cerr << "screensaver: reading config file " << config_path << '\n';
|
||||
nlohmann::json j;
|
||||
config_file >> j;
|
||||
main_saver->config(j);
|
||||
|
Loading…
x
Reference in New Issue
Block a user