From 6cd5066a4a158b7d6ec0ca5c210c51b251c8c14d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 25 Mar 2014 15:21:45 +0000 Subject: attempt to use masks in PU git-svn-id: http://svn.miranda-ng.org/main/trunk@8740 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/DlgUpdate.cpp | 73 ++++++++++++--------------------- plugins/PluginUpdater/src/Version.h | 2 +- 2 files changed, 27 insertions(+), 48 deletions(-) (limited to 'plugins/PluginUpdater') diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index ac9a8b1fab..09b9933d22 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -360,58 +360,37 @@ static renameTable[] = { _T("dbx_mmap_sa.dll"), _T("Plugins\\dbx_mmap.dll") }, { _T("proto_newsaggr.dll"), _T("Icons\\proto_newsaggregator.dll") }, - { _T("clienticons_general.dll"), _T("Icons\\fp_icons.dll") }, - { _T("clienticons_miranda.dll"), _T("Icons\\fp_icons.dll") }, - { _T("fp_icq.dll"), _T("Icons\\fp_icons.dll") }, - { _T("fp_jabber.dll"), _T("Icons\\fp_icons.dll") }, - { _T("clienticons_aim.dll"), _T("") }, - { _T("clienticons_gadu.dll"), _T("") }, - { _T("clienticons_gg.dll"), _T("") }, - { _T("clienticons_icq.dll"), _T("") }, - { _T("clienticons_irc.dll"), _T("") }, - { _T("clienticons_jabber.dll"), _T("") }, - { _T("clienticons_mra.dll"), _T("") }, - { _T("clienticons_msn.dll"), _T("") }, - { _T("clienticons_multiproto.dll"), _T("") }, - { _T("clienticons_multiprotocols.dll"), _T("") }, - { _T("clienticons_others.dll"), _T("") }, - { _T("clienticons_overlays.dll"), _T("") }, - { _T("clienticons_packs.dll"), _T("") }, - { _T("clienticons_qq.dll"), _T("") }, - { _T("clienticons_rss.dll"), _T("") }, - { _T("clienticons_skype.dll"), _T("") }, - { _T("clienticons_tlen.dll"), _T("") }, - { _T("clienticons_voip.dll"), _T("") }, - { _T("clienticons_weather.dll"), _T("") }, - { _T("clienticons_yahoo.dll"), _T("") }, - { _T("fp_aim.dll"), _T("") }, - { _T("fp_c6_mra_skype.dll"), _T("") }, - { _T("fp_gg.dll"), _T("") }, - { _T("fp_irc.dll"), _T("") }, - { _T("fp_msn.dll"), _T("") }, - { _T("fp_packs.dll"), _T("") }, - { _T("fp_qq.dll"), _T("") }, - { _T("fp_rss.dll"), _T("") }, - { _T("fp_tlen.dll"), _T("") }, - { _T("fp_weather.dll"), _T("") }, - { _T("fp_yahoo.dll"), _T("") }, - - { _T("clist_classic.dll"), _T("") }, - { _T("chat.dll"), _T("") }, - { _T("gender.dll"), _T("") }, - { _T("srmm.dll"), _T("") }, - { _T("extraicons.dll"), _T("") }, - { _T("langman.dll"), _T("") }, - { _T("metacontacts.dll"), _T("") }, + { _T("clienticons_*.dll"), _T("Icons\\fp_icons.dll") }, + { _T("fp_*.dll"), _T("Icons\\fp_icons.dll") }, + + { _T("langpack_*.txt"), _T("Languages\\*") }, + + { _T("clist_classic.dll"), NULL }, + { _T("chat.dll"), NULL }, + { _T("gender.dll"), NULL }, + { _T("srmm.dll"), NULL }, + { _T("extraicons.dll"), NULL }, + { _T("langman.dll"), NULL }, + { _T("metacontacts.dll"), NULL }, }; static bool CheckFileRename(const TCHAR *ptszOldName, TCHAR *pNewName) { - for (int i=0; i < SIZEOF(renameTable); i++) - if (!_tcsicmp(ptszOldName, renameTable[i].oldName)) { - _tcscpy(pNewName, renameTable[i].newName); - return true; + for (int i = 0; i < SIZEOF(renameTable); i++) { + if (!wildcmpit(ptszOldName, renameTable[i].oldName)) + continue; + + TCHAR *ptszDest = renameTable[i].newName; + if (ptszDest == NULL) + *pNewName = 0; + else { + _tcsncpy_s(pNewName, MAX_PATH, ptszDest, _TRUNCATE); + size_t cbLen = _tcslen(ptszDest) - 1; + if (pNewName[cbLen] == '*') + _tcsncpy_s(pNewName + cbLen, MAX_PATH - cbLen, ptszOldName, _TRUNCATE); } + return true; + } return false; } diff --git a/plugins/PluginUpdater/src/Version.h b/plugins/PluginUpdater/src/Version.h index 7a2d8d317a..891e33d56f 100644 --- a/plugins/PluginUpdater/src/Version.h +++ b/plugins/PluginUpdater/src/Version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 1 #define __RELEASE_NUM 1 -#define __BUILD_NUM 7 +#define __BUILD_NUM 8 #include -- cgit v1.2.3