summaryrefslogtreecommitdiff
path: root/zen/recycler.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2015-10-02 14:52:29 +0200
committerDaniel Wilhelm <daniel@wili.li>2015-10-02 14:52:29 +0200
commitd3e1925aa7388cd842408032621fae29133dd971 (patch)
tree02e0bd2fdc4bf0214d15c829d9ad5eebb0a03d38 /zen/recycler.cpp
parent6.8 (diff)
downloadFreeFileSync-d3e1925aa7388cd842408032621fae29133dd971.tar.gz
FreeFileSync-d3e1925aa7388cd842408032621fae29133dd971.tar.bz2
FreeFileSync-d3e1925aa7388cd842408032621fae29133dd971.zip
6.9
Diffstat (limited to 'zen/recycler.cpp')
-rw-r--r--zen/recycler.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/zen/recycler.cpp b/zen/recycler.cpp
index 41ea6002..930b05ac 100644
--- a/zen/recycler.cpp
+++ b/zen/recycler.cpp
@@ -84,20 +84,21 @@ void zen::recycleOrDelete(const std::vector<Zstring>& itempaths, const std::func
if (vistaOrLater()) //new recycle bin usage: available since Vista
{
- using namespace fileop;
- const DllFun<FunType_moveToRecycleBin > moveToRecycler (getDllName(), funName_moveToRecycleBin);
- const DllFun<FunType_getLastErrorMessage> getLastErrorMessage(getDllName(), funName_getLastErrorMessage);
+#define DEF_DLL_FUN(name) const DllFun<fileop::FunType_##name> name(fileop::getDllName(), fileop::funName_##name);
+DEF_DLL_FUN(moveToRecycleBin);
+DEF_DLL_FUN(getLastErrorMessage);
+#undef DEF_DLL_FUN
- if (!moveToRecycler || !getLastErrorMessage)
+ if (!moveToRecycleBin || !getLastErrorMessage)
throw FileError(replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(itempaths[0])),
- replaceCpy(_("Cannot load file %x."), L"%x", fmtFileName(getDllName())));
+ replaceCpy(_("Cannot load file %x."), L"%x", fmtFileName(fileop::getDllName())));
std::vector<const wchar_t*> cNames;
for (auto it = itempaths.begin(); it != itempaths.end(); ++it) //CAUTION: do not create temporary strings here!!
cNames.push_back(it->c_str());
CallbackData cbd(notifyDeletionStatus);
- if (!moveToRecycler(&cNames[0], cNames.size(), onRecyclerCallback, &cbd))
+ if (!moveToRecycleBin(&cNames[0], cNames.size(), onRecyclerCallback, &cbd))
{
if (cbd.exceptionInUserCallback)
{
bgstack15