From da07604c7ef06036e1f3072187b8defc386e9bad Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 18 Oct 2014 18:18:10 +0000 Subject: PluginUpdater: -Minor cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@10826 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Common.h | 4 ++-- plugins/PluginUpdater/src/DlgListNew.cpp | 4 +--- plugins/PluginUpdater/src/DlgUpdate.cpp | 6 ++++-- plugins/PluginUpdater/src/Services.cpp | 2 +- plugins/PluginUpdater/src/Utils.cpp | 5 +---- 5 files changed, 9 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h index b8707860a9..299ab70858 100644 --- a/plugins/PluginUpdater/src/Common.h +++ b/plugins/PluginUpdater/src/Common.h @@ -140,7 +140,7 @@ using namespace std; extern HINSTANCE hInst; -extern TCHAR tszRoot[MAX_PATH], tszDialogMsg[2048], tszTempPath[MAX_PATH]; +extern TCHAR tszRoot[MAX_PATH], tszTempPath[MAX_PATH]; extern FILEINFO *pFileInfo; extern PlugOptions opts; extern POPUP_OPTIONS PopupOptions; @@ -208,7 +208,7 @@ void UnloadNetlib(); void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName); -bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes, bool isUpdate); +bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes); int CompareHashes(const ServListEntry *p1, const ServListEntry *p2); int GetUpdateMode(); diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 59b534d97e..2f4382fda7 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -337,8 +337,6 @@ static void __stdcall LaunchListDialog(void *param) static void GetList(void *) { - char szKey[64] = {0}; - TCHAR tszTempPath[MAX_PATH]; DWORD dwLen = GetTempPath(SIZEOF(tszTempPath), tszTempPath); if (tszTempPath[dwLen-1] == '\\') @@ -346,7 +344,7 @@ static void GetList(void *) ptrT updateUrl( GetDefaultUrl()), baseUrl; SERVLIST hashes(50, CompareHashes); - if (!ParseHashes(updateUrl, baseUrl, hashes, 0)) { + if (!ParseHashes(updateUrl, baseUrl, hashes)) { hListThread = NULL; return; } diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 18b223de8e..610afd1d7d 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -708,10 +708,12 @@ static void CheckUpdates(void *) if (tszTempPath[dwLen - 1] == '\\') tszTempPath[dwLen - 1] = 0; - ptrT updateUrl(GetDefaultUrl()), baseUrl; + if (!opts.bSilent) + ShowPopup(TranslateT("Plugin Updater"), TranslateT("Checking for new updates..."), POPUP_TYPE_INFO); + ptrT updateUrl(GetDefaultUrl()), baseUrl; SERVLIST hashes(50, CompareHashes); - bool success = ParseHashes(updateUrl, baseUrl, hashes, 1); + bool success = ParseHashes(updateUrl, baseUrl, hashes); if (success) { FILELIST *UpdateFiles = new FILELIST(20); VARST dirname(_T("%miranda_path%")); diff --git a/plugins/PluginUpdater/src/Services.cpp b/plugins/PluginUpdater/src/Services.cpp index 948f32eb97..9b44f0038d 100644 --- a/plugins/PluginUpdater/src/Services.cpp +++ b/plugins/PluginUpdater/src/Services.cpp @@ -28,7 +28,7 @@ static INT_PTR srvParseHashes(WPARAM wParam, LPARAM lParam) SERVLIST *pList = new SERVLIST(50, CompareHashes); ptrT baseUrl; - if ( ParseHashes(ptszUrl, baseUrl, *pList, 0)) { + if ( ParseHashes(ptszUrl, baseUrl, *pList)) { _tcsncpy(ptszBaseUrl, baseUrl, MAX_PATH); return (INT_PTR)pList; } diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index bf1258d4d9..26f6934f8e 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -189,7 +189,7 @@ int CompareHashes(const ServListEntry *p1, const ServListEntry *p2) return _tcsicmp(p1->m_name, p2->m_name); } -bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes, bool isUpdate) +bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) { REPLACEVARSARRAY vars[2]; vars[0].lptzKey = _T("platform"); @@ -206,9 +206,6 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes, bool i baseUrl = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)ptszUrl, (LPARAM)&dat); // Download version info - if (!opts.bSilent && isUpdate) - ShowPopup(TranslateT("Plugin Updater"), TranslateT("Checking for new updates..."), POPUP_TYPE_INFO); - FILEURL pFileUrl; mir_sntprintf(pFileUrl.tszDownloadURL, SIZEOF(pFileUrl.tszDownloadURL), _T("%s/hashes.zip"), baseUrl); mir_sntprintf(pFileUrl.tszDiskPath, SIZEOF(pFileUrl.tszDiskPath), _T("%s\\hashes.zip"), tszTempPath); -- cgit v1.2.3