From 03fe36165b6767bc4e0d26bf1b1de38fdff3f75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 17 Jul 2022 00:50:37 +0200 Subject: Use SWI-Prolog's wide-character functions. This avoids the use of TsmFromSz. --- c/episodelistview.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'c/episodelistview.cpp') diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index 5003495..01b4c1a 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -355,18 +355,16 @@ void EpisodeListView::Update() /* Update episode name and rating. */ void EpisodeListView::UpdateItem(LPLVITEM lpLvi) { - std::basic_string tsmName; - char *szName; + TCHAR *tszName; int iRating; static TCHAR tszRating[3]; - if (!Pl("episode_data","episode_title",lpLvi->lParam,&szName)) { + if (!Pl("episode_data","episode_title",lpLvi->lParam,&tszName)) { if (!Pl("episode_data","update_episode_data")) goto r; - if (!Pl("episode_data","episode_title",lpLvi->lParam,&szName)) + if (!Pl("episode_data","episode_title",lpLvi->lParam,&tszName)) goto r; } - tsmName = TsmFromSz(szName, CP_UTF8); - ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSITITLE, tsmName.data()); + ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSITITLE, tszName); r: if (!Pl("episode_data","episode_rating",lpLvi->lParam,&iRating)) { ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSIRATING, TEXT("")); -- cgit v1.2.3