summaryrefslogtreecommitdiff
path: root/zen/recycler.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2015-10-02 14:57:46 +0200
committerDaniel Wilhelm <daniel@wili.li>2015-10-02 14:57:46 +0200
commitad4e3d2c55e75193c41356c23619f80add41db18 (patch)
treedd836d120f50e472106e04968ef8185c25e4242e /zen/recycler.h
parent7.4 (diff)
downloadFreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.tar.gz
FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.tar.bz2
FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.zip
7.5
Diffstat (limited to 'zen/recycler.h')
-rw-r--r--zen/recycler.h12
1 files changed, 8 insertions, 4 deletions
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<void ()>& onUpdateGui); //throw FileError
+//Vista and later: dirPath must exist for a valid check!
+bool recycleBinExists(const Zstring& dirPath, const std::function<void ()>& onUpdateGui); //throw FileError
-void recycleOrDelete(const std::vector<Zstring>& filepaths, //throw FileError, return "true" if file/dir was actually deleted
+void recycleOrDelete(const std::vector<Zstring>& filePaths, //throw FileError, return "true" if file/dir was actually deleted
const std::function<void (const std::wstring& displayPath)>& onRecycleItem); //optional; currentItem may be empty
#endif
}
bgstack15