diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-31 19:56:53 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-31 19:58:54 +0200 |
commit | d9e1caa37e53c7dbc42b1fc652efc23a40c47c42 (patch) | |
tree | d2a1608a3c88fef98af9a356a116af3551ea5680 /c/datalistview.cpp | |
parent | d9bafcecfd60f38f98bca8a1705f6007b39e18a2 (diff) | |
download | EpisodeBrowser-d9e1caa37e53c7dbc42b1fc652efc23a40c47c42.tar.gz |
Limit use of Hungarian notation.
I don't hate Hungarian notation. It has some very nice qualities. But
it also adds a lot of typing.
That said, not using it feels a bit... unsafe. I might go back on this
decision. We'll see.
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r-- | c/datalistview.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp index 02a399f..dd59250 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -40,34 +40,34 @@ void DataListView::ResizeColumns(int w) void DataListView::ShowEpisode(const int iEpisode) { - extern EpisodeListView* const g_pElv; + extern EpisodeListView* const g_elv; ListView_DeleteAllItems(hWnd); Frame f; - const int iArity = 3; - const term_t t = PL_new_term_refs(iArity); + const int arity = 3; + const term_t t = PL_new_term_refs(arity); if (!PlPut(t, iEpisode)) return; - Query q (NULL, PL_predicate("episode_datum", iArity, "episode_data"), t); + Query q (NULL, PL_predicate("episode_datum", arity, "episode_data"), t); LVITEM lviKey = {LVIF_TEXT}; LVITEM lviValue = {LVIF_TEXT}; for (int i = 0; q.NextSolution(std::nothrow); i++) { - wstring_owner wsoKey; - wstring_owner wsoValue; + wstring_owner key; + wstring_owner value; - if (!(PlGet(t+1, &wsoKey) && PlGet(t+2, &wsoValue))) + if (!(PlGet(t+1, &key) && PlGet(t+2, &value))) continue; lviKey.iItem = i; lviKey.iSubItem = 0; - lviKey.pszText = wsoKey.p; + lviKey.pszText = key.p; ListView_InsertItem(hWnd, &lviKey); lviValue.iItem = i; lviValue.iSubItem = 1; - lviValue.pszText = wsoValue.p; + lviValue.pszText = value.p; ListView_SetItem(hWnd, &lviValue); } @@ -76,7 +76,7 @@ void DataListView::ShowEpisode(const int iEpisode) LVFINDINFO lvfi; lvfi.flags = LVFI_PARAM; lvfi.lParam = iEpisode; - int iItem = ListView_FindItem(g_pElv->hWnd, -1, &lvfi); + int iItem = ListView_FindItem(g_elv->hWnd, -1, &lvfi); if (iItem != -1) - ListView_EnsureVisible(g_pElv->hWnd, iItem, TRUE); + ListView_EnsureVisible(g_elv->hWnd, iItem, TRUE); } |