diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-24 02:04:38 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-24 02:04:38 +0200 |
commit | 3a133c4063cbb81bee9f5bc55427be75d8e584e0 (patch) | |
tree | 6404e8c2edca923ab329c51a60841b53f50b484f /c/episodelistview.cpp | |
parent | 6c29af9e2aa2f3727da41d85005a5fc654a12aa1 (diff) | |
download | EpisodeBrowser-3a133c4063cbb81bee9f5bc55427be75d8e584e0.tar.gz |
Use Query object in DataListView::ShowEpisode.
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r-- | c/episodelistview.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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<TCHAR> 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); } |