From 3a133c4063cbb81bee9f5bc55427be75d8e584e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 24 Jul 2022 02:04:38 +0200 Subject: Use Query object in DataListView::ShowEpisode. --- c/episodelistview.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'c/episodelistview.cpp') diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index 7b9653e..5de5e2e 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -431,21 +431,19 @@ void EpisodeListView::Update() void EpisodeListView::UpdateItem(const LVITEM* const pLvi) { std::basic_string tstrName; - int iRating; - static TCHAR tszRating[3]; - if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName)) { if (!Pl("episode_data","update_episode_data")) goto r; - if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName)) - goto r; + if (!Pl("episode_data","episode_title",pLvi->lParam,&tstrName)) goto r; } ListView_SetItemText(hWnd, pLvi->iItem, ELVSITITLE, tstrName.data()); + int iRating; r: if (!Pl("episode_data","episode_rating",pLvi->lParam,&iRating)) { ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, (TCHAR*)TEXT("")); return; } + TCHAR tszRating[3]; _stprintf_s(tszRating, sizeof(tszRating), TEXT("%d"), iRating); ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, tszRating); } -- cgit v1.2.3