Menu

#148 Move deleted pictures to Trash / Recycle Bin

v0.9.23
open
nobody
5
2024-06-08
2010-11-01
No

On platforms/environments that have a temporary storage location for deleted files (Recycle Bin on Windows, Trash on Mac OS X, and freedesktop.org (KDE/Dolphin/Konqueror, GNOME/Nautilus, Xfce/Thunar)), the "Delete" option in Tux Paint's "Open" dialog could move the deleted picture & associated files to the temporary storage (Trash).

Discussion

  • William Kendrick

    Some notes re: xdg from 'auke' in the #meego IRC channel:

    http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

    $XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

    so, The location of Trash is: ${XDG_DATA_HOME:-$HOME/.local/share}/Trash

     
  • William Kendrick

    Freedesktop.org version implemented.

    To-do: Windows and Mac OS X.

     
  • William Kendrick

    dbus-send used to tell KDE when trash:/ needs to be re-reviewed (e.g., update trash icon on panel or desktop).

    To-do:
    * Make sure trash icons in other freedesktop.org-compatible environments (e.g., GNOME; also xcfe? others?) also get updated, somehow.
    * Figure out how to do this in Windows (95 thru 7, if possible!)
    * Figure out how to do this on Mac OS X
    * Figure out how to do this on Haiku
    * Expose and document 'UNLINK_ONLY' #define that can be used to revert Tux Paint back to the unlink() method (rather than only unlink()'ing if all else fails), which may be useful for some platforms (mobile?)

     
  • William Kendrick

    • Group: v0.9.22 --> v0.9.23
     
  • William Kendrick

    Still to-do:
    * macOS (@vindaci)
    * Haiku (@begasus)

    Anything else really worth worrying about?

     
  • William Kendrick

    @perepujal I see on Android there is also the concept of Trash, which i can access from a "Files" app. Photos I have taken and subsequently chosen to "Delete" (trash can icon when viewing the photo) appear there.

    I think it would make sense to place drawings that are removed within Tux Paint (via the Open dialog's "Erase" option) in there, as well -- so they may be recovered later, if necessary. Therefore, I'll keep this ticket open until we can do that (or decide it's not possible -- hopefully that won't be the case?). At that point, we'll have all major currently-supported platforms using their Trash instead of simply unlink()'ing -- Windows, macOS, XDG, Haiku, Android. :)

     
  • Pere Pujal i Carabantes

    AFAIK there is not a Trash can in AOSP and each maker or each app tries to do their own method, either using "services"(cloud, backup) or a dedicated hiden directory.

    I think we could implement something using a dedicated directory...

     
    • William Kendrick

      Searching around, it sounds like newer Android OS offers a way to view "trash" files, kind of...? https://www.androidpolice.com/2020/06/17/google-added-a-hidden-trash-can-to-android-11-for-deleted-files/

      Google has added a few features to the MediaStore API (which handles Scoped Storage operations) in Android 11, including a new createTrashRequest call that will 'trash' a file instead of deleting it immediately.

      Admittedly, my eyes glaze over whenever I start trying to look into any kind of mobile app development these days.

       

Log in to post a comment.