aboutsummaryrefslogtreecommitdiff
path: root/c/datalistview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-11 00:34:44 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-11 00:40:16 +0200
commit8122c83bb3be30325f49d50dbafcd2f14c9b0d2e (patch)
treee0313f5e6fad84c2b5d8517a6efb9e4c82dc953f /c/datalistview.cpp
parentca56ce2c32b4479af32bf7fb5d065ee9a3a45d8a (diff)
downloadEpisodeBrowser-8122c83bb3be30325f49d50dbafcd2f14c9b0d2e.tar.gz
Improve ElvSort.
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r--c/datalistview.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp
index 3269dab..05d46a4 100644
--- a/c/datalistview.cpp
+++ b/c/datalistview.cpp
@@ -31,23 +31,18 @@ DataListView::Create()
void
DataListView::ShowEpisode(int iEpisode)
{
- int i, iItem;
- LVFINDINFO lvfi;
- LVITEM lviKey, lviValue;
- term_t t;
- qid_t q;
-
ListView_DeleteAllItems(m_hWnd);
+ LVITEM lviKey, lviValue;
lviKey.mask = LVIF_TEXT;
lviValue.mask = LVIF_TEXT;
- t = PL_new_term_refs(3);
+ term_t t = PL_new_term_refs(3);
if (!Plp(t,"I",iEpisode)) return;
- q = PL_open_query(NULL, PL_Q_NORMAL,
+ qid_t q = PL_open_query(NULL, PL_Q_NORMAL,
PL_predicate("episode_datum", 3, "episode_data"), t);
- for (i = 0; PL_next_solution(q); i++) {
+ for (int i = 0; PL_next_solution(q); i++) {
char *szKey;
char *szValue;
TCHAR *tszKey, *tszValue;
@@ -77,9 +72,10 @@ DataListView::ShowEpisode(int iEpisode)
PL_cut_query(q);
UpdateLayout();
+ LVFINDINFO lvfi;
lvfi.flags = LVFI_PARAM;
lvfi.lParam = iEpisode;
- iItem = ListView_FindItem(g_elv.HWnd(), -1, &lvfi);
+ int iItem = ListView_FindItem(g_elv.HWnd(), -1, &lvfi);
if (iItem != -1)
ListView_EnsureVisible(g_elv.HWnd(), iItem, TRUE);
}