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/NewsAggregator/Src/CheckFeed.cpp | 76 ++++++++++++++++---------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'plugins/NewsAggregator/Src/CheckFeed.cpp') diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 8586d20477..96d80c6298 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -98,9 +98,9 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) return NULL; } -static void XmlToMsg(MCONTACT hContact, CMString &title, CMString &link, CMString &descr, CMString &author, CMString &comments, CMString &guid, CMString &category, time_t stamp) +static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStringW &descr, CMStringW &author, CMStringW &comments, CMStringW &guid, CMStringW &category, time_t stamp) { - CMString message = db_get_tsa(hContact, MODULE, "MsgFormat"); + CMStringW message = db_get_wsa(hContact, MODULE, "MsgFormat"); if (!message) message = TAGSDEFAULT; @@ -183,7 +183,7 @@ void CheckCurrentFeed(MCONTACT hContact) if (!db_get_b(hContact, MODULE, "CheckState", 1) != 0) return; - wchar_t *szURL = db_get_tsa(hContact, MODULE, "URL"); + wchar_t *szURL = db_get_wsa(hContact, MODULE, "URL"); if (szURL == NULL) return; @@ -202,7 +202,7 @@ void CheckCurrentFeed(MCONTACT hContact) mir_free(tszData); mir_free(szData); - CMString szValue; + CMStringW szValue; if (hXml != NULL) { LPCTSTR codepage = NULL; int childcount = 0; @@ -230,13 +230,13 @@ void CheckCurrentFeed(MCONTACT hContact) if (!mir_wstrcmpi(szAttrName, L"version")) { wchar_t ver[MAX_PATH]; mir_snwprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName)); - db_set_ts(hContact, MODULE, "MirVer", ver); + db_set_ws(hContact, MODULE, "MirVer", ver); break; } } } else if (isAtom) - db_set_ts(hContact, MODULE, "MirVer", L"RSS 1.0"); + db_set_ws(hContact, MODULE, "MirVer", L"RSS 1.0"); HXML chan = xmlGetChild(node, 0); for (int j = 0; j < xmlGetChildCount(chan); j++) { @@ -252,7 +252,7 @@ void CheckCurrentFeed(MCONTACT hContact) else szChildText = xmlGetText(child); if (szChildText) - db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText)); + db_set_ws(hContact, MODULE, "FirstName", ClearText(szValue, szChildText)); } else if (!mir_wstrcmpi(childName, L"link")) { LPCTSTR szChildText = NULL; @@ -264,7 +264,7 @@ void CheckCurrentFeed(MCONTACT hContact) else szChildText = xmlGetText(child); if (szChildText) - db_set_ts(hContact, MODULE, "Homepage", ClearText(szValue, szChildText)); + db_set_ws(hContact, MODULE, "Homepage", ClearText(szValue, szChildText)); } else if (!mir_wstrcmpi(childName, L"description")) { LPCTSTR szChildText = NULL; @@ -277,8 +277,8 @@ void CheckCurrentFeed(MCONTACT hContact) szChildText = xmlGetText(child); if (szChildText) { ClearText(szValue, szChildText); - db_set_ts(hContact, MODULE, "About", szValue); - db_set_ts(hContact, "CList", "StatusMsg", szValue); + db_set_ws(hContact, MODULE, "About", szValue); + db_set_ws(hContact, "CList", "StatusMsg", szValue); } } else if (!mir_wstrcmpi(childName, L"language")) { @@ -291,7 +291,7 @@ void CheckCurrentFeed(MCONTACT hContact) else szChildText = xmlGetText(child); if (szChildText) - db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText)); + db_set_ws(hContact, MODULE, "Language1", ClearText(szValue, szChildText)); } else if (!mir_wstrcmpi(childName, L"managingEditor")) { LPCTSTR szChildText = NULL; @@ -303,7 +303,7 @@ void CheckCurrentFeed(MCONTACT hContact) else szChildText = xmlGetText(child); if (szChildText) - db_set_ts(hContact, MODULE, "e-mail", ClearText(szValue, szChildText)); + db_set_ws(hContact, MODULE, "e-mail", ClearText(szValue, szChildText)); } else if (!mir_wstrcmpi(childName, L"category")) { LPCTSTR szChildText = NULL; @@ -315,7 +315,7 @@ void CheckCurrentFeed(MCONTACT hContact) else szChildText = xmlGetText(child); if (szChildText) - db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText)); + db_set_ws(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText)); } else if (!mir_wstrcmpi(childName, L"copyright")) { LPCTSTR szChildText = NULL; @@ -334,22 +334,22 @@ void CheckCurrentFeed(MCONTACT hContact) HXML imageval = xmlGetChild(child, x); if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) { LPCTSTR url = xmlGetText(imageval); - db_set_ts(hContact, MODULE, "ImageURL", url); + db_set_ws(hContact, MODULE, "ImageURL", url); PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = hContact; - wchar_t *szNick = db_get_tsa(hContact, MODULE, "Nick"); + wchar_t *szNick = db_get_wsa(hContact, MODULE, "Nick"); if (szNick) { wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1; ai.format = ProtoGetAvatarFormat(url); - CMString filename = szNick; + CMStringW filename = szNick; filename.Replace(L"/", L"_"); mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename.c_str(), ext); - CreateDirectoryTreeT(tszRoot); + CreateDirectoryTreeW(tszRoot); if (DownloadFile(url, ai.filename)) { - db_set_ts(hContact, MODULE, "ImagePath", ai.filename); + db_set_ws(hContact, MODULE, "ImagePath", ai.filename); ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL); } else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL); @@ -380,7 +380,7 @@ void CheckCurrentFeed(MCONTACT hContact) } } else if (!mir_wstrcmpi(childName, L"item")) { - CMString title, link, descr, author, comments, guid, category; + CMStringW title, link, descr, author, comments, guid, category; time_t stamp = 0; for (int z = 0; z < xmlGetChildCount(child); z++) { HXML itemval = xmlGetChild(child, z); @@ -426,14 +426,14 @@ void CheckCurrentFeed(MCONTACT hContact) } } else if (!mir_wstrcmpi(szNodeName, L"feed")) { - db_set_ts(hContact, MODULE, "MirVer", L"Atom 3"); + db_set_ws(hContact, MODULE, "MirVer", L"Atom 3"); for (int j = 0; j < xmlGetChildCount(node); j++) { HXML child = xmlGetChild(node, j); LPCTSTR szChildName = xmlGetName(child); if (!mir_wstrcmpi(szChildName, L"title")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) - db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText)); + db_set_ws(hContact, MODULE, "FirstName", ClearText(szValue, szChildText)); } else if (!mir_wstrcmpi(szChildName, L"link")) { for (int x = 0; x < xmlGetAttrCount(child); x++) { @@ -442,27 +442,27 @@ void CheckCurrentFeed(MCONTACT hContact) break; if (!mir_wstrcmpi(xmlGetAttrName(child, x), L"href")) - db_set_ts(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x))); + db_set_ws(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x))); } } else if (!mir_wstrcmpi(szChildName, L"subtitle")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) { ClearText(szValue, szChildText); - db_set_ts(hContact, MODULE, "About", szValue); - db_set_ts(hContact, "CList", "StatusMsg", szValue); + db_set_ws(hContact, MODULE, "About", szValue); + db_set_ws(hContact, "CList", "StatusMsg", szValue); } } else if (!mir_wstrcmpi(szChildName, L"language")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) - db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText)); + db_set_ws(hContact, MODULE, "Language1", ClearText(szValue, szChildText)); } else if (!mir_wstrcmpi(szChildName, L"author")) { for (int x = 0; x < xmlGetChildCount(child); x++) { HXML authorval = xmlGetChild(child, x); if (!mir_wstrcmpi(xmlGetName(authorval), L"email")) { - db_set_ts(hContact, MODULE, "e-mail", xmlGetText(authorval)); + db_set_ws(hContact, MODULE, "e-mail", xmlGetText(authorval)); break; } } @@ -470,16 +470,16 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_wstrcmpi(szChildName, L"category")) { LPCTSTR szChildText = xmlGetText(child); if (szChildText) - db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText)); + db_set_ws(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText)); } else if (!mir_wstrcmpi(szChildName, L"icon")) { for (int x = 0; x < xmlGetChildCount(child); x++) { HXML imageval = xmlGetChild(child, x); if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) { LPCTSTR url = xmlGetText(imageval); - db_set_ts(hContact, MODULE, "ImageURL", url); + db_set_ws(hContact, MODULE, "ImageURL", url); - ptrW szNick(db_get_tsa(hContact, MODULE, "Nick")); + ptrW szNick(db_get_wsa(hContact, MODULE, "Nick")); if (szNick) { PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = hContact; @@ -489,7 +489,7 @@ void CheckCurrentFeed(MCONTACT hContact) wchar_t *filename = szNick; mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); if (DownloadFile(url, ai.filename)) { - db_set_ts(hContact, MODULE, "ImagePath", ai.filename); + db_set_ws(hContact, MODULE, "ImagePath", ai.filename); ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL); } else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL); @@ -513,7 +513,7 @@ void CheckCurrentFeed(MCONTACT hContact) } } else if (!mir_wstrcmpi(szChildName, L"entry")) { - CMString title, link, descr, author, comments, guid, category; + CMStringW title, link, descr, author, comments, guid, category; time_t stamp = 0; for (int z = 0; z < xmlGetChildCount(child); z++) { HXML itemval = xmlGetChild(child, z); @@ -587,7 +587,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) if (!db_get_b(hContact, MODULE, "CheckState", 1)) return; - wchar_t *szURL = db_get_tsa(hContact, MODULE, "URL"); + wchar_t *szURL = db_get_wsa(hContact, MODULE, "URL"); if (szURL == NULL) return; @@ -621,12 +621,12 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) HXML imageval = xmlGetChild(child, x); if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) { LPCTSTR url = xmlGetText(imageval); - db_set_ts(hContact, MODULE, "ImageURL", url); + db_set_ws(hContact, MODULE, "ImageURL", url); PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = hContact; - wchar_t *szNick = db_get_tsa(hContact, MODULE, "Nick"); + wchar_t *szNick = db_get_wsa(hContact, MODULE, "Nick"); if (szNick) { wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1; ai.format = ProtoGetAvatarFormat(ext); @@ -634,7 +634,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) wchar_t *filename = szNick; mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); if (DownloadFile(url, ai.filename)) { - db_set_ts(hContact, MODULE, "ImagePath", ai.filename); + db_set_ws(hContact, MODULE, "ImagePath", ai.filename); ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL); } else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL); @@ -654,9 +654,9 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) HXML imageval = xmlGetChild(child, x); if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) { LPCTSTR url = xmlGetText(imageval); - db_set_ts(hContact, MODULE, "ImageURL", url); + db_set_ws(hContact, MODULE, "ImageURL", url); - ptrW szNick(db_get_tsa(hContact, MODULE, "Nick")); + ptrW szNick(db_get_wsa(hContact, MODULE, "Nick")); if (szNick) { PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = hContact; @@ -667,7 +667,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) wchar_t *filename = szNick; mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext); if (DownloadFile(url, ai.filename)) { - db_set_ts(hContact, MODULE, "ImagePath", ai.filename); + db_set_ws(hContact, MODULE, "ImagePath", ai.filename); ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL); } else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL); -- cgit v1.2.3