bgo#562579 - Don't show errors when the initial folder does not exist
The previous patch for this bug was about the initial *file* not existing, but this also handles the initial *folder* not existing (such as /usr/nonexistent/nonexistent.txt). Signed-off-by: Federico Mena Quintero <federico@novell.com>
This commit is contained in:
parent
d87dbd66d6
commit
67632a578b
@ -7050,13 +7050,14 @@ update_current_folder_get_info_cb (GCancellable *cancellable,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Error and bail out, ignoring "not found" errors since they're useless:
|
/* Error and bail out, ignoring "not found" errors since they're useless:
|
||||||
* they only happen when a program defaults to a folder that has been (re)moved.
|
* they only happen when a program defaults to a folder that has been (re)moved.
|
||||||
*/
|
*/
|
||||||
if (!g_error_matches (data->original_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
if (!g_error_matches (data->original_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||||
error_changing_folder_dialog (impl, data->original_file, data->original_error);
|
error_changing_folder_dialog (impl, data->original_file, data->original_error);
|
||||||
else
|
else
|
||||||
g_error_free (data->original_error);
|
g_error_free (data->original_error);
|
||||||
|
|
||||||
g_object_unref (data->original_file);
|
g_object_unref (data->original_file);
|
||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
@ -7065,7 +7066,13 @@ update_current_folder_get_info_cb (GCancellable *cancellable,
|
|||||||
|
|
||||||
if (data->original_file)
|
if (data->original_file)
|
||||||
{
|
{
|
||||||
error_changing_folder_dialog (impl, data->original_file, data->original_error);
|
/* Error and bail out, ignoring "not found" errors since they're useless:
|
||||||
|
* they only happen when a program defaults to a folder that has been (re)moved.
|
||||||
|
*/
|
||||||
|
if (!g_error_matches (data->original_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||||
|
error_changing_folder_dialog (impl, data->original_file, data->original_error);
|
||||||
|
else
|
||||||
|
g_error_free (data->original_error);
|
||||||
|
|
||||||
g_object_unref (data->original_file);
|
g_object_unref (data->original_file);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user