[mythtv] [PATCH] osd channel browse mode displays junk when no data
for channel
Jack Porter
jack at porter.net.au
Wed Dec 29 15:09:21 UTC 2004
Hi,
When using Browse mode while watching live tv, if you pass a channel for
which there is no current program data, junk is displayed instead of the
channel name/number.
This patch makes ProgramInfo::GetProgramAtDateTime() check if
ProgramList::FromProgram() returned any results, and if not it looks up
just the channel data.
Cheers
Jack
--
Jack Porter Seoul
jack at porter.net.au South Korea
-------------- next part --------------
Index: mythtv/libs/libmythtv/programinfo.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/programinfo.cpp,v
retrieving revision 1.180
diff -r1.180 programinfo.cpp
506c506,554
< return progList.take(0);
---
> if (!progList.isEmpty())
> {
> return progList.take(0);
> }
> else
> {
> ProgramInfo *p = new ProgramInfo;
> QString querystr = QString("SELECT chanid, channum, callsign, name, "
> "commfree, outputfilters "
> "FROM channel "
> "WHERE chanid = \"%1\";")
> .arg(channel);
>
> QSqlQuery query(QString::null, db);
> query.prepare(querystr);
>
> if (!query.exec() || !query.isActive())
> {
> MythContext::DBError("ProgramInfo::GetProgramAtDateTime",
> query.executedQuery());
> return p;
> }
>
> if (query.next())
> {
> p->chanid = query.value(0).toString();
> p->startts = dtime;
> p->endts = dtime;
> p->recstartts = p->startts;
> p->recendts = p->endts;
> p->lastmodified = p->startts;
> p->title = "";
> p->subtitle = "";
> p->description = "";
> p->category = "";
> p->chanstr = query.value(1).toString();
> p->chansign = QString::fromUtf8(query.value(2).toString());
> p->channame = QString::fromUtf8(query.value(3).toString());
> p->repeat = 0;
> p->chancommfree = query.value(4).toInt();
> p->chanOutputFilters = query.value(5).toString();
> p->seriesid = "";
> p->programid = "";
> p->year = "";
> p->stars = 0.f;
> }
>
> return p;
> }
More information about the mythtv-dev
mailing list