summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
acd7680)
Add a new config setting:
logging = "stdout" -- log to stdout (default)
logging = "syslog" -- log to syslog
logging = "none" -- disable logging
No configuration UI is exposed, but the UI needs to be taught that this
is a legal config setting (so that it doesn't discard it).
+char *logger_name = NULL;
+
struct config_widgets {
#if defined(HILDON) && defined(FREMANTLE)
GtkWidget *continuous_mode_selector;
struct config_widgets {
#if defined(HILDON) && defined(FREMANTLE)
GtkWidget *continuous_mode_selector;
set_continuous_mode(atoi(line.value));
continuous_mode_seen = 1;
}
set_continuous_mode(atoi(line.value));
continuous_mode_seen = 1;
}
} else if (!strcmp(line.key, "default_browser")) {
if (!default_browser_seen) {
set_default_browser(line.value);
default_browser_seen = 1;
}
} else if (!strcmp(line.key, "default_browser")) {
if (!default_browser_seen) {
set_default_browser(line.value);
default_browser_seen = 1;
}
} else if (!strcmp(line.key, "other_browser_cmd")) {
if (!other_browser_cmd_seen) {
set_other_browser_cmd(line.value);
other_browser_cmd_seen = 1;
}
} else if (!strcmp(line.key, "other_browser_cmd")) {
if (!other_browser_cmd_seen) {
set_other_browser_cmd(line.value);
other_browser_cmd_seen = 1;
}
+ free(line.value);
+ } else if (!strcmp(line.key, "logging")) {
+ if (!logger_name)
+ logger_name = line.value;
}
parse_config_file_end();
}
parse_config_file_end();
get_other_browser_cmd());
other_browser_cmd_seen = 1;
}
get_other_browser_cmd());
other_browser_cmd_seen = 1;
}
+ } else if (!strcmp(line.key,
+ "logging")) {
+ if (logger_name) {
+ fprintf(tmpfp, "%s = \"%s\"\n",
+ line.key,
+ logger_name);
+ free(logger_name);
+ logger_name = NULL;
+ }
}
} else {
/* Just copy the old line over */
}
} else {
/* Just copy the old line over */
if (!other_browser_cmd_seen && strlen(get_other_browser_cmd()) > 0)
fprintf(tmpfp, "%s = \"%s\"\n",
"other_browser_cmd", get_other_browser_cmd());
if (!other_browser_cmd_seen && strlen(get_other_browser_cmd()) > 0)
fprintf(tmpfp, "%s = \"%s\"\n",
"other_browser_cmd", get_other_browser_cmd());
+ if (logger_name)
+ fprintf(tmpfp, "%s = \"%s\"\n",
+ "logging", logger_name);
/* Replace the old config file with the new one */
fclose(tmpfp);
/* Replace the old config file with the new one */
fclose(tmpfp);
FILE *fp;
int continuous_mode_seen = 0;
struct swb_config_line line;
FILE *fp;
int continuous_mode_seen = 0;
struct swb_config_line line;
- char *default_browser = NULL;
+ char *default_browser = NULL, *logger_name = NULL;
set_config_defaults(&ctx);
set_config_defaults(&ctx);
} else if (!strcmp(line.key, "other_browser_cmd")) {
if (!ctx.other_browser_cmd)
ctx.other_browser_cmd = line.value;
} else if (!strcmp(line.key, "other_browser_cmd")) {
if (!ctx.other_browser_cmd)
ctx.other_browser_cmd = line.value;
+ } else if (!strcmp(line.key, "logging")) {
+ if (!logger_name)
+ logger_name = line.value;
} else {
/* Don't need this line's contents */
free(line.value);
} else {
/* Don't need this line's contents */
free(line.value);
out:
fclose(fp);
out_noopen:
out:
fclose(fp);
out_noopen:
+ log_config(logger_name);
update_default_browser(&ctx, default_browser);
update_default_browser(&ctx, default_browser);
free(default_browser);
return;
}
free(default_browser);
return;
}