flathub / com.syntevo.SmartGit

https://flathub.org/apps/details/com.syntevo.SmartGit
3 stars 3 forks source link

Move to Trash doesn't work as expected #34

Closed x80486 closed 3 years ago

x80486 commented 4 years ago

If someone tries to use the "Move to Trash" option within the Files panel, it returns an error:

Move to Trash: Could not move '/home/x80486/Workshop/kotlin-aws-serverless/gradle.build.kts' to trash.; /home/.Trash-1000

I guess the trick is to find out how to access the user's Trash subdirectory/location.

TingPing commented 4 years ago

Well it needs to use the portal for it: https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-org.freedesktop.portal.Trash

gio trash is a tool to do it if its at all configurable.

x80486 commented 4 years ago

I think this ball is entirely on the @syntevo side; I have no idea what is it what is getting executed on the click on that button, except for the (error) message.

By the way, this is a Java application; I guess the way those portals are used outside C/C++ is through bindings, right?

tmssngr commented 4 years ago

SmartGit move-to-trash feature directly operates on the file system according to the specification from https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html. It works fine on normal Linux machines. At the moment we have no plan to turn the whole code upside down to just work around such FlatPak restrictions.

TingPing commented 4 years ago

Then it just is forever broken in all sandboxed applications (Snap, Flatpak, etc).

tmssngr commented 3 years ago

Alternatively, SmartGit also can use the /usr/bin/trash-put command.

TingPing commented 3 years ago

Alternatively, SmartGit also can use the /usr/bin/trash-put command.

That is more workable, somebody can provide a version of that which works inside the sandbox. I'm not sure where best to request that.

TingPing commented 3 years ago

Maybe here: https://github.com/flatpak/flatpak-xdg-utils

TingPing commented 3 years ago

Alternatively this package can bundle a simple script in /app/bin/ that is good enough.

x80486 commented 3 years ago

This is working automagically. Can't tell if it's because something changed on the SmartGit side, or because the new GNOME 41 release 🤷🏻‍♂️