providers: don't fail if the icon already exists, overwrite it instead

This commit is contained in:
Bilal Elmoussaoui 2021-01-31 21:58:19 +01:00
parent 57e5fa9a1d
commit fcd8e42d7c

View file

@ -256,10 +256,12 @@ impl ProviderPage {
let image_dest = FAVICONS_PATH.join(icon_name.as_str()); let image_dest = FAVICONS_PATH.join(icon_name.as_str());
let dest_file = gio::File::new_for_path(image_dest); let dest_file = gio::File::new_for_path(image_dest);
dest_file.create( dest_file
gio::FileCreateFlags::REPLACE_DESTINATION, .create(
gio::NONE_CANCELLABLE, gio::FileCreateFlags::REPLACE_DESTINATION,
)?; gio::NONE_CANCELLABLE,
)
.ok();
file.copy( file.copy(
&dest_file, &dest_file,
gio::FileCopyFlags::OVERWRITE, gio::FileCopyFlags::OVERWRITE,