summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-30 11:50:38 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-30 11:50:38 +0000
commitc2c8016a4f56b10299b279c64370e304265e7c3b (patch)
tree30058c8f2d56f01dfd2099f8636e022d01e00bb7 /plugins/PluginUpdater/src/Utils.cpp
parent40d145149e5d95415fde7c3927706f9dd447902c (diff)
source code unification
git-svn-id: http://svn.miranda-ng.org/main/trunk@1726 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Utils.cpp')
-rw-r--r--plugins/PluginUpdater/src/Utils.cpp44
1 files changed, 36 insertions, 8 deletions
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp
index 1886d02c01..737df21960 100644
--- a/plugins/PluginUpdater/src/Utils.cpp
+++ b/plugins/PluginUpdater/src/Utils.cpp
@@ -19,12 +19,10 @@ Boston, MA 02111-1307, USA.
#include "Common.h"
-//vector<FILEINFO> Files;
BOOL DlgDld;
int Number = 0;
TCHAR tszDialogMsg[2048] = {0};
FILEINFO* pFileInfo = NULL;
-//FILEURL* pFileUrl = NULL;
HANDLE CheckThread = NULL, hNetlibUser = NULL;
POPUP_OPTIONS PopupOptions = {0};
aPopups PopupsList[POPUPS];
@@ -128,7 +126,11 @@ BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal)
DWORD dwBytes;
NETLIBHTTPREQUEST nlhr = {0};
- nlhr.cbSize = sizeof(nlhr);
+ #if MIRANDA_VER < 0x0A00
+ nlhr.cbSize = NETLIBHTTPREQUEST_V1_SIZE;
+ #else
+ nlhr.cbSize = sizeof(nlhr);
+ #endif
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11;
char* szUrl = mir_t2a(tszURL);
@@ -164,13 +166,9 @@ BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal)
return ret;
}
-void __stdcall ExitMe(void*)
-{
- CallService("CloseAction", 0, 0);
-}
-
void __stdcall RestartMe(void*)
{
+ CallService("CloseAction", 0, 0);
CallService(MS_SYSTEM_RESTART, 0, 0);
}
@@ -227,3 +225,33 @@ void InitTimer()
SetWaitableTimer(Timer, &li, interval, TimerAPCProc, NULL, 0);
}
}
+
+#if MIRANDA_VER < 0x0A00
+char* rtrim(char* str)
+{
+ if (str == NULL)
+ return NULL;
+
+ char* p = strchr(str, 0);
+ while (--p >= str) {
+ switch (*p) {
+ case ' ': case '\t': case '\n': case '\r':
+ *p = 0; break;
+ default:
+ return str;
+ }
+ }
+ return str;
+}
+
+void CreatePathToFileT(TCHAR* szFilePath)
+{
+ TCHAR* pszLastBackslash = _tcsrchr(szFilePath, '\\');
+ if (pszLastBackslash == NULL)
+ return;
+
+ *pszLastBackslash = '\0';
+ CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)szFilePath);
+ *pszLastBackslash = '\\';
+}
+#endif