diff options
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r-- | c/episodelistview.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index be753a6..824b527 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -12,11 +12,9 @@ #include "util.h" #include "win.h" -constexpr size_t MAX_EPISODES = 8192; - EpisodeListView::EpisodeListView(const HWND hWndParent) : ListView(hWndParent, reinterpret_cast<HMENU>(IDC_EPISODELISTVIEW), 0), - m_fv(L"elvdata.dat", MAX_EPISODES) + m_fv(L"elvdata.dat", ELVMAX) { LVCOLUMN lvc; @@ -37,8 +35,8 @@ EpisodeListView::EpisodeListView(const HWND hWndParent) ListView_InsertColumn(hWnd, ELVSIRATING, &lvc); /* Get saved sort-by-column setting. */ - if (!Pl("cfg","get_sort",&m_iSortCol)) - m_iSortCol = 1; + extern FileView<CfgA> g_fvCfg; + m_iSortCol = g_fvCfg->iSortCol; } void EpisodeListView::EnsureFocusVisible() @@ -139,7 +137,8 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) /* The sign of m_iSortCol decides the sort order. */ m_iSortCol = abs(m_iSortCol) == iCol? -m_iSortCol: iCol; - Pl("cfg","set_sort",m_iSortCol); + extern FileView<CfgA> g_fvCfg; + g_fvCfg->iSortCol = m_iSortCol; Sort(); ShowFocus(); return 0; @@ -233,9 +232,10 @@ void EpisodeListView::RestoreFocus() int i, iEpisode, iItem; LVFINDINFO lvfi; extern DataListView* const g_dlv; + extern FileView<CfgA> g_fvCfg; iItem = 0; - if (!Pl("cfg","get_focus",&iEpisode)) return; + iEpisode = g_fvCfg->iFocus; lvfi.flags = LVFI_PARAM; lvfi.lParam = iEpisode; @@ -261,9 +261,10 @@ s: g_dlv->ShowEpisode(iEpisode); void EpisodeListView::SaveFocus() { + extern FileView<CfgA> g_fvCfg; LVITEM lvi = {LVIF_PARAM, -1}; if (FindNextItem(&lvi, LVNI_FOCUSED)) - Pl("cfg","set_focus",lvi.lParam); + g_fvCfg->iFocus = lvi.lParam; } void EpisodeListView::SetTop(const int iItem) @@ -405,15 +406,15 @@ void EpisodeListView::Update() if (!e.siEp[0]) continue; - if (extern char g_limitScreenwriter[]; - g_limitScreenwriter[0] && !Pl("episode_data","episode_datum",iEp, - "Screenwriter",g_limitScreenwriter)) - continue; + extern FileView<CfgA> g_fvCfg; + //if (g_fvCfg->limitScreenwriter[0] && !Pl("episode_data","episode_datum",iEp, + // "Screenwriter",g_fvCfg->limitScreenwriter)) + // continue; - if (extern int g_bViewWatched; !g_bViewWatched && e.bWatched) + if (!g_fvCfg->bViewWatched && e.bWatched) continue; - if (extern int g_bViewTVOriginal; !g_bViewTVOriginal && e.bTVOriginal) + if (!g_fvCfg->bViewTVOriginal && e.bTVOriginal) continue; /* Insert item. */ |