mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'open-files' of git://github.com/nathansamson/diveclog
* 'open-files' of git://github.com/nathansamson/diveclog: Report errors when opening files Make it possible to load multiple files at once. Open File works. I refactored the code and introduced a new type. I never used it as a pointer (their was no real reason), but I'm not really satisfied.
This commit is contained in:
commit
c24fd4b82c
10 changed files with 163 additions and 56 deletions
|
@ -1228,13 +1228,20 @@ static void reset_all(void)
|
|||
import_source = UNKNOWN;
|
||||
}
|
||||
|
||||
void parse_xml_file(const char *filename)
|
||||
void parse_xml_file(const char *filename, GError **error)
|
||||
{
|
||||
xmlDoc *doc;
|
||||
|
||||
doc = xmlReadFile(filename, NULL, 0);
|
||||
if (!doc) {
|
||||
fprintf(stderr, "Failed to parse '%s'.\n", filename);
|
||||
if (error != NULL)
|
||||
{
|
||||
*error = g_error_new(g_quark_from_string("divelog"),
|
||||
DIVE_ERROR_PARSE,
|
||||
"Failed to parse '%s'",
|
||||
filename);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue