From 04f4e2acfbc82946ca3def654214c08071a87359 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 20 Jun 2015 13:55:58 +0000 Subject: xml api became a set of functions git-svn-id: http://svn.miranda-ng.org/main/trunk@14288 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/CheckFeed.cpp | 234 +++++++++++++------------- plugins/NewsAggregator/Src/Common.h | 105 ++++++------ plugins/NewsAggregator/Src/ExportImport.cpp | 138 +++++++-------- plugins/NewsAggregator/Src/NewsAggregator.cpp | 2 - plugins/NewsAggregator/Src/Options.cpp | 7 +- 5 files changed, 242 insertions(+), 244 deletions(-) (limited to 'plugins/NewsAggregator') diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 9e156a3162..3ea2a0f3d9 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. #include "common.h" -TCHAR* CheckFeed(TCHAR *tszURL, HWND hwndDlg) +LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) { Netlib_LogfT(hNetlibUser, _T("Started validating feed %s."), tszURL); char *szData = NULL; @@ -29,47 +29,45 @@ TCHAR* CheckFeed(TCHAR *tszURL, HWND hwndDlg) if (!tszData) tszData = mir_a2t(szData); int bytesParsed = 0; - HXML hXml = xi.parseString(tszData, &bytesParsed, NULL); + HXML hXml = xmlParseString(tszData, &bytesParsed, NULL); mir_free(tszData); mir_free(szData); if (hXml != NULL) { int childcount = 0; HXML node; - if (!mir_tstrcmpi(xi.getName(hXml), _T("xml"))) - node = xi.getChild(hXml, childcount); + if (!mir_tstrcmpi(xmlGetName(hXml), _T("xml"))) + node = xmlGetChild(hXml, childcount); else node = hXml; while (node) { - LPCTSTR szNodeName = xi.getName(node); + LPCTSTR szNodeName = xmlGetName(node); if (!mir_tstrcmpi(szNodeName, _T("rss")) || !mir_tstrcmpi(szNodeName, _T("rdf"))) { - HXML chan = xi.getChild(node, 0); - for (int j = 0; j < xi.getChildCount(chan); j++) { - HXML child = xi.getChild(chan, j); - if (!mir_tstrcmpi(xi.getName(child), _T("title"))) { + HXML chan = xmlGetChild(node, 0); + for (int j = 0; j < xmlGetChildCount(chan); j++) { + HXML child = xmlGetChild(chan, j); + if (!mir_tstrcmpi(xmlGetName(child), _T("title"))) { TCHAR mes[MAX_PATH]; mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL); MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION); - TCHAR *tszTitle = (TCHAR *)xi.getText(child); - return tszTitle; + return xmlGetText(child); } } } else if (!mir_tstrcmpi(szNodeName, _T("feed"))) { - for (int j = 0; j < xi.getChildCount(node); j++) { - HXML child = xi.getChild(node, j); - if (!mir_tstrcmpi(xi.getName(child), _T("title"))) { + for (int j = 0; j < xmlGetChildCount(node); j++) { + HXML child = xmlGetChild(node, j); + if (!mir_tstrcmpi(xmlGetName(child), _T("title"))) { TCHAR mes[MAX_PATH]; mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL); MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION); - TCHAR *tszTitle = (TCHAR *)xi.getText(child); - return tszTitle; + return xmlGetText(child); } } } - node = xi.getChild(hXml, ++childcount); + node = xmlGetChild(hXml, ++childcount); } } - xi.destroyNode(hXml); + xmlDestroyNode(hXml); } Netlib_LogfT(hNetlibUser, _T("%s is not a valid feed's address."), tszURL); TCHAR mes[MAX_PATH]; @@ -178,7 +176,7 @@ void CheckCurrentFeed(MCONTACT hContact) if (!tszData) tszData = mir_a2t(szData); int bytesParsed = 0; - HXML hXml = xi.parseString(tszData, &bytesParsed, NULL); + HXML hXml = xmlParseString(tszData, &bytesParsed, NULL); mir_free(tszData); mir_free(szData); @@ -186,20 +184,20 @@ void CheckCurrentFeed(MCONTACT hContact) if (hXml != NULL) { int childcount = 0; HXML node; - if (!mir_tstrcmpi(xi.getName(hXml), _T("xml"))) - node = xi.getChild(hXml, childcount); + if (!mir_tstrcmpi(xmlGetName(hXml), _T("xml"))) + node = xmlGetChild(hXml, childcount); else node = hXml; while (node) { - LPCTSTR szNodeName = xi.getName(node); + LPCTSTR szNodeName = xmlGetName(node); bool isRSS = !mir_tstrcmpi(szNodeName, _T("rss")), isAtom = !mir_tstrcmpi(szNodeName, _T("rdf")); if (isRSS || isAtom) { if (isRSS) { - for (int i = 0; i < xi.getAttrCount(node); i++) { - LPCTSTR szAttrName = xi.getAttrName(node, i); + for (int i = 0; i < xmlGetAttrCount(node); i++) { + LPCTSTR szAttrName = xmlGetAttrName(node, i); if (!mir_tstrcmpi(szAttrName, _T("version"))) { TCHAR ver[MAX_PATH]; - mir_sntprintf(ver, _countof(ver), _T("RSS %s"), xi.getAttrValue(node, szAttrName)); + mir_sntprintf(ver, _countof(ver), _T("RSS %s"), xmlGetAttrValue(node, szAttrName)); db_set_ts(hContact, MODULE, "MirVer", ver); break; } @@ -208,22 +206,22 @@ void CheckCurrentFeed(MCONTACT hContact) else if (isAtom) db_set_ts(hContact, MODULE, "MirVer", _T("RSS 1.0")); - HXML chan = xi.getChild(node, 0); - for (int j = 0; j < xi.getChildCount(chan); j++) { - HXML child = xi.getChild(chan, j); - LPCTSTR childName = xi.getName(child); + HXML chan = xmlGetChild(node, 0); + for (int j = 0; j < xmlGetChildCount(chan); j++) { + HXML child = xmlGetChild(chan, j); + LPCTSTR childName = xmlGetName(child); if (!mir_tstrcmpi(childName, _T("title"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText)); } else if (!mir_tstrcmpi(childName, _T("link"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "Homepage", ClearText(szValue, szChildText)); } else if (!mir_tstrcmpi(childName, _T("description"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) { ClearText(szValue, szChildText); db_set_ts(hContact, MODULE, "About", szValue); @@ -231,30 +229,30 @@ void CheckCurrentFeed(MCONTACT hContact) } } else if (!mir_tstrcmpi(childName, _T("language"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText)); } else if (!mir_tstrcmpi(childName, _T("managingEditor"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "e-mail", ClearText(szValue, szChildText)); } else if (!mir_tstrcmpi(childName, _T("category"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText)); } else if (!mir_tstrcmpi(childName, _T("copyright"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_s(hContact, "UserInfo", "MyNotes", _T2A(ClearText(szValue, szChildText))); } else if (!mir_tstrcmpi(childName, _T("image"))) { - for (int x = 0; x < xi.getChildCount(child); x++) { - HXML imageval = xi.getChild(child, x); - if (!mir_tstrcmpi(xi.getName(imageval), _T("url"))) { - LPCTSTR url = xi.getText(imageval); + for (int x = 0; x < xmlGetChildCount(child); x++) { + HXML imageval = xmlGetChild(child, x); + if (!mir_tstrcmpi(xmlGetName(imageval), _T("url"))) { + LPCTSTR url = xmlGetText(imageval); db_set_ts(hContact, MODULE, "ImageURL", url); PROTO_AVATAR_INFORMATION ai = { 0 }; @@ -281,15 +279,15 @@ void CheckCurrentFeed(MCONTACT hContact) } } else if (!mir_tstrcmpi(childName, _T("lastBuildDate"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) { - TCHAR *lastupdtime = (TCHAR *)xi.getText(child); + TCHAR *lastupdtime = (TCHAR *)xmlGetText(child); time_t stamp = DateToUnixTime(lastupdtime, 0); double deltaupd = difftime(time(NULL), stamp); double deltacheck = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0)); if (deltaupd - deltacheck >= 0) { db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL)); - xi.destroyNode(hXml); + xmlDestroyNode(hXml); return; } } @@ -297,34 +295,34 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(childName, _T("item"))) { CMString title, link, descr, author, comments, guid, category; time_t stamp = 0; - for (int z = 0; z < xi.getChildCount(child); z++) { - HXML itemval = xi.getChild(child, z); - LPCTSTR itemName = xi.getName(itemval); + for (int z = 0; z < xmlGetChildCount(child); z++) { + HXML itemval = xmlGetChild(child, z); + LPCTSTR itemName = xmlGetName(itemval); // We only use the first tag for now and ignore the rest. if (!mir_tstrcmpi(itemName, _T("title"))) - ClearText(title, xi.getText(itemval)); + ClearText(title, xmlGetText(itemval)); else if (!mir_tstrcmpi(itemName, _T("link"))) - ClearText(link, xi.getText(itemval)); + ClearText(link, xmlGetText(itemval)); else if (!mir_tstrcmpi(itemName, _T("pubDate")) || !mir_tstrcmpi(itemName, _T("date"))) { if (stamp == 0) - stamp = DateToUnixTime(xi.getText(itemval), 0); + stamp = DateToUnixTime(xmlGetText(itemval), 0); } else if (!mir_tstrcmpi(itemName, _T("description")) || !mir_tstrcmpi(itemName, _T("encoded"))) - ClearText(descr, xi.getText(itemval)); + ClearText(descr, xmlGetText(itemval)); else if (!mir_tstrcmpi(itemName, _T("author")) || !mir_tstrcmpi(itemName, _T("creator"))) - ClearText(author, xi.getText(itemval)); + ClearText(author, xmlGetText(itemval)); else if (!mir_tstrcmpi(itemName, _T("comments"))) - ClearText(comments, xi.getText(itemval)); + ClearText(comments, xmlGetText(itemval)); else if (!mir_tstrcmpi(itemName, _T("guid"))) - ClearText(guid, xi.getText(itemval)); + ClearText(guid, xmlGetText(itemval)); else if (!mir_tstrcmpi(itemName, _T("category"))) - ClearText(category, xi.getText(itemval)); + ClearText(category, xmlGetText(itemval)); } XmlToMsg(hContact, title, link, descr, author, comments, guid, category, stamp); @@ -333,26 +331,26 @@ void CheckCurrentFeed(MCONTACT hContact) } else if (!mir_tstrcmpi(szNodeName, _T("feed"))) { db_set_ts(hContact, MODULE, "MirVer", _T("Atom 3")); - for (int j = 0; j < xi.getChildCount(node); j++) { - HXML child = xi.getChild(node, j); - LPCTSTR szChildName = xi.getName(child); + for (int j = 0; j < xmlGetChildCount(node); j++) { + HXML child = xmlGetChild(node, j); + LPCTSTR szChildName = xmlGetName(child); if (!mir_tstrcmpi(szChildName, _T("title"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText)); } else if (!mir_tstrcmpi(szChildName, _T("link"))) { - for (int x = 0; x < xi.getAttrCount(child); x++) { - if (!mir_tstrcmpi(xi.getAttrName(child, x), _T("rel"))) - if (!mir_tstrcmpi(xi.getAttrValue(child, xi.getAttrName(child, x)), _T("self"))) + for (int x = 0; x < xmlGetAttrCount(child); x++) { + if (!mir_tstrcmpi(xmlGetAttrName(child, x), _T("rel"))) + if (!mir_tstrcmpi(xmlGetAttrValue(child, xmlGetAttrName(child, x)), _T("self"))) break; - if (!mir_tstrcmpi(xi.getAttrName(child, x), _T("href"))) - db_set_ts(hContact, MODULE, "Homepage", xi.getAttrValue(child, xi.getAttrName(child, x))); + if (!mir_tstrcmpi(xmlGetAttrName(child, x), _T("href"))) + db_set_ts(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x))); } } else if (!mir_tstrcmpi(szChildName, _T("subtitle"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) { ClearText(szValue, szChildText); db_set_ts(hContact, MODULE, "About", szValue); @@ -360,29 +358,29 @@ void CheckCurrentFeed(MCONTACT hContact) } } else if (!mir_tstrcmpi(szChildName, _T("language"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText)); } else if (!mir_tstrcmpi(szChildName, _T("author"))) { - for (int x = 0; x < xi.getChildCount(child); x++) { - HXML authorval = xi.getChild(child, x); - if (!mir_tstrcmpi(xi.getName(authorval), _T("email"))) { - db_set_ts(hContact, MODULE, "e-mail", xi.getText(authorval)); + for (int x = 0; x < xmlGetChildCount(child); x++) { + HXML authorval = xmlGetChild(child, x); + if (!mir_tstrcmpi(xmlGetName(authorval), _T("email"))) { + db_set_ts(hContact, MODULE, "e-mail", xmlGetText(authorval)); break; } } } else if (!mir_tstrcmpi(szChildName, _T("category"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText)); } else if (!mir_tstrcmpi(szChildName, _T("icon"))) { - for (int x = 0; x < xi.getChildCount(child); x++) { - HXML imageval = xi.getChild(child, x); - if (!mir_tstrcmpi(xi.getName(imageval), _T("url"))) { - LPCTSTR url = xi.getText(imageval); + for (int x = 0; x < xmlGetChildCount(child); x++) { + HXML imageval = xmlGetChild(child, x); + if (!mir_tstrcmpi(xmlGetName(imageval), _T("url"))) { + LPCTSTR url = xmlGetText(imageval); db_set_ts(hContact, MODULE, "ImageURL", url); ptrT szNick(db_get_tsa(hContact, MODULE, "Nick")); @@ -405,7 +403,7 @@ void CheckCurrentFeed(MCONTACT hContact) } } else if (!mir_tstrcmpi(szChildName, _T("updated"))) { - LPCTSTR szChildText = xi.getText(child); + LPCTSTR szChildText = xmlGetText(child); if (szChildText) { TCHAR *lastupdtime = (TCHAR *)szChildText; time_t stamp = DateToUnixTime(lastupdtime, 1); @@ -413,7 +411,7 @@ void CheckCurrentFeed(MCONTACT hContact) double deltacheck = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0)); if (deltaupd - deltacheck >= 0) { db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL)); - xi.destroyNode(hXml); + xmlDestroyNode(hXml); return; } } @@ -421,55 +419,55 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_tstrcmpi(szChildName, _T("entry"))) { CMString title, link, descr, author, comments, guid, category; time_t stamp = 0; - for (int z = 0; z < xi.getChildCount(child); z++) { - HXML itemval = xi.getChild(child, z); - LPCTSTR szItemName = xi.getName(itemval); + for (int z = 0; z < xmlGetChildCount(child); z++) { + HXML itemval = xmlGetChild(child, z); + LPCTSTR szItemName = xmlGetName(itemval); if (!mir_tstrcmpi(szItemName, _T("title"))) { - LPCTSTR szItemText = xi.getText(itemval); + LPCTSTR szItemText = xmlGetText(itemval); if (szItemText) ClearText(title, szItemText); } else if (!mir_tstrcmpi(szItemName, _T("link"))) { - for (int x = 0; x < xi.getAttrCount(itemval); x++) { - if (!mir_tstrcmpi(xi.getAttrName(itemval, x), _T("href"))) { - ClearText(link, xi.getAttrValue(itemval, xi.getAttrName(itemval, x))); + for (int x = 0; x < xmlGetAttrCount(itemval); x++) { + if (!mir_tstrcmpi(xmlGetAttrName(itemval, x), _T("href"))) { + ClearText(link, xmlGetAttrValue(itemval, xmlGetAttrName(itemval, x))); break; } } } else if (!mir_tstrcmpi(szItemName, _T("updated"))) { if (stamp == 0) - stamp = DateToUnixTime(xi.getText(itemval), 0); + stamp = DateToUnixTime(xmlGetText(itemval), 0); } else if (!mir_tstrcmpi(szItemName, _T("summary")) || !mir_tstrcmpi(szItemName, _T("content"))) { - LPCTSTR szItemText = xi.getText(itemval); + LPCTSTR szItemText = xmlGetText(itemval); if (szItemText) ClearText(descr, szItemText); } else if (!mir_tstrcmpi(szItemName, _T("author"))) { - for (int x = 0; x < xi.getChildCount(itemval); x++) { - HXML authorval = xi.getChild(itemval, x); - if (!mir_tstrcmpi(xi.getName(authorval), _T("name")) && xi.getText(authorval)) { - ClearText(author, xi.getText(authorval)); + for (int x = 0; x < xmlGetChildCount(itemval); x++) { + HXML authorval = xmlGetChild(itemval, x); + if (!mir_tstrcmpi(xmlGetName(authorval), _T("name")) && xmlGetText(authorval)) { + ClearText(author, xmlGetText(authorval)); break; } } } else if (!mir_tstrcmpi(szItemName, _T("comments"))) { - LPCTSTR szItemText = xi.getText(itemval); + LPCTSTR szItemText = xmlGetText(itemval); if (szItemText) ClearText(comments, szItemText); } else if (!mir_tstrcmpi(szItemName, _T("id"))) { - LPCTSTR szItemText = xi.getText(itemval); + LPCTSTR szItemText = xmlGetText(itemval); if (szItemText) - ClearText(guid, xi.getText(itemval)); + ClearText(guid, xmlGetText(itemval)); } else if (!mir_tstrcmpi(szItemName, _T("category"))) { - for (int x = 0; x < xi.getAttrCount(itemval); x++) { - LPCTSTR szAttrName = xi.getAttrName(itemval, x); - if (!mir_tstrcmpi(szAttrName, _T("term")) && xi.getText(itemval)) { - ClearText(category, xi.getAttrValue(itemval, szAttrName)); + for (int x = 0; x < xmlGetAttrCount(itemval); x++) { + LPCTSTR szAttrName = xmlGetAttrName(itemval, x); + if (!mir_tstrcmpi(szAttrName, _T("term")) && xmlGetText(itemval)) { + ClearText(category, xmlGetAttrValue(itemval, szAttrName)); break; } } @@ -480,9 +478,9 @@ void CheckCurrentFeed(MCONTACT hContact) } } } - node = xi.getChild(hXml, ++childcount); + node = xmlGetChild(hXml, ++childcount); } - xi.destroyNode(hXml); + xmlDestroyNode(hXml); } } db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL)); @@ -508,25 +506,25 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) if (!tszData) tszData = mir_a2t(szData); int bytesParsed = 0; - HXML hXml = xi.parseString(tszData, &bytesParsed, NULL); + HXML hXml = xmlParseString(tszData, &bytesParsed, NULL); mir_free(tszData); mir_free(szData); if (hXml == NULL) return; int childcount = 0; - HXML node = xi.getChild(hXml, childcount); + HXML node = xmlGetChild(hXml, childcount); while (node) { - LPCTSTR szNodeName = xi.getName(node); + LPCTSTR szNodeName = xmlGetName(node); if (!mir_tstrcmpi(szNodeName, _T("rss")) || !mir_tstrcmpi(szNodeName, _T("rdf"))) { - HXML chan = xi.getChild(node, 0); - for (int j = 0; j < xi.getChildCount(chan); j++) { - HXML child = xi.getChild(chan, j); - if (!mir_tstrcmpi(xi.getName(child), _T("image"))) { - for (int x = 0; x < xi.getChildCount(child); x++) { - HXML imageval = xi.getChild(child, x); - if (!mir_tstrcmpi(xi.getName(imageval), _T("url"))) { - LPCTSTR url = xi.getText(imageval); + HXML chan = xmlGetChild(node, 0); + for (int j = 0; j < xmlGetChildCount(chan); j++) { + HXML child = xmlGetChild(chan, j); + if (!mir_tstrcmpi(xmlGetName(child), _T("image"))) { + for (int x = 0; x < xmlGetChildCount(child); x++) { + HXML imageval = xmlGetChild(child, x); + if (!mir_tstrcmpi(xmlGetName(imageval), _T("url"))) { + LPCTSTR url = xmlGetText(imageval); db_set_ts(hContact, MODULE, "ImageURL", url); PROTO_AVATAR_INFORMATION ai = { 0 }; @@ -553,13 +551,13 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) } } else if (!mir_tstrcmpi(szNodeName, _T("feed"))) { - for (int j = 0; j < xi.getChildCount(node); j++) { - HXML child = xi.getChild(node, j); - if (!mir_tstrcmpi(xi.getName(child), _T("icon"))) { - for (int x = 0; x < xi.getChildCount(child); x++) { - HXML imageval = xi.getChild(child, x); - if (!mir_tstrcmpi(xi.getName(imageval), _T("url"))) { - LPCTSTR url = xi.getText(imageval); + for (int j = 0; j < xmlGetChildCount(node); j++) { + HXML child = xmlGetChild(node, j); + if (!mir_tstrcmpi(xmlGetName(child), _T("icon"))) { + for (int x = 0; x < xmlGetChildCount(child); x++) { + HXML imageval = xmlGetChild(child, x); + if (!mir_tstrcmpi(xmlGetName(imageval), _T("url"))) { + LPCTSTR url = xmlGetText(imageval); db_set_ts(hContact, MODULE, "ImageURL", url); ptrT szNick(db_get_tsa(hContact, MODULE, "Nick")); @@ -584,7 +582,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) } } } - node = xi.getChild(hXml, ++childcount); + node = xmlGetChild(hXml, ++childcount); } - xi.destroyNode(hXml); + xmlDestroyNode(hXml); } diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h index 7a2c424978..6e84892346 100644 --- a/plugins/NewsAggregator/Src/Common.h +++ b/plugins/NewsAggregator/Src/Common.h @@ -88,58 +88,59 @@ void UpdateListAdd(MCONTACT hContact); void UpdateThreadProc(LPVOID AvatarCheck); void DestroyUpdateList(void); -extern HANDLE hUpdateMutex; -extern HGENMENU hService2[7]; - -int NewsAggrInit(WPARAM wParam,LPARAM lParam); -int OptInit(WPARAM wParam, LPARAM lParam); -int NewsAggrPreShutdown(WPARAM wParam,LPARAM lParam); -void NetlibInit(); -void NetlibUnInit(); -void InitMenu(); -void InitIcons(); -HICON LoadIconEx(const char* name, bool big); -HANDLE GetIconHandle(const char* name); -INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam); -INT_PTR NewsAggrGetCaps(WPARAM wp, LPARAM lp); -INT_PTR NewsAggrSetStatus(WPARAM wp, LPARAM /*lp*/); -INT_PTR NewsAggrGetStatus(WPARAM/* wp*/, LPARAM/* lp*/); -INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM lParam); -INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam); -INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam); -INT_PTR NewsAggrRecvMessage(WPARAM wParam, LPARAM lParam); - -INT_PTR CheckAllFeeds(WPARAM wParam, LPARAM lParam); -INT_PTR AddFeed(WPARAM wParam, LPARAM lParam); -INT_PTR ChangeFeed(WPARAM wParam, LPARAM lParam); -INT_PTR ImportFeeds(WPARAM wParam, LPARAM lParam); -INT_PTR ExportFeeds(WPARAM wParam, LPARAM lParam); -INT_PTR CheckFeed(WPARAM wParam, LPARAM lParam); -INT_PTR EnableDisable(WPARAM wParam, LPARAM lParam); -int OnToolbarLoaded(WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); -void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); - -bool IsMyContact(MCONTACT hContact); -void GetNewsData(TCHAR *szUrl, char **szData, MCONTACT hContact, HWND hwndDlg); -void CreateList(HWND hwndList); -void UpdateList(HWND hwndList); -void DeleteAllItems(HWND hwndList); -time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType); -void CheckCurrentFeed(MCONTACT hContact); -void CheckCurrentFeedAvatar(MCONTACT hContact); -TCHAR* CheckFeed(TCHAR* tszURL, HWND hwndDlg); -void UpdateMenu(bool State); -int ImportFeedsDialog(); -LPCTSTR ClearText(CMString &value, const TCHAR *message); -bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal); -void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg); -INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +extern HANDLE hUpdateMutex; +extern HGENMENU hService2[7]; + +int NewsAggrInit(WPARAM wParam,LPARAM lParam); +int OptInit(WPARAM wParam, LPARAM lParam); +int NewsAggrPreShutdown(WPARAM wParam,LPARAM lParam); +void NetlibInit(); +void NetlibUnInit(); +void InitMenu(); +void InitIcons(); +HICON LoadIconEx(const char* name, bool big); +HANDLE GetIconHandle(const char* name); + +INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam); +INT_PTR NewsAggrGetCaps(WPARAM wp, LPARAM lp); +INT_PTR NewsAggrSetStatus(WPARAM wp, LPARAM /*lp*/); +INT_PTR NewsAggrGetStatus(WPARAM/* wp*/, LPARAM/* lp*/); +INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM lParam); +INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam); +INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam); +INT_PTR NewsAggrRecvMessage(WPARAM wParam, LPARAM lParam); + +INT_PTR CheckAllFeeds(WPARAM wParam, LPARAM lParam); +INT_PTR AddFeed(WPARAM wParam, LPARAM lParam); +INT_PTR ChangeFeed(WPARAM wParam, LPARAM lParam); +INT_PTR ImportFeeds(WPARAM wParam, LPARAM lParam); +INT_PTR ExportFeeds(WPARAM wParam, LPARAM lParam); +INT_PTR CheckFeed(WPARAM wParam, LPARAM lParam); +INT_PTR EnableDisable(WPARAM wParam, LPARAM lParam); +int OnToolbarLoaded(WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); +void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); + +bool IsMyContact(MCONTACT hContact); +void GetNewsData(TCHAR *szUrl, char **szData, MCONTACT hContact, HWND hwndDlg); +void CreateList(HWND hwndList); +void UpdateList(HWND hwndList); +void DeleteAllItems(HWND hwndList); +time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType); +void CheckCurrentFeed(MCONTACT hContact); +void CheckCurrentFeedAvatar(MCONTACT hContact); +LPCTSTR CheckFeed(TCHAR* tszURL, HWND hwndDlg); +void UpdateMenu(bool State); +int ImportFeedsDialog(); +LPCTSTR ClearText(CMString &value, const TCHAR *message); +bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal); +void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg); +INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); MCONTACT GetContactByNick(const TCHAR *nick); MCONTACT GetContactByURL(const TCHAR *url); diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index fe6e512c29..d62d9b6f39 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -43,45 +43,45 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR FileName[MAX_PATH]; GetDlgItemText(hwndDlg, IDC_IMPORTFILEPATH, FileName, _countof(FileName)); int bytesParsed = 0; - HXML hXml = xi.parseFile(FileName, &bytesParsed, NULL); + HXML hXml = xmlParseFile(FileName, &bytesParsed, NULL); if(hXml != NULL) { HWND hwndList = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); bool isTextUTF = false, isURLUTF = false, isSiteURLUTF = false, isGroupUTF = false; - HXML node = xi.getChildByPath(hXml, _T("opml/body/outline"), 0); + HXML node = xmlGetChildByPath(hXml, _T("opml/body/outline"), 0); if ( !node) - node = xi.getChildByPath(hXml, _T("body/outline"), 0); + node = xmlGetChildByPath(hXml, _T("body/outline"), 0); int count = (int)SendMessage(FeedsImportList, LB_GETCOUNT, 0, 0); int DUPES = 0; if (node) { while (node) { - int outlineAttr = xi.getAttrCount(node); - int outlineChildsCount = xi.getChildCount(node); - TCHAR *xmlUrl = (TCHAR *)xi.getAttrValue(node, _T("xmlUrl")); + int outlineAttr = xmlGetAttrCount(node); + int outlineChildsCount = xmlGetChildCount(node); + TCHAR *xmlUrl = (TCHAR *)xmlGetAttrValue(node, _T("xmlUrl")); if (!xmlUrl && !outlineChildsCount) { HXML tmpnode = node; - node = xi.getNextNode(node); + node = xmlGetNextNode(node); if ( !node) { do { node = tmpnode; - node = xi.getParent(node); + node = xmlGetParent(node); tmpnode = node; - node = xi.getNextNode(node); + node = xmlGetNextNode(node); if (node) break; - } while (mir_tstrcmpi(xi.getName(node), _T("body"))); + } while (mir_tstrcmpi(xmlGetName(node), _T("body"))); } } else if (!xmlUrl && outlineChildsCount) - node = xi.getFirstChild(node); + node = xmlGetFirstChild(node); else if (xmlUrl) { TCHAR *text = NULL, *url = NULL, *siteurl = NULL, *group = NULL; BYTE NeedToImport = FALSE; for (int i = 0; i < outlineAttr; i++) { - if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("text"))) { - text = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i)))); + if (!mir_tstrcmpi(xmlGetAttrName(node, i), _T("text"))) { + text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); if (!text) { isTextUTF = 0; - text = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i)); + text = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i)); } else isTextUTF = 1; @@ -95,11 +95,11 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM } continue; } - if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("xmlUrl"))) { - url = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i)))); + if (!mir_tstrcmpi(xmlGetAttrName(node, i), _T("xmlUrl"))) { + url = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); if ( !url) { isURLUTF = false; - url = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i)); + url = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i)); } else isURLUTF = true; if (GetContactByURL(url) && NeedToImport) { @@ -108,11 +108,11 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM } continue; } - if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("htmlUrl"))) { - siteurl = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i)))); + if (!mir_tstrcmpi(xmlGetAttrName(node, i), _T("htmlUrl"))) { + siteurl = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); if ( !siteurl) { isSiteURLUTF = false; - siteurl = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i)); + siteurl = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i)); } else isSiteURLUTF = true; continue; @@ -122,21 +122,21 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM } if (NeedToImport) { - HXML parent = xi.getParent(node); + HXML parent = xmlGetParent(node); TCHAR tmpgroup[1024]; - while (mir_tstrcmpi(xi.getName(parent), _T("body"))) { - for (int i = 0; i < xi.getAttrCount(parent); i++) { - if (!mir_tstrcmpi(xi.getAttrName(parent, i), _T("text"))) { + while (mir_tstrcmpi(xmlGetName(parent), _T("body"))) { + for (int i = 0; i < xmlGetAttrCount(parent); i++) { + if (!mir_tstrcmpi(xmlGetAttrName(parent, i), _T("text"))) { if ( !group) - group = (TCHAR *)xi.getAttrValue(parent, xi.getAttrName(parent, i)); + group = (TCHAR *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i)); else { - mir_sntprintf(tmpgroup, _countof(tmpgroup), _T("%s\\%s"), xi.getAttrValue(parent, xi.getAttrName(parent, i)), group); + mir_sntprintf(tmpgroup, _countof(tmpgroup), _T("%s\\%s"), xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group); group = tmpgroup; } break; } } - parent = xi.getParent(parent); + parent = xmlGetParent(parent); } TCHAR *utfgroup = NULL; @@ -187,22 +187,22 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM mir_free(siteurl); HXML tmpnode = node; - node = xi.getNextNode(node); + node = xmlGetNextNode(node); if ( !node) { do { node = tmpnode; - node = xi.getParent(node); + node = xmlGetParent(node); tmpnode = node; - node = xi.getNextNode(node); + node = xmlGetNextNode(node); if (node) break; } - while (mir_tstrcmpi(xi.getName(tmpnode), _T("body"))); + while (mir_tstrcmpi(xmlGetName(tmpnode), _T("body"))); } } } } - xi.destroyNode(hXml); + xmlDestroyNode(hXml); if (hwndList) { DeleteAllItems(hwndList); UpdateList(hwndList); @@ -241,40 +241,40 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (GetOpenFileName(&ofn)) { int bytesParsed = 0; - HXML hXml = xi.parseFile(FileName, &bytesParsed, NULL); + HXML hXml = xmlParseFile(FileName, &bytesParsed, NULL); if(hXml != NULL) { - HXML node = xi.getChildByPath(hXml, _T("opml/body/outline"), 0); + HXML node = xmlGetChildByPath(hXml, _T("opml/body/outline"), 0); if ( !node) - node = xi.getChildByPath(hXml, _T("body/outline"), 0); + node = xmlGetChildByPath(hXml, _T("body/outline"), 0); if (node) { while (node) { - int outlineAttr = xi.getAttrCount(node); - int outlineChildsCount = xi.getChildCount(node); - TCHAR *xmlUrl = (TCHAR *)xi.getAttrValue(node, _T("xmlUrl")); + int outlineAttr = xmlGetAttrCount(node); + int outlineChildsCount = xmlGetChildCount(node); + TCHAR *xmlUrl = (TCHAR *)xmlGetAttrValue(node, _T("xmlUrl")); if (!xmlUrl && !outlineChildsCount) { HXML tmpnode = node; - node = xi.getNextNode(node); + node = xmlGetNextNode(node); if ( !node) { do { node = tmpnode; - node = xi.getParent(node); + node = xmlGetParent(node); tmpnode = node; - node = xi.getNextNode(node); + node = xmlGetNextNode(node); if (node) break; - } while (mir_tstrcmpi(xi.getName(node), _T("body"))); + } while (mir_tstrcmpi(xmlGetName(node), _T("body"))); } } else if (!xmlUrl && outlineChildsCount) - node = xi.getFirstChild(node); + node = xmlGetFirstChild(node); else if (xmlUrl) { for (int i = 0; i < outlineAttr; i++) { - if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("text"))) { - TCHAR *text = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i)))); + if (!mir_tstrcmpi(xmlGetAttrName(node, i), _T("text"))) { + TCHAR *text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i)))); bool isTextUTF; if (!text) { isTextUTF = false; - text = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i)); + text = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i)); } else isTextUTF = true; SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)text); @@ -287,23 +287,23 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM HXML tmpnode = node; - node = xi.getNextNode(node); + node = xmlGetNextNode(node); if ( !node) { do { node = tmpnode; - node = xi.getParent(node); + node = xmlGetParent(node); tmpnode = node; - node = xi.getNextNode(node); + node = xmlGetNextNode(node); if (node) break; - } while (mir_tstrcmpi(xi.getName(tmpnode), _T("body"))); + } while (mir_tstrcmpi(xmlGetName(tmpnode), _T("body"))); } } } } else MessageBox(hwndDlg, TranslateT("Not valid import file."), TranslateT("Error"), MB_OK | MB_ICONERROR); - xi.destroyNode(hXml); + xmlDestroyNode(hXml); SetDlgItemText(hwndDlg, IDC_IMPORTFILEPATH, FileName); } else @@ -503,11 +503,11 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ofn.lpstrDefExt = _T(""); if (GetSaveFileName(&ofn)) { - HXML hXml = xi.createNode(_T("opml"), NULL, FALSE); - xi.addAttr(hXml, _T("version"), _T("1.0")); - HXML header = xi.addChild(hXml, _T("head"), NULL); - xi.addChild(header, _T("title"), _T("Miranda NG NewsAggregator plugin export")); - header = xi.addChild(hXml, _T("body"), NULL); + HXML hXml = xmlCreateNode(_T("opml"), NULL, FALSE); + xmlAddAttr(hXml, _T("version"), _T("1.0")); + HXML header = xmlAddChild(hXml, _T("head"), NULL); + xmlAddChild(header, _T("title"), _T("Miranda NG NewsAggregator plugin export")); + header = xmlAddChild(hXml, _T("body"), NULL); int count = (int)SendMessage(FeedsExportList, LB_GETCOUNT, 0, 0); for (int i = 0; i < count; i++) { @@ -526,34 +526,34 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR *section = _tcstok(group, _T("\\")); while (section != NULL) { - HXML existgroup = xi.getChildByAttrValue(header, _T("outline"), _T("title"), section); + HXML existgroup = xmlGetChildByAttrValue(header, _T("outline"), _T("title"), section); if ( !existgroup) { - elem = xi.addChild(elem, _T("outline"), NULL); - xi.addAttr(elem, _T("title"), section); - xi.addAttr(elem, _T("text"), section); + elem = xmlAddChild(elem, _T("outline"), NULL); + xmlAddAttr(elem, _T("title"), section); + xmlAddAttr(elem, _T("text"), section); } else { elem = existgroup; } section = _tcstok(NULL, _T("\\")); } - elem = xi.addChild(elem, _T("outline"), NULL); + elem = xmlAddChild(elem, _T("outline"), NULL); } else - elem = xi.addChild(elem, _T("outline"), NULL); - xi.addAttr(elem, _T("text"), title); - xi.addAttr(elem, _T("title"), title); - xi.addAttr(elem, _T("type"), _T("rss")); - xi.addAttr(elem, _T("xmlUrl"), url); - xi.addAttr(elem, _T("htmlUrl"), siteurl); + elem = xmlAddChild(elem, _T("outline"), NULL); + xmlAddAttr(elem, _T("text"), title); + xmlAddAttr(elem, _T("title"), title); + xmlAddAttr(elem, _T("type"), _T("rss")); + xmlAddAttr(elem, _T("xmlUrl"), url); + xmlAddAttr(elem, _T("htmlUrl"), siteurl); mir_free(title); mir_free(url); mir_free(siteurl); mir_free(group); } - xi.toFile(hXml, FileName, 1); - xi.destroyNode(hXml); + xmlToFile(hXml, FileName, 1); + xmlDestroyNode(hXml); } } diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index fc40b58c16..279a69ea5a 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -25,7 +25,6 @@ int hLangpack; HANDLE hPrebuildMenuHook = NULL; HWND hAddFeedDlg; MWindowList hChangeFeedDlgList = NULL; -XML_API xi = {0}; TCHAR tszRoot[MAX_PATH] = {0}; HANDLE hUpdateMutex; @@ -57,7 +56,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfoEx); - mir_getXI(&xi); // Add options hook HookEvent(ME_OPT_INITIALISE, OptInit); diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 66006753ff..7dac335b90 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -114,7 +114,8 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_DISCOVERY: EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE); SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait...")); - TCHAR tszURL[MAX_PATH] = { 0 }, *tszTitle = NULL; + TCHAR tszURL[MAX_PATH] = { 0 }; + const TCHAR *tszTitle = NULL; if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, _T("http://")) != 0) tszTitle = CheckFeed(tszURL, hwndDlg); else @@ -281,7 +282,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, _T("http://")) != 0) { EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE); SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait...")); - TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg); + const TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg); SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle); EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE); SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Check Feed")); @@ -436,7 +437,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, _T("http://")) != 0) { EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE); SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait...")); - TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg); + const TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg); SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle); EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE); SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Check Feed")); -- cgit v1.2.3