Closed VioletGiraffe closed 6 years ago
The deletion prompt dialog is my own and is displayed every time you want to delete something.
The deletion prompt dialog is my own and is displayed every time you want to delete something.
Alright, then it's simply a task of adding a flag to CSettings
and a platform specific shortcut. Think that's ok, though I'd prefer system dialogs, if available.
I use the system deletion API (hence the system dialog) on Windows, but I don't know the first thing about OS X APIs. If you want to implement the files deletion via native API - be my guest! :)
Hm ... Qt doesn't provide a QFile::moveToTrash
method so far. So the first thing I did was reviving a very old issue dating back to 2006 (Wowsa!). If interested, see here.
Anyway, there's implementations for XDG (Linux/FreeBSD and others) and OSX floating around the web. As I'm running a Linux, I can help with that part. The best I could find so far is located on stackoverflow. Another good information resource is the send2trash Python module.
Well done, upvoted the issue.
Does the dialog appear by itself? Then it can be easily turned off by the user in the OSX system preferences.
IIRC the "Do you want to move file to trash?" prompt is enabled/disabled via a "system setting" for Finder. I did some investigation and am not totally sure, but you should have a look into the file
~/Library/Preferences/com.apple.finder.plist
. The file contains binary data and if you want to open it, you need a special plist editor (builtin on OSX, but available for windows as well).This should be respected here to preserve native behaviour. The
QSettings
class can handle plist files. Something like this should go fine: