Hello: I'm trying to add the option to delete photo from the DirectPhotoPage window. I added the option in the menu: https://imgur.com/M6FNxxl.png I created the feature ... Once the file was deleted photo.get_file().delete(); (this work fine) I wanted to delete it from the list as well. https://imgur.com/YVav37x.png Once deleted de file I tried with PhotoTable.remove (photo_id); But the compiler says that's forbidden to use it. Can anyone give me any clue how to do it? Thank you. private void on_delete_original() { Photo photo = get_photo(); PhotoID photo_id = photo.get_photo_id(); //File file = photo.get_file(); Gtk.ResponseType response = AppWindow.affirm_cancel_question( _("Delete file %s?").printf(photo.get_basename()), _("_Delete")); if (response == Gtk.ResponseType.YES) { photo.remove_all_transformations(true); try { photo.remove_all_transformations(true); photo.get_file().delete(); photo.remove_all_transformations(true); on_next_photo(); PhotoTable.remove(photo_id); //photo.destroy(); } catch (Error err) { string filename = photo.get_file().get_path(); warning("Unable to delete for %s: %s", filename, err.message); } } return; } Dani O 15/04/20 ás 16:45, Dani escribiu:
Hello: |