aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r--c/episodelistview.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp
index 1a41986..a802f90 100644
--- a/c/episodelistview.cpp
+++ b/c/episodelistview.cpp
@@ -287,11 +287,10 @@ void EpisodeListView::Update()
extern char g_szLimitScreenwriter[];
extern int g_bViewTVOriginal, g_bViewWatched;
- if (g_szLimitScreenwriter[0])
- if (!Pl("episode_data","episode_datum",
- iEp,"Screenwriter",g_szLimitScreenwriter))
- continue;
-
+ if (g_szLimitScreenwriter[0]
+ && !Pl("episode_data","episode_datum",iEp,"Screenwriter",g_szLimitScreenwriter))
+ continue;
+
if (!g_bViewWatched)
if (Pl("track_episodes","watched",iEp)) continue;
@@ -356,30 +355,26 @@ void EpisodeListView::Update()
/* Update episode name and rating. */
void EpisodeListView::UpdateItem(LPLVITEM lpLvi)
{
+ std::basic_string<TCHAR> tsmName;
char *szName;
int iRating;
- TCHAR *tszName;
static TCHAR tszRating[3];
- tszName = NULL;
if (!Pl("episode_data","episode_title",lpLvi->lParam,&szName)) {
if (!Pl("episode_data","update_episode_data")) goto r;
if (!Pl("episode_data","episode_title",lpLvi->lParam,&szName))
goto r;
}
- tszName = TszFromSz(szName, CP_UTF8);
- if (tszName)
- ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSITITLE, tszName);
+ tsmName = TsmFromSz(szName, CP_UTF8);
+ ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSITITLE, tsmName.data());
r: if (!Pl("episode_data","episode_rating",lpLvi->lParam,&iRating)) {
ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSIRATING, TEXT(""));
- goto f;
+ return;
}
_stprintf_s(tszRating, sizeof(tszRating), TEXT("%d"), iRating);
ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSIRATING, tszRating);
-
-f: if (tszName) free(tszName);
}
LRESULT CALLBACK EpisodeListView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)