aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-03-30 20:15:52 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-03-30 20:15:52 +0200
commitc9b8d278883a90f534f30f0830bb003460310823 (patch)
tree009344dc7955e0c971d1c5bac102f7805ea363aa /c/episodelistview.c
parentd1bfa9c377b63ee051e668e8bb60f6051c65787d (diff)
downloadEpisodeBrowser-c9b8d278883a90f534f30f0830bb003460310823.tar.gz
Disregard foreign frames.
I don't think they're necessary.
Diffstat (limited to 'c/episodelistview.c')
-rw-r--r--c/episodelistview.c46
1 files changed, 14 insertions, 32 deletions
diff --git a/c/episodelistview.c b/c/episodelistview.c
index 37962b1..5dc0eeb 100644
--- a/c/episodelistview.c
+++ b/c/episodelistview.c
@@ -72,13 +72,10 @@ ElvHandleNotify(LPARAM lParam)
case NM_DBLCLK:
case NM_RETURN:
{
- fid_t f;
term_t t;
- F(f);
t = T(1);
- PI(t+0, LpLviElvSelection->lParam) goto b;
+ PI(t+0, LpLviElvSelection->lParam) break;
P("local_episodes","open_episode",1,t);
-b: Fd(f);
break;
}
case NM_RCLICK:
@@ -115,21 +112,19 @@ ElvSetTop(int iItem)
void
ElvSelectRecent()
{
- fid_t f;
int iEpisode, iItem;
LVFINDINFO lvfi;
term_t t;
- F(f);
t = T(1);
- P("track_episodes","most_recently_watched",1,t) goto e;
- GI(t,&iEpisode) goto e;
+ P("track_episodes","most_recently_watched",1,t) return;
+ GI(t,&iEpisode) return;
lvfi.flags = LVFI_PARAM;
lvfi.lParam = iEpisode;
iItem = ListView_FindItem(HElv, -1, &lvfi);
- if (iItem == -1) goto e;
+ if (iItem == -1) return;
if (iItem > 5)
ElvSetTop(iItem-5);
@@ -139,15 +134,12 @@ ElvSelectRecent()
LpLviElvSelection->lParam = iEpisode;
ElvUpdateName(LpLviElvSelection);
DlvShowEpisode(iEpisode);
-
-e: Fd(f);
}
/* Update episode list. */
void
ElvUpdate()
{
- fid_t f;
int iLast, iTop;
LVITEM lviEpisode, lviName;
term_t t;
@@ -159,34 +151,31 @@ ElvUpdate()
lviEpisode.mask = LVIF_TEXT|LVIF_PARAM;
lviName.mask = LVIF_TEXT;
- F(f);
t = T(1);
- P("episode_data","last_episode",1,t) goto f;
- GI(t,&iLast) goto f;
+ P("episode_data","last_episode",1,t) return;
+ GI(t,&iLast) return;
for (int i = 0; i < iLast; i++) {
char *szName;
- fid_t f2;
int cb;
TCHAR *tszEpisode, *tszName;
term_t t2;
/* Format name string. */
- F(f2);
t2 = T(3);
- PI(t2,i+1) goto e;
+ PI(t2,i+1) return;
tszName = NULL;
P("episode_data","lookup_episode_local",3,t2) goto skipname;
GAC(t2+1,&szName) goto skipname;
tszName = TszFromSz(szName, CP_UTF8);
- if (!tszName) goto e;
+ if (!tszName) return;
/* Format episode string. */
skipname:
cb = 100;
tszEpisode = malloc(cb*sizeof(TCHAR));
- if (!tszEpisode) goto e1;
+ if (!tszEpisode) goto e;
_stprintf_s(tszEpisode, cb, TEXT("%d"), i+1);
/* Insert item. */
@@ -205,8 +194,7 @@ skipname:
}
free(tszEpisode);
-e1: if (tszName) free(tszName);
-e: Fd(f2);
+e: if (tszName) free(tszName);
}
/* Reset selection and scrolling position. */
@@ -218,7 +206,6 @@ e: Fd(f2);
SendMessage(HElv, WM_SETREDRAW, TRUE, 0);
ElvRedraw();
-f: Fd(f);
}
/* Update episode name. */
@@ -226,21 +213,16 @@ void
ElvUpdateName(LPLVITEM lpLvi)
{
char *szName;
- fid_t f;
TCHAR *tszName;
term_t t;
- F(f);
t = T(3);
- PI(t,lpLvi->lParam) goto e;
- P("episode_data","lookup_episode",3,t) goto e;
- GAC(t+1,&szName) goto e;
+ PI(t,lpLvi->lParam) return;
+ P("episode_data","lookup_episode",3,t) return;
+ GAC(t+1,&szName) return;
tszName = TszFromSz(szName, CP_UTF8);
- if (!tszName) goto e;
+ if (!tszName) return;
ListView_SetItemText(HElv, lpLvi->iItem, 1, tszName);
-
-e: Fd(f);
- return;
}