diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-17 14:43:52 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-17 14:43:52 +0200 |
commit | c60fdf109150312c1ba5e749aff6196f098b2752 (patch) | |
tree | 8452b421ff2b4f2e86d4b11b6b906c6fbbe4a656 /c/episodelistview.cpp | |
parent | 1d041ad5b123e4ecbe69dfa621349f6be9b933d6 (diff) | |
download | EpisodeBrowser-c60fdf109150312c1ba5e749aff6196f098b2752.tar.gz |
Add FileView::Initialized constructor.
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r-- | c/episodelistview.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index f004f8a..db53be3 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -12,6 +12,8 @@ #include "util.h" #include "win.h" +extern CfgA& g_cfg; + EpisodeListView::EpisodeListView(const HWND hWndParent) : ListView(hWndParent, reinterpret_cast<HMENU>(IDC_EPISODELISTVIEW), 0) { @@ -34,8 +36,7 @@ EpisodeListView::EpisodeListView(const HWND hWndParent) ListView_InsertColumn(hWnd, ELVSIRATING, &lvc); /* Get saved sort-by-column setting. */ - extern FileView<CfgA> g_fvCfg; - m_iSortCol = g_fvCfg->iSortCol; + m_iSortCol = g_cfg.iSortCol; } void EpisodeListView::EnsureFocusVisible() @@ -136,8 +137,7 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) /* The sign of m_iSortCol decides the sort order. */ m_iSortCol = abs(m_iSortCol) == iCol? -m_iSortCol: iCol; - extern FileView<CfgA> g_fvCfg; - g_fvCfg->iSortCol = m_iSortCol; + g_cfg.iSortCol = m_iSortCol; Sort(); ShowFocus(); return 0; @@ -231,10 +231,9 @@ void EpisodeListView::RestoreFocus() int i, iEpisode, iItem; LVFINDINFO lvfi; extern DataListView* const g_dlv; - extern FileView<CfgA> g_fvCfg; iItem = 0; - iEpisode = g_fvCfg->iFocus; + iEpisode = g_cfg.iFocus; lvfi.flags = LVFI_PARAM; lvfi.lParam = iEpisode; @@ -260,10 +259,9 @@ s: g_dlv->ShowEpisode(iEpisode); void EpisodeListView::SaveFocus() { - extern FileView<CfgA> g_fvCfg; LVITEM lvi = {LVIF_PARAM, -1}; if (FindNextItem(&lvi, LVNI_FOCUSED)) - g_fvCfg->iFocus = lvi.lParam; + g_cfg.iFocus = lvi.lParam; } void EpisodeListView::SetTop(const int iItem) @@ -405,15 +403,14 @@ void EpisodeListView::Update() if (!e.siEp[0]) continue; - extern FileView<CfgA> g_fvCfg; - //if (g_fvCfg->limitScreenwriter[0] && !Pl("episode_data","episode_datum",iEp, - // "Screenwriter",g_fvCfg->limitScreenwriter)) + //if (g_cfg.limitScreenwriter[0] && !Pl("episode_data","episode_datum",iEp, + // "Screenwriter",g_cfg.limitScreenwriter)) // continue; - if (!g_fvCfg->bViewWatched && e.bWatched) + if (!g_cfg.bViewWatched && e.bWatched) continue; - if (!g_fvCfg->bViewTVOriginal && e.bTVOriginal) + if (!g_cfg.bViewTVOriginal && e.bTVOriginal) continue; /* Insert item. */ |