From 5d0dff54982b174d382aca8da00393273bc7b3e5 Mon Sep 17 00:00:00 2001
From: George Hazan <ghazan@miranda.im>
Date: Tue, 8 Sep 2020 13:21:50 +0300
Subject: DeleteDirectoryTreeW - new function that deletes a folder with all
 subfolders (recursively)

---
 plugins/PackUpdater/Src/Events.cpp | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

(limited to 'plugins/PackUpdater')

diff --git a/plugins/PackUpdater/Src/Events.cpp b/plugins/PackUpdater/Src/Events.cpp
index 3745f37732..0a59c5b14a 100644
--- a/plugins/PackUpdater/Src/Events.cpp
+++ b/plugins/PackUpdater/Src/Events.cpp
@@ -51,21 +51,9 @@ INT_PTR MenuCommand(WPARAM, LPARAM)
 	return 0;
 }
 
-INT_PTR EmptyFolder(WPARAM, LPARAM lParam)
+INT_PTR EmptyFolder(WPARAM, LPARAM)
 {
-	SHFILEOPSTRUCT file_op = {
-		nullptr,
-		FO_DELETE,
-		tszRoot,
-		L"",
-		FOF_NOERRORUI |
-		FOF_SILENT,
-		false,
-		nullptr,
-		L"" };
-	if (lParam)
-		file_op.fFlags |= FOF_NOCONFIRMATION;
-	SHFileOperation(&file_op);
+	DeleteDirectoryTreeW(tszRoot);
 	return 0;
 }
 
-- 
cgit v1.2.3