summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/unzipfile.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2014-07-30 16:43:12 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2014-07-30 16:43:12 +0000
commit9605b9e05204882e1c6ac62fcf29fffe457331aa (patch)
tree3c2579a40b1f8cae073965369dc6fae82a9655d1 /plugins/PluginUpdater/src/unzipfile.cpp
parent87b6a1ccf47c706cd3d8f5aecf72e894b9e53d25 (diff)
Do not unzip icon from plugin's archive when icon component is unchecked
git-svn-id: http://svn.miranda-ng.org/main/trunk@9996 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/unzipfile.cpp')
-rw-r--r--plugins/PluginUpdater/src/unzipfile.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/PluginUpdater/src/unzipfile.cpp b/plugins/PluginUpdater/src/unzipfile.cpp
index 24da1147a4..c0d0592e07 100644
--- a/plugins/PluginUpdater/src/unzipfile.cpp
+++ b/plugins/PluginUpdater/src/unzipfile.cpp
@@ -45,7 +45,7 @@ void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName)
SafeMoveFile(ptszSrcFileName, ptszBackFileName);
}
-bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
+bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bool ch)
{
unz_file_info64 file_info;
char filename[MAX_PATH], buf[8192];
@@ -56,6 +56,9 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
for (char *p = strchr(filename, '/'); p; p = strchr(p+1, '/'))
*p = '\\';
+
+ if (ch && !db_get_b(NULL, MODNAME "Files", StrToLower(ptrA(mir_strdup(filename))), 1))
+ return true;
TCHAR tszDestFile[MAX_PATH], tszBackFile[MAX_PATH];
TCHAR *ptszNewName = mir_utf8decodeT(filename);
@@ -118,7 +121,7 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
return true;
}
-bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
+bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath,bool ch)
{
bool bResult = true;
@@ -128,7 +131,7 @@ bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath)
unzFile uf = unzOpen2_64(ptszZipFile, &ffunc);
if (uf) {
do {
- if (!extractCurrentFile(uf, ptszDestPath, ptszBackPath))
+ if (!extractCurrentFile(uf, ptszDestPath, ptszBackPath,ch))
bResult = false;
}
while (unzGoToNextFile(uf) == UNZ_OK);