diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2012-08-23 09:59:01 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2012-08-23 09:59:01 +0000 |
commit | 38fd059aded00e4ed846bf35779f4bbcf7133f0d (patch) | |
tree | 83880b3180d28767450e760ded72153f1aaa99fa /protocols/Weather/weather_update.cpp | |
parent | 30d46fcb06781d1277483208488596daab65d09a (diff) |
*fix for logging UTF8 events
*fix for unicode logging
*fix for unicode templates
*removed support for old Miranda
git-svn-id: http://svn.miranda-ng.org/main/trunk@1524 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Weather/weather_update.cpp')
-rw-r--r-- | protocols/Weather/weather_update.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/protocols/Weather/weather_update.cpp b/protocols/Weather/weather_update.cpp index 3e6c2c6120..c4c78edec8 100644 --- a/protocols/Weather/weather_update.cpp +++ b/protocols/Weather/weather_update.cpp @@ -45,10 +45,10 @@ int UpdateWeather(HANDLE hContact) dbv.pszVal = "";
// log to netlib log for debug purpose
- Netlib_Logf(hNetlibUser, "************************************************************************");
+ Netlib_LogfT(hNetlibUser, _T("************************************************************************"));
int dbres = DBGetContactSettingTString(hContact, WEATHERPROTONAME, "Nick", &dbv);
- Netlib_Logf(hNetlibUser, "<-- Start update for station -->");
+ Netlib_LogfT(hNetlibUser, _T("<-- Start update for station -->"));
// download the info and parse it
// result are stored in database
@@ -65,8 +65,8 @@ int UpdateWeather(HANDLE hContact) WPShowMessage(str, SM_WARNING);
}
// log to netlib
- Netlib_Logf(hNetlibUser, "Error! Update cannot continue... Start to free memory");
- Netlib_Logf(hNetlibUser, "<-- Error occurs while updating station: %s -->", dbv.ptszVal);
+ Netlib_LogfT(hNetlibUser, _T("Error! Update cannot continue... Start to free memory"));
+ Netlib_LogfT(hNetlibUser, _T("<-- Error occurs while updating station: %s -->"), dbv.ptszVal);
if (!dbres) DBFreeVariant(&dbv);
return 1;
}
@@ -187,7 +187,7 @@ int UpdateWeather(HANDLE hContact) dbei.cbSize = sizeof(dbei);
dbei.szModule = WEATHERPROTONAME;
dbei.timestamp = (DWORD)time(NULL);
- dbei.flags = DBEF_READ;
+ dbei.flags = DBEF_READ|DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.pBlob = (PBYTE)mir_utf8encodeT(str2);
dbei.cbBlob = (DWORD)strlen((char*)dbei.pBlob)+1;
@@ -200,8 +200,8 @@ int UpdateWeather(HANDLE hContact) NotifyEventHooks(hHookWeatherUpdated, (WPARAM)hContact, (LPARAM)Ch);
}
- Netlib_Logf(hNetlibUser, "Update Completed - Start to free memory");
- Netlib_Logf(hNetlibUser, "<-- Update successful for station -->");
+ Netlib_LogfT(hNetlibUser, _T("Update Completed - Start to free memory"));
+ Netlib_LogfT(hNetlibUser, _T("<-- Update successful for station -->"));
// Update frame data
UpdateMwinData(hContact);
@@ -219,9 +219,7 @@ int UpdateWeather(HANDLE hContact) // hContact = current contact
void UpdateListAdd(HANDLE hContact)
{
- UPDATELIST *newItem;
-
- newItem = (UPDATELIST*)mir_alloc(sizeof(UPDATELIST));
+ UPDATELIST *newItem = (UPDATELIST*)mir_alloc(sizeof(UPDATELIST));
newItem->hContact = hContact;
newItem->next = NULL;
@@ -260,11 +258,9 @@ HANDLE UpdateGetFirst() void DestroyUpdateList(void)
{
- UPDATELIST *temp;
-
WaitForSingleObject(hUpdateMutex, INFINITE);
- temp = UpdateListHead;
+ UPDATELIST *temp = UpdateListHead;
// free the list one by one
while (temp != NULL)
|