mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Move set_filename() calls outside of parse_file()
Remove the boolean parameter from parse_file; the code is more readable by having an explicit call to set_filename() where necessary, rather than a boolean parameter. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
This commit is contained in:
parent
0b8462bd58
commit
68119c5b54
4 changed files with 12 additions and 17 deletions
12
file.c
12
file.c
|
@ -263,7 +263,7 @@ static void parse_file_buffer(const char *filename, struct memblock *mem, GError
|
|||
parse_xml_buffer(filename, mem->buffer, mem->size, &dive_table, error);
|
||||
}
|
||||
|
||||
void parse_file(const char *filename, GError **error, gboolean possible_default_filename)
|
||||
void parse_file(const char *filename, GError **error)
|
||||
{
|
||||
struct memblock mem;
|
||||
#ifdef SQLITE3
|
||||
|
@ -283,19 +283,9 @@ void parse_file(const char *filename, GError **error, gboolean possible_default_
|
|||
filename);
|
||||
}
|
||||
|
||||
/*
|
||||
* We do *not* want to leave the old default_filename
|
||||
* just because the open failed.
|
||||
*/
|
||||
if (possible_default_filename)
|
||||
set_filename(filename, TRUE);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (possible_default_filename)
|
||||
set_filename(filename, TRUE);
|
||||
|
||||
#ifdef SQLITE3
|
||||
fmt = strrchr(filename, '.');
|
||||
if (fmt && (!strcasecmp(fmt + 1, "DB") || !strcasecmp(fmt + 1, "BAK"))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue