diff options
Diffstat (limited to 'c')
-rw-r--r-- | c/main.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
@@ -100,7 +100,7 @@ int WINAPI WinMain(const HINSTANCE hInstance, const HINSTANCE, char* const, cons std::set_terminate(OnTerminate); /* Initialize Prolog. */ - char* argv[] = { const_cast<char*>("EpisodeBrowser"), NULL }; + char* argv[] = {const_cast<char*>("EpisodeBrowser"), NULL}; if (!PL_initialise(1, argv)) throw std::runtime_error("Could not initialize Prolog."); if (!Pl("track_episodes","attach") || !Pl("episode_data","attach")) @@ -419,23 +419,16 @@ void HandleMainMenu(const HWND hWnd, unsigned short command) break; case IDM_VIEW_OTHERS: /* Show/hide other screenwriters. */ if (g_limitScreenwriter[0]) { - CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, - MF_CHECKED); + CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, MF_CHECKED); g_limitScreenwriter[0] = 0; } else { - const int iEpFocus = ListView_GetNextItem(g_elv->hWnd, -1, LVNI_FOCUSED); - if (iEpFocus == -1) break; - - LVITEM lvi = {LVIF_PARAM, iEpFocus}; - if (!ListView_GetItem(g_elv->hWnd, &lvi)) break; + LVITEM lvi = {LVIF_PARAM, -1}; + if (!g_elv->FindNextItem(&lvi, LVNI_FOCUSED)) break; char* s; - if (!Pl("episode_data","episode_datum",lvi.lParam,"Screenwriter",&s)) - break; - strcpy_s(g_limitScreenwriter, - sizeof(g_limitScreenwriter), s); - CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, - MF_UNCHECKED); + if (!Pl("episode_data","episode_datum",lvi.lParam,"Screenwriter",&s)) break; + strcpy_s(g_limitScreenwriter, sizeof(g_limitScreenwriter), s); + CheckMenuItem(GetMenu(hWnd), IDM_VIEW_OTHERS, MF_UNCHECKED); } Pl("cfg","set_limit_screenwriter",g_limitScreenwriter); g_elv->Update(); |