Read about our upcoming Code of Conduct on this issue

Commit f516516c authored by a1ex's avatar a1ex
Browse files

Moved some config autosave functions to config.c

--HG--
branch : unified
parent 7e7cba84ec4e
......@@ -294,17 +294,30 @@ error:
return NULL;
}
int config_autosave = 1;
#define CONFIG_AUTOSAVE_FLAG_FILE "B:/AUTOSAVE.NEG"
void
config_autosave_toggle(void* priv)
{
config_flag_file_setting_save(CONFIG_AUTOSAVE_FLAG_FILE, !!config_autosave);
msleep(50);
config_autosave = !config_flag_file_setting_load(CONFIG_AUTOSAVE_FLAG_FILE);
}
int
config_parse_file(
const char * filename
)
{
config_autosave = !config_flag_file_setting_load(CONFIG_AUTOSAVE_FLAG_FILE);
config_file_buf = read_entire_file(filename, &config_file_size);
if (!config_file_buf)
{
// if config file is not present, force Config Autosave: On
extern int config_autosave;
if (!config_autosave) config_autosave_toggle(0);
return 0;
}
config_file_pos = 0;
config_parse();
......
......@@ -12,9 +12,7 @@
#include "lens.h"
//#include "lua.h"
int config_autosave = 1;
#define CONFIG_AUTOSAVE_FLAG_FILE "B:/AUTOSAVE.NEG"
extern int config_autosave;
//////////////////////////////////////////////////////////
// debug manager enable/disable
//////////////////////////////////////////////////////////
......@@ -127,13 +125,7 @@ delete_config( void * priv )
if (config_autosave) config_autosave_toggle(0);
}
void
config_autosave_toggle(void* priv)
{
config_flag_file_setting_save(CONFIG_AUTOSAVE_FLAG_FILE, !!config_autosave);
msleep(50);
config_autosave = !config_flag_file_setting_load(CONFIG_AUTOSAVE_FLAG_FILE);
}
extern void config_autosave_toggle(void* unused);
static void
config_autosave_display(
......@@ -797,7 +789,6 @@ void
debug_init_stuff( void )
{
//~ set_pic_quality(PICQ_RAW);
config_autosave = !config_flag_file_setting_load(CONFIG_AUTOSAVE_FLAG_FILE);
config_ok = 1;
dm_update();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment