Browse Source

config: be a little less cryptic on what's going on in load_default_profile().

djm34
Noel Maersk 11 years ago
parent
commit
5430d1ee91
  1. 21
      config_parser.c

21
config_parser.c

@ -653,17 +653,27 @@ void load_default_config(void)
* Startup functions * Startup functions
* *****************************************/ * *****************************************/
//assign default settings from default profile if set // assign default settings from default profile if set
void load_default_profile() void load_default_profile()
{ {
struct profile *profile; struct profile *profile;
//if a default profile name is set if(empty_string(default_profile.name))
if(!empty_string(default_profile.name))
{ {
//find profile and copy settings applog(LOG_WARNING, "Default profile name not set.");
if((profile = get_profile(default_profile.name))) return;
}
else
{ {
// find profile ...
profile = get_profile(default_profile.name);
if (!profile) {
applog(LOG_WARNING, "Could not load default profile %s",
default_profile.name);
return;
}
// ... and copy settings
default_profile.algorithm = profile->algorithm; default_profile.algorithm = profile->algorithm;
default_profile.devices = profile->devices; default_profile.devices = profile->devices;
default_profile.lookup_gap = profile->lookup_gap; default_profile.lookup_gap = profile->lookup_gap;
@ -682,7 +692,6 @@ void load_default_profile()
default_profile.shaders = profile->shaders; default_profile.shaders = profile->shaders;
default_profile.worksize = profile->worksize; default_profile.worksize = profile->worksize;
} }
}
} }
//apply default settings //apply default settings

Loading…
Cancel
Save