1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Jacob Boerema
8004433926 Don't clear cancellable at the beginning and extra cancelled testing 2025-03-29 14:52:04 -04:00
Jacob Boerema
ab5292ad0f plug-ins/help: fix #13049 Help progress not closing
We had to revert our previous fix for #13049 due to other Help related
issues. When there was an error condition when searching or dowloading
the xml help index, the progress widget was not closed and stayed
in the status bar until the Cancel button was clicked.

Fix this by properyly calling `_gimp_help_progress_finish` when tere
is an error condition.
2025-03-29 14:18:01 -04:00

View File

@@ -217,7 +217,7 @@ gimp_help_locale_parse (GimpHelpLocale *locale,
_gimp_help_progress_start (progress, cancellable,
_("Loading index from '%s'"), name);
g_clear_object (&cancellable);
//g_clear_object (&cancellable);
g_free (name);
}
@@ -238,6 +238,11 @@ gimp_help_locale_parse (GimpHelpLocale *locale,
locale_set_error (error,
_("Could not load data from '%s': %s"), file);
g_object_unref (file);
if (progress)
{
_gimp_help_progress_finish (progress);
g_clear_object (&cancellable);
}
return FALSE;
}
@@ -249,11 +254,20 @@ gimp_help_locale_parse (GimpHelpLocale *locale,
GFileInfo *info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_SIZE, 0,
cancellable, error);
if (g_cancellable_is_cancelled (cancellable))
{
/* Temporary separation to see if we get cancelled here */
g_printerr ("Query operation was cancelled!\n");
g_object_unref (info);
info = NULL;
}
if (! info)
{
locale_set_error (error,
_("Could not open '%s' for reading: %s"), file);
g_object_unref (file);
_gimp_help_progress_finish (progress);
g_clear_object (&cancellable);
return FALSE;
}
@@ -265,11 +279,21 @@ gimp_help_locale_parse (GimpHelpLocale *locale,
stream = g_file_read (file, cancellable, error);
if (g_cancellable_is_cancelled (cancellable))
{
/* Temporary separation to see if we get cancelled here */
g_printerr ("Read operation was cancelled!\n");
g_object_unref (stream);
stream = NULL;
}
if (! stream)
{
locale_set_error (error,
_("Could not open '%s' for reading: %s"), file);
g_object_unref (file);
if (progress)
_gimp_help_progress_finish (progress);
g_clear_object (&cancellable);
return FALSE;
}
@@ -301,6 +325,7 @@ gimp_help_locale_parse (GimpHelpLocale *locale,
#endif /* ! PLATFORM_OSX */
if (progress)
_gimp_help_progress_finish (progress);
g_clear_object (&cancellable);
g_markup_parse_context_free (context);