From c60fdf109150312c1ba5e749aff6196f098b2752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 17 Aug 2022 14:43:52 +0200 Subject: Add FileView::Initialized constructor. --- c/episodelistview.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'c/episodelistview.cpp') 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(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 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 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 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 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 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. */ -- cgit v1.2.3