From 428bf0cbd77813a43094cb5c984436deff251936 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 29 Jul 2016 12:36:34 +0000 Subject: no more TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather.cpp | 4 +- plugins/Weather/src/weather_addstn.cpp | 22 +++++------ plugins/Weather/src/weather_contacts.cpp | 54 +++++++++++++-------------- plugins/Weather/src/weather_conv.cpp | 8 ++-- plugins/Weather/src/weather_data.cpp | 58 ++++++++++++++--------------- plugins/Weather/src/weather_http.cpp | 2 +- plugins/Weather/src/weather_info.cpp | 2 +- plugins/Weather/src/weather_mwin.cpp | 26 ++++++------- plugins/Weather/src/weather_opt.cpp | 64 ++++++++++++++++---------------- plugins/Weather/src/weather_popup.cpp | 8 ++-- plugins/Weather/src/weather_svcs.cpp | 2 +- plugins/Weather/src/weather_update.cpp | 58 ++++++++++++++--------------- 12 files changed, 154 insertions(+), 154 deletions(-) (limited to 'plugins/Weather') diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index c1c2f26f67..b3190f0b78 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -226,8 +226,8 @@ extern "C" int __declspec(dllexport) Load(void) InitServices(); // add sound event - SkinAddNewSoundExT("weatherupdated", _A2W(WEATHERPROTONAME), LPGENW("Weather Condition Changed")); - SkinAddNewSoundExT("weatheralert", _A2W(WEATHERPROTONAME), LPGENW("Weather Alert Issued")); + SkinAddNewSoundExW("weatherupdated", _A2W(WEATHERPROTONAME), LPGENW("Weather Condition Changed")); + SkinAddNewSoundExW("weatheralert", _A2W(WEATHERPROTONAME), LPGENW("Weather Alert Issued")); // window needed for popup commands wchar_t SvcFunc[100]; diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index c9a276a484..8cdd7c98ed 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -44,7 +44,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) if (IsMyContact(hContact)) { DBVARIANT dbv; // check ID to see if the contact already exist in the database - if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) { if (!mir_wstrcmpi(psr->email.w, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the contact visible // and add them on the list @@ -75,7 +75,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) // set settings by obtaining the default for the service if (psr->lastName.w[0] != 0) { WIDATA *sData = GetWIData(svc); - db_set_ts(hContact, WEATHERPROTONAME, "MapURL", sData->DefaultMap); + db_set_ws(hContact, WEATHERPROTONAME, "MapURL", sData->DefaultMap); db_set_s(hContact, WEATHERPROTONAME, "InfoURL", sData->DefaultURL); } else { // if no valid service is found, create empty strings for MapURL and InfoURL @@ -83,15 +83,15 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) db_set_s(hContact, WEATHERPROTONAME, "InfoURL", ""); } // write the other info and settings to the database - db_set_ts(hContact, WEATHERPROTONAME, "ID", psr->email.w); - db_set_ts(hContact, WEATHERPROTONAME, "Nick", psr->nick.w); + db_set_ws(hContact, WEATHERPROTONAME, "ID", psr->email.w); + db_set_ws(hContact, WEATHERPROTONAME, "Nick", psr->nick.w); db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE); AvatarDownloaded(hContact); wchar_t str[256]; mir_snwprintf(str, TranslateT("Current weather information for %s."), psr->nick.w); - db_set_ts(hContact, WEATHERPROTONAME, "About", str); + db_set_ws(hContact, WEATHERPROTONAME, "About", str); // make the last update tags to something invalid db_set_s(hContact, WEATHERPROTONAME, "LastLog", "never"); @@ -107,13 +107,13 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) GetStationID(hContact, opt.Default, _countof(opt.Default)); opt.DefStn = hContact; - if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) { // notification message box mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); db_free(&dbv); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION); } - db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); + db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default); } // display the Edit Settings dialog box EditSettings(hContact, 0); @@ -255,7 +255,7 @@ int IDSearchProc(wchar_t *sID, const int searchId, WIIDSEARCH *sData, wchar_t *s // set the search result and broadcast it PROTOSEARCHRESULT psr = { sizeof(psr) }; - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.nick.w = str; psr.firstName.w = L" "; psr.lastName.w = svcname; @@ -286,7 +286,7 @@ int IDSearch(wchar_t *sID, const int searchId) else { // return an empty contact on "#" PROTOSEARCHRESULT psr = { sizeof(psr) }; - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.nick.w = TranslateT(""); // to be entered psr.firstName.w = L" "; psr.lastName.w = L""; @@ -348,7 +348,7 @@ int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar // set the data and broadcast it PROTOSEARCHRESULT psr = { sizeof(psr) }; - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.nick.w = Name; psr.firstName.w = L" "; psr.lastName.w = svcname; @@ -386,7 +386,7 @@ int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar wcsncpy(Name, name, _countof(Name)); PROTOSEARCHRESULT psr = { sizeof(psr) }; - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.nick.w = Name; psr.firstName.w = L""; psr.lastName.w = svcname; diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 80e7d5f970..9903cbf010 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -41,7 +41,7 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam) { // see if the log path is set DBVARIANT dbv; - if (!db_get_ts(wParam, WEATHERPROTONAME, "Log", &dbv)) { + if (!db_get_ws(wParam, WEATHERPROTONAME, "Log", &dbv)) { if (dbv.pszVal[0] != 0) ShellExecute((HWND)lParam, L"open", dbv.ptszVal, L"", L"", SW_SHOW); db_free(&dbv); @@ -60,7 +60,7 @@ INT_PTR LoadForecast(WPARAM wParam, LPARAM) GetStationID(wParam, id, _countof(id)); if (id[0] != 0) { // check if the complte forecast URL is set. If it is not, display warning and quit - if (db_get_tstatic(wParam, WEATHERPROTONAME, "InfoURL", loc2, _countof(loc2)) || loc2[0] == 0) { + if (db_get_wstatic(wParam, WEATHERPROTONAME, "InfoURL", loc2, _countof(loc2)) || loc2[0] == 0) { MessageBox(NULL, NO_FORECAST_URL, TranslateT("Weather Protocol"), MB_ICONINFORMATION); return 1; } @@ -78,7 +78,7 @@ INT_PTR WeatherMap(WPARAM wParam, LPARAM) GetStationID(wParam, id, _countof(id)); if (id[0] != 0) { // check if the weather map URL is set. If it is not, display warning and quit - if (db_get_tstatic(wParam, WEATHERPROTONAME, "MapURL", loc2, _countof(loc2)) || loc2[0] == 0) { + if (db_get_wstatic(wParam, WEATHERPROTONAME, "MapURL", loc2, _countof(loc2)) || loc2[0] == 0) { MessageBox(NULL, NO_MAP_URL, TranslateT("Weather Protocol"), MB_ICONINFORMATION); return 1; } @@ -145,30 +145,30 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONSETASFLATBTN, TRUE, 0); // set tooltip for the buttons - SendDlgItemMessage(hwndDlg, IDC_GETNAME, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Get city name from ID"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_SVCINFO, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Weather INI information"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_BROWSE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Browse"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_VIEW1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_RESET1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_VIEW2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_TCHAR); - SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_GETNAME, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Get city name from ID"), BATF_UNICODE); + SendDlgItemMessage(hwndDlg, IDC_SVCINFO, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Weather INI information"), BATF_UNICODE); + SendDlgItemMessage(hwndDlg, IDC_BROWSE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Browse"), BATF_UNICODE); + SendDlgItemMessage(hwndDlg, IDC_VIEW1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_UNICODE); + SendDlgItemMessage(hwndDlg, IDC_RESET1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_UNICODE); + SendDlgItemMessage(hwndDlg, IDC_VIEW2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_UNICODE); + SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_UNICODE); // save the handle for the contact WindowList_Add(hWindowList, hwndDlg, hContact); // start to get the settings // if the setting not exist, leave the dialog box blank - if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) { SetDlgItemText(hwndDlg, IDC_ID, dbv.ptszVal); // check if the station is a default station CheckDlgButton(hwndDlg, IDC_DEFA, mir_wstrcmp(dbv.ptszVal, opt.Default) != 0 ? BST_CHECKED : BST_UNCHECKED); db_free(&dbv); } - if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) { SetDlgItemText(hwndDlg, IDC_NAME, dbv.ptszVal); db_free(&dbv); } - if (!db_get_ts(hContact, WEATHERPROTONAME, "Log", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) { SetDlgItemText(hwndDlg, IDC_LOG, dbv.ptszVal); // if the log path is not empty, check the checkbox for external log if (dbv.ptszVal[0]) CheckDlgButton(hwndDlg, IDC_External, BST_CHECKED); @@ -182,11 +182,11 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA CheckDlgButton(hwndDlg, IDC_DAutoUpdate, db_get_b(hContact, WEATHERPROTONAME, "DAutoUpdate", FALSE) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_Internal, db_get_b(hContact, WEATHERPROTONAME, "History", 0) ? BST_CHECKED : BST_UNCHECKED); - if (!db_get_ts(hContact, WEATHERPROTONAME, "InfoURL", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "InfoURL", &dbv)) { SetDlgItemText(hwndDlg, IDC_IURL, dbv.ptszVal); db_free(&dbv); } - if (!db_get_ts(hContact, WEATHERPROTONAME, "MapURL", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "MapURL", &dbv)) { SetDlgItemText(hwndDlg, IDC_MURL, dbv.ptszVal); db_free(&dbv); } @@ -341,30 +341,30 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // temporary disable the protocol while applying the change // start writing the new settings to database GetDlgItemText(hwndDlg, IDC_ID, str, _countof(str)); - db_set_ts(hContact, WEATHERPROTONAME, "ID", str); + db_set_ws(hContact, WEATHERPROTONAME, "ID", str); if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFA)) { // if default station is set mir_wstrcpy(opt.Default, str); opt.DefStn = hContact; - db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); + db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default); } GetDlgItemText(hwndDlg, IDC_NAME, city, _countof(city)); - db_set_ts(hContact, WEATHERPROTONAME, "Nick", city); + db_set_ws(hContact, WEATHERPROTONAME, "Nick", city); mir_snwprintf(str2, TranslateT("Current weather information for %s."), city); if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) { GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str)); - db_set_ts(hContact, WEATHERPROTONAME, "Log", str); + db_set_ws(hContact, WEATHERPROTONAME, "Log", str); } else db_unset(hContact, WEATHERPROTONAME, "Log"); GetDlgItemText(hwndDlg, IDC_IURL, str, _countof(str)); - db_set_ts(hContact, WEATHERPROTONAME, "InfoURL", str); + db_set_ws(hContact, WEATHERPROTONAME, "InfoURL", str); GetDlgItemText(hwndDlg, IDC_MURL, str, _countof(str)); - db_set_ts(hContact, WEATHERPROTONAME, "MapURL", str); + db_set_ws(hContact, WEATHERPROTONAME, "MapURL", str); db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE); db_set_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE); AvatarDownloaded(hContact); - db_set_ts(hContact, WEATHERPROTONAME, "About", str2); + db_set_ws(hContact, WEATHERPROTONAME, "About", str2); db_set_b(hContact, WEATHERPROTONAME, "History", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_Internal)); db_set_b(hContact, WEATHERPROTONAME, "Overwrite", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_Overwrite)); db_set_b(hContact, WEATHERPROTONAME, "File", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)); @@ -436,7 +436,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) removeWindow(wParam); // exit this function if it is not default station - ptrW tszID(db_get_tsa(wParam, WEATHERPROTONAME, "ID")); + ptrW tszID(db_get_wsa(wParam, WEATHERPROTONAME, "ID")); if (tszID != NULL) if (mir_wstrcmp(tszID, opt.Default)) return 0; @@ -445,7 +445,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) // start looking for other weather stations for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) { - tszID = db_get_tsa(hContact, WEATHERPROTONAME, "ID"); + tszID = db_get_wsa(hContact, WEATHERPROTONAME, "ID"); if (tszID == NULL) continue; @@ -454,13 +454,13 @@ int ContactDeleted(WPARAM wParam, LPARAM) if (mir_wstrcmp(opt.Default, tszID)) { wcsncpy_s(opt.Default, tszID, _TRUNCATE); opt.DefStn = hContact; - ptrW tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick")); + ptrW tszNick(db_get_wsa(hContact, WEATHERPROTONAME, "Nick")); if (tszNick != NULL) { wchar_t str[255]; mir_snwprintf(str, TranslateT("%s is now the default weather station"), (wchar_t*)tszNick); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION); } - db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); + db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default); return 0; // exit this function quickly } } @@ -468,7 +468,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) // got here if no more weather station left opt.Default[0] = 0; // no default station opt.DefStn = NULL; - db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); + db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default); return 0; } diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index 168fd77d09..15428e3839 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -391,12 +391,12 @@ WORD GetIcon(const wchar_t* cond, WIDATA *Data) j++; // using the format _T("# Weather #" mir_snwprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j); - wcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE); + wcsncpy_s(LangPackStr1, TranslateW(LangPackStr), _TRUNCATE); CharLowerBuff(LangPackStr1, (DWORD)mir_wstrlen(LangPackStr1)); if (wcsstr(cond, LangPackStr1) != NULL) return statusValue[i]; // loop until the translation string exists (ie, the translated string is differ from original) - } while (mir_wstrcmp(TranslateTS(LangPackStr), LangPackStr)); + } while (mir_wstrcmp(TranslateW(LangPackStr), LangPackStr)); } return NA; @@ -548,8 +548,8 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) mir_strcat(name, temp); } // access the database to get its value - if (!db_get_ts(w->hContact, WEATHERCONDITION, name, &dbv)) { - if (dbv.ptszVal != TranslateTS(NODATA) && dbv.ptszVal != TranslateT("")) + if (!db_get_ws(w->hContact, WEATHERCONDITION, name, &dbv)) { + if (dbv.ptszVal != TranslateW(NODATA) && dbv.ptszVal != TranslateT("")) mir_wstrcat(str, dbv.ptszVal); db_free(&dbv); } diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index f8df3f7f18..eea3edf81b 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -33,7 +33,7 @@ saving individual weather data for a weather contact. void GetStationID(MCONTACT hContact, wchar_t* id, int idlen) { // accessing the database - if (db_get_tstatic(hContact, WEATHERPROTONAME, "ID", id, idlen)) + if (db_get_wstatic(hContact, WEATHERPROTONAME, "ID", id, idlen)) id[0] = 0; } @@ -49,35 +49,35 @@ WEATHERINFO LoadWeatherInfo(MCONTACT hContact) winfo.hContact = hContact; GetStationID(hContact, winfo.id, _countof(winfo.id)); - if (db_get_tstatic(hContact, WEATHERPROTONAME, "Nick", winfo.city, _countof(winfo.city))) + if (db_get_wstatic(hContact, WEATHERPROTONAME, "Nick", winfo.city, _countof(winfo.city))) wcsncpy(winfo.city, NODATA, _countof(winfo.city) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Update", winfo.update, _countof(winfo.update))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Update", winfo.update, _countof(winfo.update))) wcsncpy(winfo.update, NODATA, _countof(winfo.update) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Condition", winfo.cond, _countof(winfo.cond))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Condition", winfo.cond, _countof(winfo.cond))) wcsncpy(winfo.cond, NODATA, _countof(winfo.cond) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Temperature", winfo.temp, _countof(winfo.temp))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Temperature", winfo.temp, _countof(winfo.temp))) wcsncpy(winfo.temp, NODATA, _countof(winfo.temp) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "High", winfo.high, _countof(winfo.high))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "High", winfo.high, _countof(winfo.high))) wcsncpy(winfo.high, NODATA, _countof(winfo.high) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Low", winfo.low, _countof(winfo.low))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Low", winfo.low, _countof(winfo.low))) wcsncpy(winfo.low, NODATA, _countof(winfo.low) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Sunset", winfo.sunset, _countof(winfo.sunset))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Sunset", winfo.sunset, _countof(winfo.sunset))) wcsncpy(winfo.sunset, NODATA, _countof(winfo.sunset) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Sunrise", winfo.sunrise, _countof(winfo.sunrise))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Sunrise", winfo.sunrise, _countof(winfo.sunrise))) wcsncpy(winfo.sunrise, NODATA, _countof(winfo.sunrise) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Wind Speed", winfo.wind, _countof(winfo.wind))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Wind Speed", winfo.wind, _countof(winfo.wind))) wcsncpy(winfo.wind, NODATA, _countof(winfo.wind) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Wind Direction", winfo.winddir, _countof(winfo.winddir))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Wind Direction", winfo.winddir, _countof(winfo.winddir))) wcsncpy(winfo.winddir, NODATA, _countof(winfo.winddir) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Dewpoint", winfo.dewpoint, _countof(winfo.dewpoint))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Dewpoint", winfo.dewpoint, _countof(winfo.dewpoint))) wcsncpy(winfo.dewpoint, NODATA, _countof(winfo.dewpoint) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Pressure", winfo.pressure, _countof(winfo.pressure))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Pressure", winfo.pressure, _countof(winfo.pressure))) wcsncpy(winfo.pressure, NODATA, _countof(winfo.pressure) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Visibility", winfo.vis, _countof(winfo.vis))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Visibility", winfo.vis, _countof(winfo.vis))) wcsncpy(winfo.vis, NODATA, _countof(winfo.vis) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Humidity", winfo.humid, _countof(winfo.humid))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Humidity", winfo.humid, _countof(winfo.humid))) wcsncpy(winfo.humid, NODATA, _countof(winfo.humid) - 1); - if (db_get_tstatic(hContact, WEATHERCONDITION, "Feel", winfo.feel, _countof(winfo.feel))) + if (db_get_wstatic(hContact, WEATHERCONDITION, "Feel", winfo.feel, _countof(winfo.feel))) wcsncpy(winfo.feel, NODATA, _countof(winfo.feel) - 1); winfo.status = (WORD)db_get_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE); @@ -88,13 +88,13 @@ WEATHERINFO LoadWeatherInfo(MCONTACT hContact) // return 0 on success int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv) { - if (db_get_ts(hContact, WEATHERCONDITION, setting, dbv)) { + if (db_get_ws(hContact, WEATHERCONDITION, setting, dbv)) { size_t len = mir_strlen(setting) + 1; char *set = (char*)alloca(len + 1); *set = '#'; memcpy(set + 1, setting, len); - if (db_get_ts(hContact, WEATHERCONDITION, set, dbv)) + if (db_get_ws(hContact, WEATHERCONDITION, set, dbv)) return 1; } return 0; @@ -117,8 +117,8 @@ void EraseAllInfo() db_set_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE); db_unset(hContact, "CList", "MyHandle"); // clear all data - if (db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) { - db_set_ts(hContact, WEATHERPROTONAME, "Nick", TranslateT("")); + if (db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) { + db_set_ws(hContact, WEATHERPROTONAME, "Nick", TranslateT("")); db_set_s(hContact, WEATHERPROTONAME, "LastLog", "never"); db_set_s(hContact, WEATHERPROTONAME, "LastCondition", "None"); db_set_s(hContact, WEATHERPROTONAME, "LastTemperature", "None"); @@ -130,7 +130,7 @@ void EraseAllInfo() // reset update tag db_set_b(hContact, WEATHERPROTONAME, "IsUpdated", FALSE); // reset logging settings - if (!db_get_ts(hContact, WEATHERPROTONAME, "Log", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) { db_set_b(hContact, WEATHERPROTONAME, "File", (BYTE)(dbv.ptszVal[0] != 0)); db_free(&dbv); } @@ -141,7 +141,7 @@ void EraseAllInfo() GetStationID(hContact, opt.Default, _countof(opt.Default)); opt.DefStn = hContact; - if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) { mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); db_free(&dbv); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION); @@ -149,7 +149,7 @@ void EraseAllInfo() } // get the handle of the default station if (opt.DefStn == NULL) { - if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) { if (!mir_wstrcmp(dbv.ptszVal, opt.Default)) opt.DefStn = hContact; db_free(&dbv); @@ -163,19 +163,19 @@ void EraseAllInfo() // if (ContactCount != 0) status = ONLINE; // in case where the default station is missing if (opt.DefStn == NULL && ContactCount != 0) { - if (!db_get_ts(LastContact, WEATHERPROTONAME, "ID", &dbv)) { + if (!db_get_ws(LastContact, WEATHERPROTONAME, "ID", &dbv)) { wcsncpy(opt.Default, dbv.ptszVal, _countof(opt.Default) - 1); db_free(&dbv); } opt.DefStn = LastContact; - if (!db_get_ts(LastContact, WEATHERPROTONAME, "Nick", &dbv)) { + if (!db_get_ws(LastContact, WEATHERPROTONAME, "Nick", &dbv)) { mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal); db_free(&dbv); MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION); } } // save option in case of default station changed - db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); + db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default); } void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data) @@ -183,7 +183,7 @@ void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data) wchar_t str[MAX_DATA_LEN]; // convert the unit - if (mir_wstrcmp(Data, TranslateT("")) && mir_wstrcmp(Data, NODATA) && mir_wstrcmp(Data, TranslateTS(NODATA))) { + if (mir_wstrcmp(Data, TranslateT("")) && mir_wstrcmp(Data, NODATA) && mir_wstrcmp(Data, TranslateW(NODATA))) { // temperature if (!mir_wstrcmp(UpdateData->Name, L"Temperature") || !mir_wstrcmp(UpdateData->Name, L"High") || !mir_wstrcmp(UpdateData->Name, L"Low") || !mir_wstrcmp(UpdateData->Name, L"Feel") || @@ -417,7 +417,7 @@ void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM) char *szSetting = arSettings[i]; DBVARIANT dbv; - if (!db_get_ts(hContact, WEATHERCONDITION, szSetting, &dbv)) { + if (!db_get_ws(hContact, WEATHERCONDITION, szSetting, &dbv)) { switch (Mode) { case WDBM_REMOVE: db_unset(hContact, WEATHERCONDITION, szSetting); @@ -432,7 +432,7 @@ void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM) LV_ITEM lvi = { 0 }; lvi.mask = LVIF_TEXT | LVIF_PARAM; lvi.lParam = i; - lvi.pszText = TranslateTS(_A2T(szSetting)); + lvi.pszText = TranslateW(_A2T(szSetting)); lvi.iItem = ListView_InsertItem(hList, &lvi); lvi.pszText = dbv.ptszVal; ListView_SetItemText(hList, lvi.iItem, 1, dbv.ptszVal); diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp index 7b48509a4d..82b9707d80 100644 --- a/plugins/Weather/src/weather_http.cpp +++ b/plugins/Weather/src/weather_http.cpp @@ -154,7 +154,7 @@ void NetlibInit(void) { NETLIBUSER nlu = { 0 }; nlu.cbSize = sizeof(nlu); - nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_TCHAR; + nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE; nlu.szSettingsModule = WEATHERPROTONAME; nlu.ptszDescriptiveName = TranslateT("Weather HTTP connections"); hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp index e6ed5291e9..d78be15988 100644 --- a/plugins/Weather/src/weather_info.cpp +++ b/plugins/Weather/src/weather_info.cpp @@ -114,7 +114,7 @@ INT_PTR CALLBACK DlgProcINIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) lvc.fmt = LVCFMT_LEFT; for (int i = 0; i < 7; ++i) { lvc.iSubItem = i; - lvc.pszText = TranslateTS(columns[i].name); + lvc.pszText = TranslateW(columns[i].name); lvc.cx = columns[i].size; ListView_InsertColumn(hIniList, i, &lvc); } diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index aa47bb3580..6d414a8f7e 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -157,16 +157,16 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara clr = db_get_dw(NULL, WEATHERPROTONAME, "ColorMwinFrame", GetSysColor(COLOR_3DFACE)); { - FontIDT fntid = { 0 }; + FontIDW fntid = { 0 }; mir_wstrcpy(fntid.group, _A2W(WEATHERPROTONAME)); mir_wstrcpy(fntid.name, LPGENW("Frame Font")); - fntc = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt); + fntc = CallService(MS_FONT_GETW, (WPARAM)&fntid, (LPARAM)&lfnt); mir_wstrcpy(fntid.name, LPGENW("Frame Title Font")); - fntc1 = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt1); + fntc1 = CallService(MS_FONT_GETW, (WPARAM)&fntid, (LPARAM)&lfnt1); } - ptrW tszInfo(db_get_tsa(data->hContact, WEATHERCONDITION, "WeatherInfo")); + ptrW tszInfo(db_get_wsa(data->hContact, WEATHERCONDITION, "WeatherInfo")); GetClientRect(hwnd, &rc); @@ -238,7 +238,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara static void addWindow(MCONTACT hContact) { DBVARIANT dbv; - if (db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) + if (db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) return; wchar_t winname[512]; @@ -255,7 +255,7 @@ static void addWindow(MCONTACT hContact) Frame.cbSize = sizeof(Frame); Frame.hWnd = hWnd; Frame.align = alBottom; - Frame.Flags = F_VISIBLE | F_NOBORDER | F_TCHAR; + Frame.Flags = F_VISIBLE | F_NOBORDER | F_UNICODE; Frame.height = 32; DWORD frameID = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); @@ -324,17 +324,17 @@ void InitMwin(void) wndclass.lpszClassName = L"WeatherFrame"; RegisterClass(&wndclass); - ColourIDT colourid = { 0 }; - colourid.cbSize = sizeof(ColourIDT); + ColourIDW colourid = { 0 }; + colourid.cbSize = sizeof(ColourIDW); mir_strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME); mir_strcpy(colourid.setting, "ColorMwinFrame"); mir_wstrcpy(colourid.name, LPGENW("Frame Background")); mir_wstrcpy(colourid.group, _A2W(WEATHERPROTONAME)); colourid.defcolour = GetSysColor(COLOR_3DFACE); - ColourRegisterT(&colourid); + ColourRegisterW(&colourid); - FontIDT fontid = { 0 }; - fontid.cbSize = sizeof(FontIDT); + FontIDW fontid = { 0 }; + fontid.cbSize = sizeof(FontIDW); fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID; mir_strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME); mir_wstrcpy(fontid.group, _A2W(WEATHERPROTONAME)); @@ -349,12 +349,12 @@ void InitMwin(void) mir_wstrcpy(fontid.deffontsettings.szFace, L"Verdana"); mir_wstrcpy(fontid.backgroundGroup, _A2W(WEATHERPROTONAME)); mir_wstrcpy(fontid.backgroundName, LPGENW("Frame Background")); - FontRegisterT(&fontid); + FontRegisterW(&fontid); fontid.deffontsettings.style = DBFONTF_BOLD; mir_wstrcpy(fontid.name, LPGENW("Frame Title Font")); mir_strcpy(fontid.prefix, "fnt1"); - FontRegisterT(&fontid); + FontRegisterW(&fontid); for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0)) diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index c971ef7857..6e9374dea6 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -114,50 +114,50 @@ void LoadOptions(void) opt.dUnit = db_get_w(NULL, WEATHERPROTONAME, "dUnit", 1); opt.eUnit = db_get_w(NULL, WEATHERPROTONAME, "eUnit", 2); - ptrW szValue(db_get_tsa(NULL, WEATHERPROTONAME, "DegreeSign")); + ptrW szValue(db_get_wsa(NULL, WEATHERPROTONAME, "DegreeSign")); wcsncpy_s(opt.DegreeSign, (szValue == NULL) ? L"" : szValue, _TRUNCATE); opt.DoNotAppendUnit = db_get_b(NULL, WEATHERPROTONAME, "DoNotAppendUnit", 0); opt.NoFrac = db_get_b(NULL, WEATHERPROTONAME, "NoFractions", 0); // texts - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "DisplayText")) - wSetData(&opt.cText, TranslateTS(szValue)); + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "DisplayText")) + wSetData(&opt.cText, TranslateW(szValue)); else SetTextDefault("C"); - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "BriefTextTitle")) - wSetData(&opt.bTitle, TranslateTS(szValue)); + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "BriefTextTitle")) + wSetData(&opt.bTitle, TranslateW(szValue)); else SetTextDefault("b"); - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "BriefText")) - wSetData(&opt.bText, TranslateTS(szValue)); + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "BriefText")) + wSetData(&opt.bText, TranslateW(szValue)); else SetTextDefault("B"); - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "NoteText")) - wSetData(&opt.nText, TranslateTS(szValue)); + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "NoteText")) + wSetData(&opt.nText, TranslateW(szValue)); else SetTextDefault("N"); - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "ExtText")) - wSetData(&opt.eText, TranslateTS(szValue)); + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "ExtText")) + wSetData(&opt.eText, TranslateW(szValue)); else SetTextDefault("E"); - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "HistoryText")) - wSetData(&opt.hText, TranslateTS(szValue)); + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "HistoryText")) + wSetData(&opt.hText, TranslateW(szValue)); else SetTextDefault("H"); - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "ExtraText")) - wSetData(&opt.xText, TranslateTS(szValue)); + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "ExtraText")) + wSetData(&opt.xText, TranslateW(szValue)); else SetTextDefault("X"); - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "StatusText")) - wSetData(&opt.sText, TranslateTS(szValue)); + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "StatusText")) + wSetData(&opt.sText, TranslateW(szValue)); else SetTextDefault("S"); @@ -179,18 +179,18 @@ void LoadOptions(void) // popup delay opt.pDelay = db_get_dw(NULL, WEATHERPROTONAME, "PopupDelay", 0); // popup texts - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "PopupTitle")) + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "PopupTitle")) wSetData(&opt.pTitle, szValue); else SetTextDefault("P"); - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "PopupText")) + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "PopupText")) wSetData(&opt.pText, szValue); else SetTextDefault("p"); // misc - if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "Default")) + if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "Default")) wcsncpy_s(opt.Default, szValue, _TRUNCATE); else opt.Default[0] = 0; @@ -215,18 +215,18 @@ void SaveOptions(void) db_set_w(NULL, WEATHERPROTONAME, "pUnit", opt.pUnit); db_set_w(NULL, WEATHERPROTONAME, "dUnit", opt.dUnit); db_set_w(NULL, WEATHERPROTONAME, "eUnit", opt.eUnit); - db_set_ts(NULL, WEATHERPROTONAME, "DegreeSign", opt.DegreeSign); + db_set_ws(NULL, WEATHERPROTONAME, "DegreeSign", opt.DegreeSign); db_set_b(NULL, WEATHERPROTONAME, "DoNotAppendUnit", (BYTE)opt.DoNotAppendUnit); db_set_b(NULL, WEATHERPROTONAME, "NoFractions", (BYTE)opt.NoFrac); // texts - db_set_ts(NULL, WEATHERPROTONAME, "DisplayText", opt.cText); - db_set_ts(NULL, WEATHERPROTONAME, "BriefTextTitle", opt.bTitle); - db_set_ts(NULL, WEATHERPROTONAME, "BriefText", opt.bText); - db_set_ts(NULL, WEATHERPROTONAME, "NoteText", opt.nText); - db_set_ts(NULL, WEATHERPROTONAME, "ExtText", opt.eText); - db_set_ts(NULL, WEATHERPROTONAME, "HistoryText", opt.hText); - db_set_ts(NULL, WEATHERPROTONAME, "ExtraText", opt.xText); - db_set_ts(NULL, WEATHERPROTONAME, "StatusText", opt.sText); + db_set_ws(NULL, WEATHERPROTONAME, "DisplayText", opt.cText); + db_set_ws(NULL, WEATHERPROTONAME, "BriefTextTitle", opt.bTitle); + db_set_ws(NULL, WEATHERPROTONAME, "BriefText", opt.bText); + db_set_ws(NULL, WEATHERPROTONAME, "NoteText", opt.nText); + db_set_ws(NULL, WEATHERPROTONAME, "ExtText", opt.eText); + db_set_ws(NULL, WEATHERPROTONAME, "HistoryText", opt.hText); + db_set_ws(NULL, WEATHERPROTONAME, "ExtraText", opt.xText); + db_set_ws(NULL, WEATHERPROTONAME, "StatusText", opt.sText); // advanced db_set_b(NULL, WEATHERPROTONAME, "DisableConditionIcon", (BYTE)opt.DisCondIcon); // popup options @@ -245,10 +245,10 @@ void SaveOptions(void) // popup delay db_set_dw(NULL, WEATHERPROTONAME, "PopupDelay", opt.pDelay); // popup texts - db_set_ts(NULL, WEATHERPROTONAME, "PopupTitle", opt.pTitle); - db_set_ts(NULL, WEATHERPROTONAME, "PopupText", opt.pText); + db_set_ws(NULL, WEATHERPROTONAME, "PopupTitle", opt.pTitle); + db_set_ws(NULL, WEATHERPROTONAME, "PopupText", opt.pText); // misc stuff - db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default); + db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default); } //============ MAIN OPTIONS ============ diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 6e1ddba4ea..c94e12a7ea 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -259,9 +259,9 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PMENU)); hMenu1 = GetSubMenu(hMenu, 0); GetMenuString(hMenu1, opt.LeftClickAction, str, _countof(str), MF_BYCOMMAND); - SetDlgItemText(hdlg, IDC_LeftClick, TranslateTS(str)); + SetDlgItemText(hdlg, IDC_LeftClick, TranslateW(str)); GetMenuString(hMenu1, opt.RightClickAction, str, _countof(str), MF_BYCOMMAND); - SetDlgItemText(hdlg, IDC_RightClick, TranslateTS(str)); + SetDlgItemText(hdlg, IDC_RightClick, TranslateW(str)); DestroyMenu(hMenu); // other options @@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PMENU)); hMenu1 = GetSubMenu(hMenu, 0); GetMenuString(hMenu1, opt.RightClickAction, str, _countof(str), MF_BYCOMMAND); - SetDlgItemText(hdlg, IDC_RightClick, TranslateTS(str)); + SetDlgItemText(hdlg, IDC_RightClick, TranslateW(str)); DestroyMenu(hMenu); break; @@ -362,7 +362,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PMENU)); hMenu1 = GetSubMenu(hMenu, 0); GetMenuString(hMenu1, opt.LeftClickAction, str, _countof(str), MF_BYCOMMAND); - SetDlgItemText(hdlg, IDC_LeftClick, TranslateTS(str)); + SetDlgItemText(hdlg, IDC_LeftClick, TranslateW(str)); DestroyMenu(hMenu); break; diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index e301a0302d..705288a25f 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -178,7 +178,7 @@ static void __cdecl WeatherGetAwayMsgThread(void *arg) MCONTACT hContact = (DWORD_PTR)arg; DBVARIANT dbv; - if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv)) { + if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) { ProtoBroadcastAck(WEATHERPROTONAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); db_free(&dbv); } diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index c6159a10a3..148f53ba65 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -45,7 +45,7 @@ int UpdateWeather(MCONTACT hContact) // log to netlib log for debug purpose Netlib_LogfT(hNetlibUser, L"************************************************************************"); - int dbres = db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv); + int dbres = db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv); Netlib_LogfT(hNetlibUser, L"<-- Start update for station -->"); @@ -76,23 +76,23 @@ int UpdateWeather(MCONTACT hContact) WEATHERINFO winfo = LoadWeatherInfo(hContact); // translate weather condition - mir_wstrcpy(winfo.cond, TranslateTS(winfo.cond)); + mir_wstrcpy(winfo.cond, TranslateW(winfo.cond)); // compare the old condition and determine if the weather had changed if (opt.UpdateOnlyConditionChanged) { // consider condition change - if (!db_get_ts(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) { if (mir_wstrcmpi(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed db_free(&dbv); } else Ch = TRUE; - if (!db_get_ts(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) { if (mir_wstrcmpi(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed db_free(&dbv); } else Ch = TRUE; } else { // consider update time change - if (!db_get_ts(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) { if (mir_wstrcmpi(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed db_free(&dbv); } @@ -100,7 +100,7 @@ int UpdateWeather(MCONTACT hContact) } // have weather alert issued? - dbres = db_get_ts(hContact, WEATHERCONDITION, "Alert", &dbv); + dbres = db_get_ws(hContact, WEATHERCONDITION, "Alert", &dbv); if (!dbres && dbv.ptszVal[0] != 0) { if (opt.AlertPopup && !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0) && Ch) { // display alert popup @@ -117,10 +117,10 @@ int UpdateWeather(MCONTACT hContact) if (!dbres) db_free(&dbv); // backup current condition for checking if the weather is changed or not - db_set_ts(hContact, WEATHERPROTONAME, "LastLog", winfo.update); - db_set_ts(hContact, WEATHERPROTONAME, "LastCondition", winfo.cond); - db_set_ts(hContact, WEATHERPROTONAME, "LastTemperature", winfo.temp); - db_set_ts(hContact, WEATHERPROTONAME, "LastUpdate", winfo.update); + db_set_ws(hContact, WEATHERPROTONAME, "LastLog", winfo.update); + db_set_ws(hContact, WEATHERPROTONAME, "LastCondition", winfo.cond); + db_set_ws(hContact, WEATHERPROTONAME, "LastTemperature", winfo.temp); + db_set_ws(hContact, WEATHERPROTONAME, "LastUpdate", winfo.update); // display condition on contact list if (opt.DisCondIcon && winfo.status != ID_STATUS_OFFLINE) @@ -130,11 +130,11 @@ int UpdateWeather(MCONTACT hContact) AvatarDownloaded(hContact); GetDisplay(&winfo, opt.cText, str2); - db_set_ts(hContact, "CList", "MyHandle", str2); + db_set_ws(hContact, "CList", "MyHandle", str2); GetDisplay(&winfo, opt.sText, str2); if (str2[0]) - db_set_ts(hContact, "CList", "StatusMsg", str2); + db_set_ws(hContact, "CList", "StatusMsg", str2); else db_unset(hContact, "CList", "StatusMsg"); @@ -142,9 +142,9 @@ int UpdateWeather(MCONTACT hContact) // save descriptions in MyNotes GetDisplay(&winfo, opt.nText, str2); - db_set_ts(hContact, "UserInfo", "MyNotes", str2); + db_set_ws(hContact, "UserInfo", "MyNotes", str2); GetDisplay(&winfo, opt.xText, str2); - db_set_ts(hContact, WEATHERCONDITION, "WeatherInfo", str2); + db_set_ws(hContact, WEATHERCONDITION, "WeatherInfo", str2); // set the update tag db_set_b(hContact, WEATHERPROTONAME, "IsUpdated", TRUE); @@ -166,7 +166,7 @@ int UpdateWeather(MCONTACT hContact) if (db_get_b(hContact, WEATHERPROTONAME, "File", 0)) { // external log - if (!db_get_ts(hContact, WEATHERPROTONAME, "Log", &dbv)) { + if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) { // for the option for overwriting the file, delete old file first if (db_get_b(hContact, WEATHERPROTONAME, "Overwrite", 0)) DeleteFile(dbv.ptszVal); @@ -459,7 +459,7 @@ int GetWeatherData(MCONTACT hContact) // to get a data value. GetDataValue(&Item->Item, DataValue, &szInfo); if (mir_wstrcmp(Item->Item.Name, L"Condition") && mir_wstrcmpi(Item->Item.Unit, L"Cond")) - wcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1); + wcsncpy(DataValue, TranslateW(DataValue), MAX_DATA_LEN - 1); break; case WID_SET: @@ -495,7 +495,7 @@ int GetWeatherData(MCONTACT hContact) break; case'\"': // constant, add it to the result string - mir_wstrncat(DataValue, TranslateTS(str2), _countof(DataValue) - mir_wstrlen(DataValue)); + mir_wstrncat(DataValue, TranslateW(str2), _countof(DataValue) - mir_wstrlen(DataValue)); DataValue[_countof(DataValue) - 1] = 0; break; } @@ -536,40 +536,40 @@ int GetWeatherData(MCONTACT hContact) // write the 2 strings created from the break operation if (Item->Item.End[0]) - db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.End), end); + db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.End), end); break; } } // don't store data if it is not available if ((DataValue[0] != 0 && mir_wstrcmp(DataValue, NODATA) && - mir_wstrcmp(DataValue, TranslateTS(NODATA)) && mir_wstrcmp(Item->Item.Name, L"Ignore")) || + mir_wstrcmp(DataValue, TranslateW(NODATA)) && mir_wstrcmp(Item->Item.Name, L"Ignore")) || (!mir_wstrcmp(Item->Item.Name, L"Alert") && i == 0)) { // temporary workaround for mToolTip to show feel-like temperature if (!mir_wstrcmp(Item->Item.Name, L"Feel")) - db_set_ts(hContact, WEATHERCONDITION, "Heat Index", DataValue); + db_set_ws(hContact, WEATHERCONDITION, "Heat Index", DataValue); GetStationID(hContact, Svc, _countof(Svc)); if (!mir_wstrcmp(Svc, opt.Default)) - db_set_ts(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue); + db_set_ws(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue); if (!mir_wstrcmp(Item->Item.Name, L"Condition")) { wchar_t buf[128], *cbuf; mir_snwprintf(buf, L"#%s Weather", DataValue); - cbuf = TranslateTS(buf); + cbuf = TranslateW(buf); if (cbuf[0] == '#') - cbuf = TranslateTS(DataValue); - db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf); + cbuf = TranslateW(DataValue); + db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf); CharLowerBuff(DataValue, (DWORD)mir_wstrlen(DataValue)); cond = GetIcon(DataValue, Data); } else if (mir_wstrcmpi(Item->Item.Unit, L"Cond") == 0) { wchar_t buf[128], *cbuf; mir_snwprintf(buf, L"#%s Weather", DataValue); - cbuf = TranslateTS(buf); + cbuf = TranslateW(buf); if (cbuf[0] == '#') - cbuf = TranslateTS(DataValue); - db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf); + cbuf = TranslateW(DataValue); + db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf); } - else db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), DataValue); + else db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), DataValue); } Item = Item->Next; } @@ -578,7 +578,7 @@ int GetWeatherData(MCONTACT hContact) // assign condition icon db_set_w(hContact, WEATHERPROTONAME, "StatusIcon", cond); - db_set_ts(hContact, WEATHERPROTONAME, "MirVer", Data->DisplayName); + db_set_ws(hContact, WEATHERPROTONAME, "MirVer", Data->DisplayName); return 0; } -- cgit v1.2.3