diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2012-08-19 12:51:33 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2012-08-19 12:51:33 +0000 |
commit | b7923a051fc0a9e84edf5dbb0075347857ea4994 (patch) | |
tree | 23a6714a9403aa20f6e3db0263a4c57c38d50da9 | |
parent | 6d05dddfffae5920216ef044e18f46b03a7c3dc6 (diff) |
another unicode fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@1501 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/Weather/weather_icons.cpp | 32 | ||||
-rw-r--r-- | protocols/Weather/weather_update.cpp | 15 | ||||
-rw-r--r-- | protocols/Weather/weather_userinfo.cpp | 3 |
3 files changed, 23 insertions, 27 deletions
diff --git a/protocols/Weather/weather_icons.cpp b/protocols/Weather/weather_icons.cpp index 6669a64515..791f9c7a2d 100644 --- a/protocols/Weather/weather_icons.cpp +++ b/protocols/Weather/weather_icons.cpp @@ -23,24 +23,24 @@ HANDLE hIcoLibIconsChanged = NULL; struct _tag_iconList
{
- char* szDescr;
+ TCHAR* szDescr;
char* szName;
int defIconID;
HANDLE hIconLibItem;
}
static iconList[] =
{
- { "Protocol icon", "main", IDI_ICON },
- { "Update Disabled", "disabled", IDI_DISABLED },
- { "View Log", "log", IDI_LOG },
- { "Update with Clear", "update2", IDI_UPDATE2 },
- { "View Brief", "brief", IDI_S },
- { "View Complete", "read", IDI_READ },
- { "Weather Update", "update", IDI_UPDATE },
- { "Weather Map", "map", IDI_MAP },
- { "Popup", "popup", IDI_POPUP },
- { "No Popup", "nopopup", IDI_NOPOPUP },
- { "Edit Settings", "edit", IDI_EDIT },
+ { LPGENT("Protocol icon"), "main", IDI_ICON },
+ { LPGENT("Update Disabled"), "disabled", IDI_DISABLED },
+ { LPGENT("View Log"), "log", IDI_LOG },
+ { LPGENT("Update with Clear"), "update2", IDI_UPDATE2 },
+ { LPGENT("View Brief"), "brief", IDI_S },
+ { LPGENT("View Complete"), "read", IDI_READ },
+ { LPGENT("Weather Update"), "update", IDI_UPDATE },
+ { LPGENT("Weather Map"), "map", IDI_MAP },
+ { LPGENT("Popup"), "popup", IDI_POPUP },
+ { LPGENT("No Popup"), "nopopup", IDI_NOPOPUP },
+ { LPGENT("Edit Settings"), "edit", IDI_EDIT },
};
void InitIcons(void)
@@ -53,15 +53,15 @@ void InitIcons(void) sid.cbSize = sizeof(sid);
sid.ptszDefaultFile = szFile;
sid.pszName = szSettingName;
- sid.pszSection = WEATHERPROTONAME;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.ptszSection = _T(WEATHERPROTONAME);
+ sid.flags = SIDF_ALL_TCHAR;
for (int i = 0; i < SIZEOF(iconList); i++) {
mir_snprintf(szSettingName, SIZEOF( szSettingName ), "%s_%s", WEATHERPROTONAME, iconList[i].szName);
- sid.pszDescription = iconList[i].szDescr;
+ sid.ptszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- iconList[i].hIconLibItem = ( HANDLE )Skin_AddIcon(&sid);
+ iconList[i].hIconLibItem = Skin_AddIcon(&sid);
} }
HICON LoadIconEx(const char* name, BOOL big)
diff --git a/protocols/Weather/weather_update.cpp b/protocols/Weather/weather_update.cpp index f114b80acc..3e6c2c6120 100644 --- a/protocols/Weather/weather_update.cpp +++ b/protocols/Weather/weather_update.cpp @@ -37,13 +37,8 @@ extern HANDLE hUpdateMutex; int UpdateWeather(HANDLE hContact)
{
TCHAR str[256], str2[MAX_TEXT_SIZE];
- int code;
- FILE *file;
DBVARIANT dbv;
BOOL Ch = FALSE;
- WEATHERINFO winfo;
- HWND hMoreDataDlg;
- int dbres;
if (hContact == NULL) return 1; // some error prevention
@@ -51,13 +46,13 @@ int UpdateWeather(HANDLE hContact) // log to netlib log for debug purpose
Netlib_Logf(hNetlibUser, "************************************************************************");
- dbres = DBGetContactSettingTString(hContact, WEATHERPROTONAME, "Nick", &dbv);
+ int dbres = DBGetContactSettingTString(hContact, WEATHERPROTONAME, "Nick", &dbv);
Netlib_Logf(hNetlibUser, "<-- Start update for station -->");
// download the info and parse it
// result are stored in database
- code = GetWeatherData(hContact);
+ int code = GetWeatherData(hContact);
if (code != 0)
{
// error occurs if the return value is not equals to 0
@@ -78,7 +73,7 @@ int UpdateWeather(HANDLE hContact) if (!dbres) DBFreeVariant(&dbv);
// initialize, load new weather Data
- winfo = LoadWeatherInfo(hContact);
+ WEATHERINFO winfo = LoadWeatherInfo(hContact);
// translate weather condition
_tcscpy(winfo.cond, TranslateTS(winfo.cond));
@@ -176,7 +171,7 @@ int UpdateWeather(HANDLE hContact) if (DBGetContactSettingByte(hContact,WEATHERPROTONAME,"Overwrite",0))
DeleteFile(dbv.ptszVal);
// open the file and set point to the end of file
- file = fopen( dbv.pszVal, "a");
+ FILE *file = _tfopen( dbv.ptszVal, _T("a"));
DBFreeVariant(&dbv);
if (file != NULL) {
// write data to the file and close
@@ -212,7 +207,7 @@ int UpdateWeather(HANDLE hContact) UpdateMwinData(hContact);
// update brief info if its opened
- hMoreDataDlg = WindowList_Find(hDataWindowList, hContact);
+ HWND hMoreDataDlg = WindowList_Find(hDataWindowList, hContact);
if (hMoreDataDlg != NULL) PostMessage(hMoreDataDlg, WM_UPDATEDATA, 0, 0);
return 0;
}
diff --git a/protocols/Weather/weather_userinfo.cpp b/protocols/Weather/weather_userinfo.cpp index cac28fb34b..84c63d4d4d 100644 --- a/protocols/Weather/weather_userinfo.cpp +++ b/protocols/Weather/weather_userinfo.cpp @@ -44,6 +44,7 @@ int UserInfoInit(WPARAM wParam, LPARAM lParam) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO);
odp.pfnDlgProc = DlgProcINIPage;
+ odp.flags = ODPF_TCHAR;
UserInfo_AddPage(wParam, &odp);
}
else
@@ -285,7 +286,7 @@ INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ListView_DeleteAllItems(hList);
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.lParam = 1;
- lvi.pszText = (LPTSTR)_T("");
+ lvi.pszText = _T("");
lvi.iItem = ListView_InsertItem(hList, &lvi);
lvi.pszText = TranslateT("Retrieving new data, please wait...");
ListView_SetItemText(hList, lvi.iItem, 1, lvi.pszText);
|