aboutsummaryrefslogtreecommitdiff
path: root/c/datalistview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-24 02:04:38 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-24 02:04:38 +0200
commit3a133c4063cbb81bee9f5bc55427be75d8e584e0 (patch)
tree6404e8c2edca923ab329c51a60841b53f50b484f /c/datalistview.cpp
parent6c29af9e2aa2f3727da41d85005a5fc654a12aa1 (diff)
downloadEpisodeBrowser-3a133c4063cbb81bee9f5bc55427be75d8e584e0.tar.gz
Use Query object in DataListView::ShowEpisode.
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r--c/datalistview.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp
index 82b62e6..a1bb255 100644
--- a/c/datalistview.cpp
+++ b/c/datalistview.cpp
@@ -1,3 +1,4 @@
+#include <sstream>
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
@@ -48,12 +49,13 @@ void DataListView::ShowEpisode(const int iEpisode)
lviValue.mask = LVIF_TEXT;
Frame f;
- const term_t t = PL_new_term_refs(3);
- if (!PL_put_integer(t,iEpisode)) return;
- const qid_t q = PL_open_query(NULL, PL_Q_NORMAL,
- PL_predicate("episode_datum", 3, "episode_data"), t);
+ const int iArity = 3;
+ const term_t t = PL_new_term_refs(iArity);
+ if (!PlPut(t, iEpisode)) return;
- for (int i = 0; PL_next_solution(q); i++) {
+ Query q (NULL, PL_predicate("episode_datum", iArity, "episode_data"), t);
+
+ for (int i = 0; q.NextSolution(); i++) {
std::basic_string<TCHAR> tstrKey;
std::basic_string<TCHAR> tstrValue;
@@ -72,7 +74,6 @@ void DataListView::ShowEpisode(const int iEpisode)
ListView_SetItem(hWnd, &lviValue);
}
- PL_cut_query(q);
UpdateLayout();
LVFINDINFO lvfi;