Skip to content

plparser: Fix return value from cancelled calls

Bastien Nocera requested to merge wip/hadess/cancelled-return into master

As per the API documentation, and the code when it still used g_simple_async_result_*, totem_pl_parser_parse_finish() should return a TotemPlParserResult of TOTEM_PL_PARSER_RESULT_CANCELLED when parsing is cancelled.

But the port to GTask changed that, as all the errors caught during parsing would return -1 as the error code, which isn't a valid TotemPlParserResult value.

As the only way for totem_pl_parser_parse_finish() to have a GError set is for the call to be cancelled, catch that and correct the return value.

Fixes: 45664037 ("plparse: Port from GSimpleAsyncResult to GTask")

Closes: #38 (closed)

Merge request reports