From ad4e3d2c55e75193c41356c23619f80add41db18 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 2 Oct 2015 14:57:46 +0200 Subject: 7.5 --- zen/recycler.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'zen/recycler.h') diff --git a/zen/recycler.h b/zen/recycler.h index 7c63cf8a..3df7fda2 100644 --- a/zen/recycler.h +++ b/zen/recycler.h @@ -21,7 +21,8 @@ namespace zen Windows ------- -Recycler API always available: during runtime either SHFileOperation or IFileOperation (since Vista) will be dynamically selected +-> Recycler API always available: during runtime either SHFileOperation or IFileOperation (since Vista) will be dynamically selected +-> COM needs to be initialized before calling any of these functions! CoInitializeEx/CoUninitialize Linux ----- @@ -31,15 +32,18 @@ Linker flags: `pkg-config --libs gio-2.0` Already included in package "gtk+-2.0"! */ + + //move a file or folder to Recycle Bin (deletes permanently if recycler is not available) -> crappy semantics, but we have no choice thanks to Windows' design -bool recycleOrDelete(const Zstring& itempath); //throw FileError, return "true" if file/dir was actually deleted +bool recycleOrDelete(const Zstring& itemPath); //throw FileError, return "true" if file/dir was actually deleted #ifdef ZEN_WIN //Win XP: can take a long time if recycle bin is full and drive is slow!!! => buffer result! -bool recycleBinExists(const Zstring& dirpath, const std::function& onUpdateGui); //throw FileError +//Vista and later: dirPath must exist for a valid check! +bool recycleBinExists(const Zstring& dirPath, const std::function& onUpdateGui); //throw FileError -void recycleOrDelete(const std::vector& filepaths, //throw FileError, return "true" if file/dir was actually deleted +void recycleOrDelete(const std::vector& filePaths, //throw FileError, return "true" if file/dir was actually deleted const std::function& onRecycleItem); //optional; currentItem may be empty #endif } -- cgit