diff options
author | George Hazan <george.hazan@gmail.com> | 2023-07-19 15:23:41 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-07-19 15:23:41 +0300 |
commit | 1f093124cba611950c465933812736315a0f630b (patch) | |
tree | 44f20aef24519cc4291fd15ec62d75cd044e3729 /plugins/PluginUpdater | |
parent | db8b4d13f503fb472ae9c8c2314597ede2ed6e98 (diff) |
fixes #3587 (PluginUpdater: не создавать пустой бэкап, когда существующие файлы не изменились)
Diffstat (limited to 'plugins/PluginUpdater')
-rw-r--r-- | plugins/PluginUpdater/src/DlgListNew.cpp | 10 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 3 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/version.h | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index f406d96b3b..44fa701c89 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -324,7 +324,15 @@ public: }
Netlib_CloseHandle(nlc);
- RemoveBackupFolders();
+ int iFileCount = 0; // considering files . & ..
+ for (auto &it : MFilePath(wszBackupFolder).search())
+ if (mir_wstrcmp(it.getPath(), L".") && mir_wstrcmp(it.getPath(), L".."))
+ iFileCount++;
+
+ if (iFileCount == 0)
+ PU::SafeDeleteDirectory(wszBackupFolder);
+ else
+ RemoveBackupFolders();
ShowPopup(TranslateT("Plugin Updater"), TranslateT("Download complete"), POPUP_TYPE_INFO);
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 9a13d78737..d93f499a7a 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -618,8 +618,7 @@ static int ScanFolder(const wchar_t *pwszFolder, size_t cbBaseLen, const wchar_t int count = 0;
- MFilePath wszBuf;
- wszBuf.Format(L"%s\\*", pwszFolder);
+ MFilePath wszBuf(pwszFolder);
for (auto &ff: wszBuf.search()) {
TFileName wszNewName;
diff --git a/plugins/PluginUpdater/src/version.h b/plugins/PluginUpdater/src/version.h index fbfd07b5cd..8269e41d35 100644 --- a/plugins/PluginUpdater/src/version.h +++ b/plugins/PluginUpdater/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 2
#define __RELEASE_NUM 1
-#define __BUILD_NUM 5
+#define __BUILD_NUM 6
#include <stdver.h>
|