Index: libs/libmythtv/recordinglist.h
===================================================================
--- libs/libmythtv/recordinglist.h	(revision 22791)
+++ libs/libmythtv/recordinglist.h	(working copy)
@@ -9,7 +9,7 @@
 // of the list while the linked list erase() is always O(1), but all other
 // operations are faster with the deque.
 
-#define PGLIST_USE_LINKED_LIST
+//#define PGLIST_USE_LINKED_LIST
 
 // C++ headers
 #ifdef PGLIST_USE_LINKED_LIST
@@ -29,8 +29,14 @@
 // MythTV headers
 #include "mythexp.h"
 #include "mythdbcon.h"
-#include "programinfo.h" // for ProgramDetailList
 
+class RecordingList;
+MPUBLIC bool LoadFromScheduler(
+    RecordingList      &destination,
+    bool               &hasConflicts,
+    QString             altTable = "",
+    int                 recordid = -1);
+
 /** \class RecordingList
  *  \brief List of RecordingInfo instances, with helper functions.
  */
@@ -45,36 +51,7 @@
 
     RecordingInfo *operator[](uint index);
     const RecordingInfo *operator[](uint index) const;
-    bool operator==(const RecordingList &b) const;
 
-    bool FromScheduler(bool    &hasConflicts,
-                       QString  altTable = "",
-                       int      recordid = -1);
-
-    bool FromScheduler(void)
-    {
-        bool dummyConflicts;
-        return FromScheduler(dummyConflicts, "", -1);
-    };
-
-    bool FromProgram(const QString &sql, MSqlBindings &bindings,
-                     RecordingList &schedList, bool oneChanid = false);
-
-    bool FromProgram(const QString &sql, MSqlBindings &bindings)
-    {
-        RecordingList dummySched;
-        return FromProgram(sql, bindings, dummySched);
-    }
-
-    bool FromRecorded( bool bDescending, RecordingList *pSchedList);
-
-    bool FromOldRecorded(const QString &sql, MSqlBindings &bindings);
-
-    static bool GetProgramDetailList(
-        QDateTime         &nextRecordingStart,
-        bool              *hasConflicts = NULL,
-        ProgramDetailList *list = NULL);
-
     RecordingInfo *take(uint i);
     iterator erase(iterator it);
     void clear(void);
@@ -91,11 +68,6 @@
     void push_back(RecordingInfo *pginfo) { pglist.push_back(pginfo); }
 
     // compatibility with old Q3PtrList
-    bool isEmpty(void) const { return empty(); }
-    size_t count(void) const { return size(); }
-    RecordingInfo *at(uint index) { return (*this)[index]; }
-    void prepend(RecordingInfo *pginfo) { push_front(pginfo); }
-    void append(RecordingInfo *pginfo) { push_back(pginfo); }
     void setAutoDelete(bool auto_delete) { autodelete = auto_delete; }
 
   protected:
Index: libs/libmythtv/programdetail.cpp
===================================================================
--- libs/libmythtv/programdetail.cpp	(revision 0)
+++ libs/libmythtv/programdetail.cpp	(revision 0)
@@ -0,0 +1,49 @@
+#include "programdetail.h"
+#include "programlist.h"
+#include "programinfo.h"
+
+bool GetProgramDetailList(
+    QDateTime &nextRecordingStart, bool *hasConflicts, ProgramDetailList *list)
+{
+    nextRecordingStart = QDateTime();
+
+    bool dummy;
+    bool *conflicts = (hasConflicts) ? hasConflicts : &dummy;
+
+    ProgramList progList;
+    if (!LoadFromScheduler(progList, *conflicts))
+        return false;
+
+    // find the earliest scheduled recording
+    ProgramList::const_iterator it = progList.begin();
+    for (; it != progList.end(); ++it)
+    {
+        if (((*it)->recstatus == rsWillRecord) &&
+            (nextRecordingStart.isNull() ||
+             nextRecordingStart > (*it)->recstartts))
+        {
+            nextRecordingStart = (*it)->recstartts;
+        }
+    }
+
+    if (!list)
+        return true;
+
+    // save the details of the earliest recording(s)
+    for (it = progList.begin(); it != progList.end(); ++it)
+    {
+        if (((*it)->recstatus  == rsWillRecord) &&
+            ((*it)->recstartts == nextRecordingStart))
+        {
+            ProgramDetail prog;
+            prog.channame  = (*it)->channame;
+            prog.title     = (*it)->title;
+            prog.subtitle  = (*it)->subtitle;
+            prog.startTime = (*it)->recstartts;
+            prog.endTime   = (*it)->recendts;
+            list->push_back(prog);
+        }
+    }
+
+    return true;
+}
Index: libs/libmythtv/programdetail.h
===================================================================
--- libs/libmythtv/programdetail.h	(revision 0)
+++ libs/libmythtv/programdetail.h	(revision 0)
@@ -0,0 +1,31 @@
+#ifndef _PROGRAM_DETAIL_H_
+#define _PROGRAM_DETAIL_H_
+
+// C++ headers
+#include <vector>
+using namespace std;
+
+// Qt headers
+#include <QString>
+#include <QDateTime>
+
+// MythTV headers
+#include "mythexp.h"
+
+class MPUBLIC ProgramDetail
+{
+  public:
+    QString   channame;
+    QString   title;
+    QString   subtitle;
+    QDateTime startTime;
+    QDateTime endTime;
+};
+typedef vector<ProgramDetail> ProgramDetailList;
+
+bool GetProgramDetailList(
+    QDateTime         &nextRecordingStart,
+    bool              *hasConflicts = NULL,
+    ProgramDetailList *list = NULL);
+
+#endif // _PROGRAM_DETAIL_H_
Index: libs/libmythtv/libmythtv.pro
===================================================================
--- libs/libmythtv/libmythtv.pro	(revision 22791)
+++ libs/libmythtv/libmythtv.pro	(working copy)
@@ -154,7 +154,7 @@
 HEADERS += transporteditor.h        listingsources.h
 HEADERS += myth_imgconvert.h
 HEADERS += channelgroup.h           channelgroupsettings.h
-HEADERS += recordingrule.h
+HEADERS += recordingrule.h          programdetail.h
 
 SOURCES += recordinginfo.cpp        recordinglist.cpp
 SOURCES += RingBuffer.cpp           avfringbuffer.cpp
@@ -175,7 +175,7 @@
 SOURCES += transporteditor.cpp
 SOURCES += channelgroup.cpp         channelgroupsettings.cpp
 SOURCES += myth_imgconvert.cpp
-SOURCES += recordingrule.cpp
+SOURCES += recordingrule.cpp        programdetail.cpp
 
 # DiSEqC
 HEADERS += diseqc.h                 diseqcsettings.h
Index: libs/libmythtv/viewschdiff.cpp
===================================================================
--- libs/libmythtv/viewschdiff.cpp	(revision 22791)
+++ libs/libmythtv/viewschdiff.cpp	(working copy)
@@ -397,8 +397,8 @@
         }
     }
 
-    recListBefore.FromScheduler(conflictBool);
-    recListAfter.FromScheduler(conflictBool, altTable, recordid);
+    LoadFromScheduler(recListBefore, conflictBool);
+    LoadFromScheduler(recListAfter,  conflictBool, altTable, recordid);
 
     recListBefore.sort(comp_recstart_less_than);
     recListAfter.sort(comp_recstart_less_than);
Index: libs/libmythtv/recordinginfo.h
===================================================================
--- libs/libmythtv/recordinginfo.h	(revision 22791)
+++ libs/libmythtv/recordinginfo.h	(working copy)
@@ -21,12 +21,22 @@
 
 class MPUBLIC RecordingInfo : public ProgramInfo
 {
+    friend class RecordingList;
+
   public:
     RecordingInfo(void) : record(NULL) {}
     RecordingInfo(const RecordingInfo &other) :
         ProgramInfo(other), record(NULL) {}
     RecordingInfo(const ProgramInfo &other) :
         ProgramInfo(other), record(NULL) {}
+
+  protected:
+    RecordingInfo(const MSqlQuery   &query,
+                  const ProgramList &schedList,
+                  bool               oneChanid) :
+        ProgramInfo(query, schedList, oneChanid), record(NULL) {}
+
+  public:
     RecordingInfo &operator=(const RecordingInfo &other) {return clone(other);}
     RecordingInfo &operator=(const ProgramInfo &other) { return clone(other); }
 
Index: libs/libmythtv/tv_play.cpp
===================================================================
--- libs/libmythtv/tv_play.cpp	(revision 22791)
+++ libs/libmythtv/tv_play.cpp	(working copy)
@@ -7681,9 +7681,10 @@
     };
 
     ProgramList progList;
-    progList.FromProgram(querystr, bindings);
+    ProgramList dummySched;
+    LoadFromProgram(progList, querystr, bindings, dummySched, false);
 
-    if (progList.isEmpty())
+    if (progList.empty())
     {
         infoMap["dbstarttime"] = "";
         return;
@@ -11525,7 +11526,7 @@
         for (Iprog = progLists.begin(); Iprog != progLists.end(); Iprog++)
         {
             const ProgramList &plist = *Iprog;
-            int progIndex = plist.count();
+            uint progIndex = (uint) plist.size();
 
             if (plist[0]->recgroup != currecgroup)
             {
Index: libs/libmythtv/recordinglist.cpp
===================================================================
--- libs/libmythtv/recordinglist.cpp	(revision 22791)
+++ libs/libmythtv/recordinglist.cpp	(working copy)
@@ -4,8 +4,8 @@
 #include "mythcontext.h"
 #include "mythdb.h"
 #include "util.h"
-#include "recordinginfo.h"
 #include "recordinglist.h"
+#include "recordinginfo.h"
 #include "jobqueue.h"
 
 RecordingList::~RecordingList(void)
@@ -37,22 +37,6 @@
     return (*(const_cast<RecordingList*>(this)))[index];
 }
 
-bool RecordingList::operator==(const RecordingList &b) const
-{
-    const_iterator it_a  = pglist.begin();
-    const_iterator it_b  = b.pglist.begin();
-    const_iterator end_a = pglist.end();
-    const_iterator end_b = b.pglist.end();
-
-    for (; it_a != end_a && it_b != end_b; ++it_a, ++it_b)
-    {
-        if (*it_a != *it_b)
-            return false;
-    }
-
-    return (it_a == end_a) && (it_b == end_b);
-}
-
 RecordingInfo *RecordingList::take(uint index)
 {
 #ifndef PGLIST_USE_LINKED_LIST
@@ -112,21 +96,24 @@
 #endif
 }
 
-bool RecordingList::FromScheduler(bool &hasConflicts, QString tmptable,
-                                int recordid)
+bool LoadFromScheduler(
+    RecordingList &destination, bool &hasConflicts,
+    QString tmptable, int recordid)
 {
-    clear();
+    destination.clear();
     hasConflicts = false;
 
     if (gContext->IsBackend())
         return false;
 
     QString query;
-    if (tmptable != "")
+    if (!tmptable.isEmpty())
     {
         query = QString("QUERY_GETALLPENDING %1 %2")
-                        .arg(tmptable).arg(recordid);
-    } else {
+            .arg(tmptable).arg(recordid);
+    }
+    else
+    {
         query = QString("QUERY_GETALLPENDING");
     }
 
@@ -134,7 +121,7 @@
     if (!gContext->SendReceiveStringList(slist) || slist.size() < 2)
     {
         VERBOSE(VB_IMPORTANT,
-                "RecordingList::FromScheduler(): Error querying master.");
+                "LoadFromScheduler(): Error querying master.");
         return false;
     }
 
@@ -148,501 +135,18 @@
         RecordingInfo *p = new RecordingInfo();
         result = p->FromStringList(sit, slist.end());
         if (result)
-            pglist.push_back(p);
+            destination.push_back(p);
         else
             delete p;
     }
 
-    if (pglist.size() != slist[1].toUInt())
+    if (destination.size() != slist[1].toUInt())
     {
         VERBOSE(VB_IMPORTANT,
-                "RecordingList::FromScheduler(): Length mismatch");
-        clear();
+                "LoadFromScheduler(): Length mismatch.");
+        destination.clear();
         result = false;
     }
 
     return result;
 }
-
-bool RecordingList::FromProgram(const QString &sql, MSqlBindings &bindings,
-                              RecordingList &schedList, bool oneChanid)
-{
-    clear();
-
-    QString querystr = QString(
-        "SELECT DISTINCT program.chanid, program.starttime, program.endtime, "
-        "    program.title, program.subtitle, program.description, "
-        "    program.category, channel.channum, channel.callsign, "
-        "    channel.name, program.previouslyshown, channel.commmethod, "
-        "    channel.outputfilters, program.seriesid, program.programid, "
-        "    program.airdate, program.stars, program.originalairdate, "
-        "    program.category_type, oldrecstatus.recordid, "
-        "    oldrecstatus.rectype, oldrecstatus.recstatus, "
-        "    oldrecstatus.findid "
-        "FROM program "
-        "LEFT JOIN channel ON program.chanid = channel.chanid "
-        "LEFT JOIN oldrecorded AS oldrecstatus ON "
-        "    program.title = oldrecstatus.title AND "
-        "    channel.callsign = oldrecstatus.station AND "
-        "    program.starttime = oldrecstatus.starttime "
-        ) + sql;
-
-    if (!sql.contains(" GROUP BY "))
-        querystr += " GROUP BY program.starttime, channel.channum, "
-            "  channel.callsign, program.title ";
-    if (!sql.contains(" ORDER BY "))
-    {
-        querystr += " ORDER BY program.starttime, ";
-        QString chanorder = gContext->GetSetting("ChannelOrdering", "channum");
-        if (chanorder != "channum")
-            querystr += chanorder + " ";
-        else // approximation which the DB can handle
-            querystr += "atsc_major_chan,atsc_minor_chan,channum,callsign ";
-    }
-    if (!sql.contains(" LIMIT "))
-        querystr += " LIMIT 20000 ";
-
-    MSqlQuery query(MSqlQuery::InitCon());
-    query.prepare(querystr);
-    MSqlBindings::const_iterator it;
-    for (it = bindings.begin(); it != bindings.end(); ++it)
-        if (querystr.contains(it.key()))
-            query.bindValue(it.key(), it.value());
-
-    if (!query.exec())
-    {
-        MythDB::DBError("RecordingList::FromProgram", query);
-        return false;
-    }
-
-    while (query.next())
-    {
-        RecordingInfo *p = new RecordingInfo;
-        p->chanid = query.value(0).toString();
-        p->startts = QDateTime::fromString(query.value(1).toString(),
-                                           Qt::ISODate);
-        p->endts = QDateTime::fromString(query.value(2).toString(),
-                                         Qt::ISODate);
-        p->recstartts = p->startts;
-        p->recendts = p->endts;
-        p->lastmodified = p->startts;
-        p->title = query.value(3).toString();
-        p->subtitle = query.value(4).toString();
-        p->description = query.value(5).toString();
-        p->category = query.value(6).toString();
-        p->chanstr = query.value(7).toString();
-        p->chansign = query.value(8).toString();
-        p->channame = query.value(9).toString();
-        p->repeat = query.value(10).toInt();
-        p->chancommfree = COMM_DETECT_COMMFREE == query.value(11).toInt();
-        p->chanOutputFilters = query.value(12).toString();
-        p->seriesid = query.value(13).toString();
-        p->programid = query.value(14).toString();
-        p->year = query.value(15).toString();
-        p->stars = query.value(16).toString().toFloat();
-
-        if (query.value(17).isNull() || query.value(17).toString().isEmpty())
-        {
-            p->originalAirDate = QDate (0, 1, 1);
-            p->hasAirDate = false;
-        }
-        else
-        {
-            p->originalAirDate =
-                QDate::fromString(query.value(17).toString(),Qt::ISODate);
-
-            if (p->originalAirDate > QDate(1940, 1, 1))
-                p->hasAirDate = true;
-            else
-                p->hasAirDate = false;
-        }
-        p->catType = query.value(18).toString();
-        p->recordid = query.value(19).toInt();
-        p->rectype = RecordingType(query.value(20).toInt());
-        p->recstatus = RecStatusType(query.value(21).toInt());
-        p->findid = query.value(22).toInt();
-
-        iterator it = schedList.pglist.begin();
-        for (; it != schedList.pglist.end(); ++it)
-        {
-            RecordingInfo *s = *it;
-            if (p->IsSameTimeslot(*s))
-            {
-                p->recordid = s->recordid;
-                p->recstatus = s->recstatus;
-                p->rectype = s->rectype;
-                p->recpriority = s->recpriority;
-                p->recstartts = s->recstartts;
-                p->recendts = s->recendts;
-                p->cardid = s->cardid;
-                p->inputid = s->inputid;
-                p->dupin = s->dupin;
-                p->dupmethod = s->dupmethod;
-                p->findid = s->findid;
-
-                if (s->recstatus == rsWillRecord ||
-                    s->recstatus == rsRecording)
-                {
-                    if (oneChanid)
-                    {
-                        p->chanid   = s->chanid;
-                        p->chanstr  = s->chanstr;
-                        p->chansign = s->chansign;
-                        p->channame = s->channame;
-                    }
-                    else if ((p->chanid != s->chanid) &&
-                             (p->chanstr != s->chanstr))
-                    {
-                        p->recstatus = rsOtherShowing;
-                    }
-                }
-            }
-        }
-
-        pglist.push_back(p);
-    }
-
-    return true;
-}
-
-bool RecordingList::FromRecorded( bool bDescending, RecordingList *pSchedList )
-{
-    clear();
-
-    QString     fs_db_name = "";
-    QDateTime   rectime    = QDateTime::currentDateTime().addSecs(
-                              -gContext->GetNumSetting("RecordOverTime"));
-
-    QString ip        = gContext->GetSetting("BackendServerIP");
-    QString port      = gContext->GetSetting("BackendServerPort");
-
-    // ----------------------------------------------------------------------
-
-    QMap<QString, int> inUseMap;
-
-    QString     inUseKey;
-    QString     inUseForWhat;
-    QDateTime   oneHourAgo = QDateTime::currentDateTime().addSecs(-61 * 60);
-
-    MSqlQuery   query(MSqlQuery::InitCon());
-
-    query.prepare("SELECT DISTINCT chanid, starttime, recusage "
-                  " FROM inuseprograms WHERE lastupdatetime >= :ONEHOURAGO ;");
-    query.bindValue(":ONEHOURAGO", oneHourAgo);
-
-    if (query.exec())
-    {
-        while (query.next())
-        {
-            inUseKey = query.value(0).toString() + " " +
-                       query.value(1).toDateTime().toString(Qt::ISODate);
-            inUseForWhat = query.value(2).toString();
-
-            if (!inUseMap.contains(inUseKey))
-                inUseMap[inUseKey] = 0;
-
-            if ((inUseForWhat == "player") ||
-                (inUseForWhat == "preview player") ||
-                (inUseForWhat == "PIP player"))
-                inUseMap[inUseKey] = inUseMap[inUseKey] | FL_INUSEPLAYING;
-            else if (inUseForWhat == "recorder")
-                inUseMap[inUseKey] = inUseMap[inUseKey] | FL_INUSERECORDING;
-        }
-    }
-
-    // ----------------------------------------------------------------------
-
-    QMap<QString,bool> is_job_running;
-    query.prepare("SELECT chanid, starttime, status FROM jobqueue "
-                  "WHERE type = :TYPE");
-    query.bindValue(":TYPE", JOB_COMMFLAG);
-    if (query.exec())
-    {
-        while (query.next())
-        {
-            uint      chanid     = query.value(0).toUInt();
-            QDateTime recstartts = query.value(1).toDateTime();
-            int       tmpStatus  = query.value(2).toInt();
-            if ((tmpStatus != JOB_UNKNOWN) &&
-                (tmpStatus != JOB_QUEUED) &&
-                (!(tmpStatus & JOB_DONE)))
-            {
-                is_job_running[
-                    QString("%1###%2")
-                    .arg(chanid).arg(recstartts.toString())] = true;
-            }
-        }
-    }
-
-    // ----------------------------------------------------------------------
-
-    QString thequery =
-        "SELECT recorded.chanid,recorded.starttime,recorded.endtime,"
-        "recorded.title,recorded.subtitle,recorded.description,"
-        "recorded.hostname,channum,name,callsign,commflagged,cutlist,"
-        "recorded.autoexpire,editing,bookmark,recorded.category,"
-        "recorded.recgroup,record.dupin,record.dupmethod,"
-        "record.recordid,outputfilters,"
-        "recorded.seriesid,recorded.programid,recorded.filesize, "
-        "recorded.lastmodified, recorded.findid, "
-        "recorded.originalairdate, recorded.playgroup, "
-        "recorded.basename, recorded.progstart, "
-        "recorded.progend, recorded.stars, "
-        "recordedprogram.audioprop+0, recordedprogram.videoprop+0, "
-        "recordedprogram.subtitletypes+0, recorded.watched, "
-        "recorded.storagegroup "
-        "FROM recorded "
-        "LEFT JOIN record ON recorded.recordid = record.recordid "
-        "LEFT JOIN channel ON recorded.chanid = channel.chanid "
-        "LEFT JOIN recordedprogram ON "
-        " ( recorded.chanid    = recordedprogram.chanid AND "
-        "   recorded.progstart = recordedprogram.starttime ) "
-        "WHERE ( recorded.deletepending = 0 OR "
-        "        recorded.lastmodified <= DATE_SUB(NOW(), INTERVAL 5 MINUTE) "
-        "      ) "
-        "ORDER BY recorded.starttime";
-
-    if ( bDescending )
-        thequery += " DESC";
-
-    QString chanorder = gContext->GetSetting("ChannelOrdering", "channum");
-    if (chanorder != "channum")
-        thequery += ", " + chanorder;
-    else // approximation which the DB can handle
-        thequery += ",atsc_major_chan,atsc_minor_chan,channum,callsign";
-
-    query.prepare(thequery);
-
-    if (!query.exec())
-    {
-        MythDB::DBError("RecordingList::FromRecorded", query);
-        return true;
-    }
-
-    while (query.next())
-    {
-        RecordingInfo *proginfo = new RecordingInfo;
-
-        proginfo->chanid        = query.value(0).toString();
-        proginfo->startts       = query.value(29).toDateTime();
-        proginfo->endts         = query.value(30).toDateTime();
-        proginfo->recstartts    = query.value(1).toDateTime();
-        proginfo->recendts      = query.value(2).toDateTime();
-        proginfo->title         = query.value(3).toString();
-        proginfo->subtitle      = query.value(4).toString();
-        proginfo->description   = query.value(5).toString();
-        proginfo->hostname      = query.value(6).toString();
-
-        proginfo->dupin         = RecordingDupInType(query.value(17).toInt());
-        proginfo->dupmethod     = RecordingDupMethodType(query.value(18).toInt());
-        proginfo->recordid      = query.value(19).toInt();
-        proginfo->chanOutputFilters = query.value(20).toString();
-        proginfo->seriesid      = query.value(21).toString();
-        proginfo->programid     = query.value(22).toString();
-        proginfo->filesize      = stringToLongLong(query.value(23).toString());
-        proginfo->lastmodified  = QDateTime::fromString(query.value(24).toString(), Qt::ISODate);
-        proginfo->findid        = query.value(25).toInt();
-
-        if (query.value(26).isNull() ||
-            query.value(26).toString().isEmpty())
-        {
-            proginfo->originalAirDate = QDate (0, 1, 1);
-            proginfo->hasAirDate      = false;
-        }
-        else
-        {
-            proginfo->originalAirDate =
-                QDate::fromString(query.value(26).toString(),Qt::ISODate);
-
-            if (proginfo->originalAirDate > QDate(1940, 1, 1))
-                proginfo->hasAirDate  = true;
-            else
-                proginfo->hasAirDate  = false;
-        }
-
-        proginfo->pathname = query.value(28).toString();
-
-
-        if (proginfo->hostname.isEmpty() || proginfo->hostname.isNull())
-            proginfo->hostname = gContext->GetHostName();
-
-        if (!query.value(7).toString().isEmpty())
-        {
-            proginfo->chanstr  = query.value(7).toString();
-            proginfo->channame = query.value(8).toString();
-            proginfo->chansign = query.value(9).toString();
-        }
-        else
-        {
-            proginfo->chanstr  = "#" + proginfo->chanid;
-            proginfo->channame = "#" + proginfo->chanid;
-            proginfo->chansign = "#" + proginfo->chanid;
-        }
-
-        int flags = 0;
-
-        flags |= (query.value(10).toInt() == 1)           ? FL_COMMFLAG : 0;
-        flags |= (query.value(11).toInt() == 1)           ? FL_CUTLIST  : 0;
-        flags |=  query.value(12).toInt()                 ? FL_AUTOEXP  : 0;
-        flags |= (query.value(14).toInt() == 1)           ? FL_BOOKMARK : 0;
-        flags |= (query.value(35).toInt() == 1)           ? FL_WATCHED  : 0;
-
-        inUseKey = query.value(0).toString() + " " +
-            query.value(1).toDateTime().toString(Qt::ISODate);
-
-        if (inUseMap.contains(inUseKey))
-            flags |= inUseMap[inUseKey];
-
-        if (query.value(13).toInt())
-        {
-            flags |= FL_EDITING;
-        }
-        else if (query.value(10).toInt() == COMM_FLAG_PROCESSING)
-        {
-            bool running =
-                is_job_running.find(
-                    QString("%1###%2")
-                    .arg(proginfo->chanid)
-                    .arg(proginfo->recstartts.toString())) !=
-                is_job_running.end();
-            if (running)
-                flags |= FL_EDITING;
-            else
-                proginfo->SetCommFlagged(COMM_FLAG_NOT_FLAGGED);
-        }
-
-        proginfo->programflags = flags;
-
-        proginfo->audioproperties = query.value(32).toInt();
-        proginfo->videoproperties = query.value(33).toInt();
-        proginfo->subtitleType = query.value(34).toInt();
-
-        proginfo->category     = query.value(15).toString();
-        proginfo->recgroup     = query.value(16).toString();
-        proginfo->playgroup    = query.value(27).toString();
-        proginfo->storagegroup = query.value(36).toString();
-        proginfo->recstatus    = rsRecorded;
-
-        if ((pSchedList != NULL) && (proginfo->recendts > rectime))
-        {
-            iterator it = pSchedList->pglist.begin();
-            for (; it != pSchedList->pglist.end(); ++it)
-            {
-                ProgramInfo *s = *it;
-                if (s && s->recstatus    == rsRecording &&
-                    proginfo->chanid     == s->chanid   &&
-                    proginfo->recstartts == s->recstartts)
-                {
-                    proginfo->recstatus = rsRecording;
-                    break;
-                }
-            }
-        }
-
-        proginfo->stars = query.value(31).toDouble();
-
-        pglist.push_back(proginfo);
-    }
-
-    return true;
-}
-
-
-bool RecordingList::FromOldRecorded(const QString &sql, MSqlBindings &bindings)
-{
-    clear();
-    MSqlQuery query(MSqlQuery::InitCon());
-
-    query.prepare("SELECT oldrecorded.chanid, starttime, endtime, "
-                  " title, subtitle, description, category, seriesid, "
-                  " programid, channel.channum, channel.callsign, "
-                  " channel.name, findid, rectype, recstatus, recordid, "
-                  " duplicate "
-                  " FROM oldrecorded "
-                  " LEFT JOIN channel ON oldrecorded.chanid = channel.chanid "
-                  + sql);
-    query.bindValues(bindings);
-
-    if (!query.exec() || !query.isActive())
-    {
-        MythDB::DBError("RecordingList::FromOldRecorded", query);
-        return false;
-    }
-
-    while (query.next())
-    {
-        RecordingInfo *p = new RecordingInfo;
-        p->chanid = query.value(0).toString();
-        p->startts = QDateTime::fromString(query.value(1).toString(),
-                                           Qt::ISODate);
-        p->endts = QDateTime::fromString(query.value(2).toString(),
-                                         Qt::ISODate);
-        p->recstartts = p->startts;
-        p->recendts = p->endts;
-        p->lastmodified = p->startts;
-        p->title = query.value(3).toString();
-        p->subtitle = query.value(4).toString();
-        p->description = query.value(5).toString();
-        p->category = query.value(6).toString();
-        p->seriesid = query.value(7).toString();
-        p->programid = query.value(8).toString();
-        p->chanstr = query.value(9).toString();
-        p->chansign = query.value(10).toString();
-        p->channame = query.value(11).toString();
-        p->findid = query.value(12).toInt();
-        p->rectype = RecordingType(query.value(13).toInt());
-        p->recstatus = RecStatusType(query.value(14).toInt());
-        p->recordid = query.value(15).toInt();
-        p->duplicate = query.value(16).toInt();
-
-        pglist.push_back(p);
-    }
-
-    return true;
-}
-
-bool RecordingList::GetProgramDetailList(
-    QDateTime &nextRecordingStart, bool *hasConflicts, ProgramDetailList *list)
-{
-    nextRecordingStart = QDateTime();
-
-    bool dummy;
-    bool *conflicts = (hasConflicts) ? hasConflicts : &dummy;
-
-    RecordingList progList;
-    if (!progList.FromScheduler(*conflicts))
-        return false;
-
-    // find the earliest scheduled recording
-    RecordingList::const_iterator it = progList.begin();
-    for (; it != progList.end(); ++it)
-    {
-        if (((*it)->recstatus == rsWillRecord) &&
-            (nextRecordingStart.isNull() ||
-             nextRecordingStart > (*it)->recstartts))
-        {
-            nextRecordingStart = (*it)->recstartts;
-        }
-    }
-
-    if (!list)
-        return true;
-
-    // save the details of the earliest recording(s)
-    for (it = progList.begin(); it != progList.end(); ++it)
-    {
-        if (((*it)->recstatus  == rsWillRecord) &&
-            ((*it)->recstartts == nextRecordingStart))
-        {
-            ProgramDetail prog;
-            prog.channame  = (*it)->channame;
-            prog.title     = (*it)->title;
-            prog.subtitle  = (*it)->subtitle;
-            prog.startTime = (*it)->recstartts;
-            prog.endTime   = (*it)->recendts;
-            list->push_back(prog);
-        }
-    }
-
-    return true;
-}
Index: libs/libmyth/programinfo.h
===================================================================
--- libs/libmyth/programinfo.h	(revision 22791)
+++ libs/libmyth/programinfo.h	(working copy)
@@ -213,12 +213,22 @@
  *  view or record.
  */
 
+class MSqlQuery;
+class ProgramList;
+
 class MPUBLIC ProgramInfo
 {
+    friend class ProgramList;
+
   public:
-    // Constructors and bulk set methods.
+    // Constructors
     ProgramInfo(void);
     ProgramInfo(const ProgramInfo &other);
+    ProgramInfo(const MSqlQuery   &query,
+                const ProgramList &schedList,
+                bool               oneChanid);
+    // Bulk set methods
+  public:
 
     typedef enum {
         kNoProgram           = 0,
@@ -462,17 +472,6 @@
 
 Q_DECLARE_METATYPE(ProgramInfo*)
 
-class MPUBLIC ProgramDetail
-{
-  public:
-    QString   channame;
-    QString   title;
-    QString   subtitle;
-    QDateTime startTime;
-    QDateTime endTime;
-};
-typedef vector<ProgramDetail> ProgramDetailList;
-
 #endif // MYTHPROGRAM_H_
 
 /* vim: set expandtab tabstop=4 shiftwidth=4: */
Index: libs/libmyth/programlist.h
===================================================================
--- libs/libmyth/programlist.h	(revision 22791)
+++ libs/libmyth/programlist.h	(working copy)
@@ -9,7 +9,7 @@
 // of the list while the linked list erase() is always O(1), but all other
 // operations are faster with the deque.
 
-#define PGLIST_USE_LINKED_LIST
+//#define PGLIST_USE_LINKED_LIST
 
 // C++ headers
 #ifdef PGLIST_USE_LINKED_LIST
@@ -29,13 +29,41 @@
 // MythTV headers
 #include "mythexp.h"
 #include "mythdbcon.h"
-#include "programinfo.h" // for ProgramDetailList
 
+class ProgramList;
+MPUBLIC bool LoadFromProgram(
+    ProgramList        &destination,
+    const QString      &sql,
+    const MSqlBindings &bindings,
+    const ProgramList  &schedList,
+    bool                oneChanid);
+
+
+MPUBLIC bool LoadFromOldRecorded(
+    ProgramList        &destination,
+    const QString      &sql,
+    const MSqlBindings &bindings);
+
+MPUBLIC bool LoadFromRecorded(
+    ProgramList        &destination,
+    bool                orderDescending, 
+    bool                possiblyInProgressRecordingsOnly,
+    const ProgramList  &schedList);
+
+MPUBLIC bool LoadFromScheduler(
+    ProgramList        &destination,
+    bool               &hasConflicts,
+    QString             altTable = "",
+    int                 recordid = -1);
+
+MPUBLIC bool LoadFromScheduler(ProgramList &destination);
+
 /** \class ProgramList
  *  \brief List of ProgramInfo instances, with helper functions.
  */
 class MPUBLIC ProgramList
 {
+    friend class RecordingList;
   public:
     ProgramList(bool auto_delete = true) : autodelete(auto_delete) {}
     ~ProgramList();
@@ -45,36 +73,7 @@
 
     ProgramInfo *operator[](uint index);
     const ProgramInfo *operator[](uint index) const;
-    bool operator==(const ProgramList &b) const;
 
-    bool FromScheduler(bool    &hasConflicts,
-                       QString  altTable = "",
-                       int      recordid = -1);
-
-    bool FromScheduler(void)
-    {
-        bool dummyConflicts;
-        return FromScheduler(dummyConflicts, "", -1);
-    };
-
-    bool FromProgram(const QString &sql, MSqlBindings &bindings,
-                     ProgramList &schedList, bool oneChanid = false);
-
-    bool FromProgram(const QString &sql, MSqlBindings &bindings)
-    {
-        ProgramList dummySched;
-        return FromProgram(sql, bindings, dummySched);
-    }
-
-    bool FromRecorded( bool bDescending, ProgramList *pSchedList);
-
-    bool FromOldRecorded(const QString &sql, MSqlBindings &bindings);
-
-    static bool GetProgramDetailList(
-        QDateTime         &nextRecordingStart,
-        bool              *hasConflicts = NULL,
-        ProgramDetailList *list = NULL);
-
     ProgramInfo *take(uint i);
     iterator erase(iterator it);
     void clear(void);
@@ -91,11 +90,6 @@
     void push_back(ProgramInfo *pginfo) { pglist.push_back(pginfo); }
 
     // compatibility with old Q3PtrList
-    bool isEmpty(void) const { return empty(); }
-    size_t count(void) const { return size(); }
-    ProgramInfo *at(uint index) { return (*this)[index]; }
-    void prepend(ProgramInfo *pginfo) { push_front(pginfo); }
-    void append(ProgramInfo *pginfo) { push_back(pginfo); }
     void setAutoDelete(bool auto_delete) { autodelete = auto_delete; }
 
   protected:
Index: libs/libmyth/programinfo.cpp
===================================================================
--- libs/libmyth/programinfo.cpp	(revision 22791)
+++ libs/libmyth/programinfo.cpp	(working copy)
@@ -224,6 +224,96 @@
 {
 }
 
+ProgramInfo::ProgramInfo(
+    const MSqlQuery &query, const ProgramList &schedList, bool oneChanid)
+{
+    if (!query.isValid())
+    {
+        ProgramInfo blank;
+        *this = blank;
+    }
+
+    chanid = query.value(0).toString();
+    startts = QDateTime::fromString(query.value(1).toString(),
+                                    Qt::ISODate);
+    endts = QDateTime::fromString(query.value(2).toString(),
+                                  Qt::ISODate);
+    recstartts = startts;
+    recendts = endts;
+    lastmodified = startts;
+    title = query.value(3).toString();
+    subtitle = query.value(4).toString();
+    description = query.value(5).toString();
+    category = query.value(6).toString();
+    chanstr = query.value(7).toString();
+    chansign = query.value(8).toString();
+    channame = query.value(9).toString();
+    repeat = query.value(10).toInt();
+    chancommfree = COMM_DETECT_COMMFREE == query.value(11).toInt();
+    chanOutputFilters = query.value(12).toString();
+    seriesid = query.value(13).toString();
+    programid = query.value(14).toString();
+    year = query.value(15).toString();
+    stars = query.value(16).toString().toFloat();
+
+    if (query.value(17).isNull() || query.value(17).toString().isEmpty())
+    {
+        originalAirDate = QDate (0, 1, 1);
+        hasAirDate = false;
+    }
+    else
+    {
+        originalAirDate =
+            QDate::fromString(query.value(17).toString(),Qt::ISODate);
+
+        if (originalAirDate > QDate(1940, 1, 1))
+            hasAirDate = true;
+        else
+            hasAirDate = false;
+    }
+    catType = query.value(18).toString();
+    recordid = query.value(19).toInt();
+    rectype = RecordingType(query.value(20).toInt());
+    recstatus = RecStatusType(query.value(21).toInt());
+    findid = query.value(22).toInt();
+
+
+    ProgramList::const_iterator it = schedList.begin();
+    for (; it != schedList.end(); ++it)
+    {
+        if (!IsSameTimeslot(**it))
+            continue;
+
+        const ProgramInfo &s = **it;
+        recordid    = s.recordid;
+        recstatus   = s.recstatus;
+        rectype     = s.rectype;
+        recpriority = s.recpriority;
+        recstartts  = s.recstartts;
+        recendts    = s.recendts;
+        cardid      = s.cardid;
+        inputid     = s.inputid;
+        dupin       = s.dupin;
+        dupmethod   = s.dupmethod;
+        findid      = s.findid;
+
+        if (s.recstatus == rsWillRecord || s.recstatus == rsRecording)
+        {
+            if (oneChanid)
+            {
+                chanid   = s.chanid;
+                chanstr  = s.chanstr;
+                chansign = s.chansign;
+                channame = s.channame;
+            }
+            else if ((chanid != s.chanid) && (chanstr != s.chanstr))
+            {
+                recstatus = rsOtherShowing;
+            }
+        }
+    }
+}
+
 /** \fn ProgramInfo::operator=(const ProgramInfo &other)
  *  \brief Copies important fields from other ProgramInfo.
  */
@@ -936,10 +1026,10 @@
     bindings[":STARTTS1"] = str_startts;
     bindings[":STARTTS2"] = str_startts;
 
-    schedList.FromScheduler();
-    progList.FromProgram(querystr, bindings, schedList);
+    LoadFromScheduler(schedList);
+    LoadFromProgram(progList, querystr, bindings, schedList, false);
 
-    if (!progList.isEmpty())
+    if (!progList.empty())
     {
         ProgramInfo *pginfo = progList[0];
 
@@ -1016,9 +1106,9 @@
     bindings[":CHANID"]  = QString::number(_chanid);
     bindings[":STARTTS"] = dtime.toString("yyyy-MM-ddThh:mm:50");
 
-    progList.FromProgram(querystr, bindings, schedList);
+    LoadFromProgram(progList, querystr, bindings, schedList, false);
 
-    if (!progList.isEmpty())
+    if (!progList.empty())
         nextstart = (*progList.begin())->startts;
 
     if (nextstart > startts && nextstart < recendts)
Index: libs/libmyth/programlist.cpp
===================================================================
--- libs/libmyth/programlist.cpp	(revision 22791)
+++ libs/libmyth/programlist.cpp	(working copy)
@@ -5,6 +5,7 @@
 #include "mythdb.h"
 #include "util.h"
 #include "programlist.h"
+#include "programinfo.h"
 
 ProgramList::~ProgramList(void)
 {
@@ -35,22 +36,6 @@
     return (*(const_cast<ProgramList*>(this)))[index];
 }
 
-bool ProgramList::operator==(const ProgramList &b) const
-{
-    const_iterator it_a  = pglist.begin();
-    const_iterator it_b  = b.pglist.begin();
-    const_iterator end_a = pglist.end();
-    const_iterator end_b = b.pglist.end();
-
-    for (; it_a != end_a && it_b != end_b; ++it_a, ++it_b)
-    {
-        if (*it_a != *it_b)
-            return false;
-    }
-
-    return (it_a == end_a) && (it_b == end_b);
-}
-
 ProgramInfo *ProgramList::take(uint index)
 {
 #ifndef PGLIST_USE_LINKED_LIST
@@ -110,63 +95,11 @@
 #endif
 }
 
-bool ProgramList::FromScheduler(bool &hasConflicts, QString tmptable,
-                                int recordid)
-{
-    clear();
-    hasConflicts = false;
+//////////////////////////////////////////////////////////////////////
 
-    if (gContext->IsBackend())
-        return false;
-
-    QString query;
-    if (tmptable != "")
-    {
-        query = QString("QUERY_GETALLPENDING %1 %2")
-                        .arg(tmptable).arg(recordid);
-    } else {
-        query = QString("QUERY_GETALLPENDING");
-    }
-
-    QStringList slist( query );
-    if (!gContext->SendReceiveStringList(slist) || slist.size() < 2)
-    {
-        VERBOSE(VB_IMPORTANT,
-                "ProgramList::FromScheduler(): Error querying master.");
-        return false;
-    }
-
-    hasConflicts = slist[0].toInt();
-
-    bool result = true;
-    QStringList::const_iterator sit = slist.begin()+2;
-
-    while (result && sit != slist.end())
-    {
-        ProgramInfo *p = new ProgramInfo();
-        result = p->FromStringList(sit, slist.end());
-        if (result)
-            pglist.push_back(p);
-        else
-            delete p;
-    }
-
-    if (pglist.size() != slist[1].toUInt())
-    {
-        VERBOSE(VB_IMPORTANT,
-                "ProgramList::FromScheduler(): Length mismatch");
-        clear();
-        result = false;
-    }
-
-    return result;
-}
-
-bool ProgramList::FromProgram(const QString &sql, MSqlBindings &bindings,
-                              ProgramList &schedList, bool oneChanid)
+static bool FromProgramQuery(
+    const QString &sql, const MSqlBindings &bindings, MSqlQuery &query)
 {
-    clear();
-
     QString querystr = QString(
         "SELECT DISTINCT program.chanid, program.starttime, program.endtime, "
         "    program.title, program.subtitle, program.description, "
@@ -200,16 +133,68 @@
     if (!sql.contains(" LIMIT "))
         querystr += " LIMIT 20000 ";
 
+    query.prepare(querystr);
+    MSqlBindings::const_iterator it;
+    for (it = bindings.begin(); it != bindings.end(); ++it)
+    {
+        if (querystr.contains(it.key()))
+            query.bindValue(it.key(), it.value());
+    }
+
+    if (!query.exec())
+    {
+        MythDB::DBError("LoadFromProgramQuery", query);
+        return false;
+    }
+
+    return true;
+}
+
+bool LoadFromProgram(
+    ProgramList &destination,
+    const QString &sql, const MSqlBindings &bindings,
+    const ProgramList &schedList, bool oneChanid)
+{
+    destination.clear();
+
     MSqlQuery query(MSqlQuery::InitCon());
+    if (!FromProgramQuery(sql, bindings, query))
+        return false;
+
+    while (query.next())
+        destination.push_back(new ProgramInfo(query, schedList, oneChanid));
+
+    return true;
+}
+
+bool LoadFromOldRecorded(
+    ProgramList &destination, const QString &sql, const MSqlBindings &bindings)
+{
+    destination.clear();
+
+    MSqlQuery query(MSqlQuery::InitCon());
+    
+    QString querystr =
+        "SELECT oldrecorded.chanid, starttime, endtime, "
+        "       title, subtitle, description, category, seriesid, "
+        "       programid, channel.channum, channel.callsign, "
+        "       channel.name, findid, rectype, recstatus, recordid, "
+        "       duplicate "
+        " FROM oldrecorded "
+        " LEFT JOIN channel ON oldrecorded.chanid = channel.chanid "
+        + sql;
+
     query.prepare(querystr);
     MSqlBindings::const_iterator it;
     for (it = bindings.begin(); it != bindings.end(); ++it)
+    {
         if (querystr.contains(it.key()))
             query.bindValue(it.key(), it.value());
+    }
 
     if (!query.exec())
     {
-        MythDB::DBError("ProgramList::FromProgram", query);
+        MythDB::DBError("LoadFromOldRecorded", query);
         return false;
     }
 
@@ -228,84 +213,30 @@
         p->subtitle = query.value(4).toString();
         p->description = query.value(5).toString();
         p->category = query.value(6).toString();
-        p->chanstr = query.value(7).toString();
-        p->chansign = query.value(8).toString();
-        p->channame = query.value(9).toString();
-        p->repeat = query.value(10).toInt();
-        p->chancommfree = COMM_DETECT_COMMFREE == query.value(11).toInt();
-        p->chanOutputFilters = query.value(12).toString();
-        p->seriesid = query.value(13).toString();
-        p->programid = query.value(14).toString();
-        p->year = query.value(15).toString();
-        p->stars = query.value(16).toString().toFloat();
+        p->seriesid = query.value(7).toString();
+        p->programid = query.value(8).toString();
+        p->chanstr = query.value(9).toString();
+        p->chansign = query.value(10).toString();
+        p->channame = query.value(11).toString();
+        p->findid = query.value(12).toInt();
+        p->rectype = RecordingType(query.value(13).toInt());
+        p->recstatus = RecStatusType(query.value(14).toInt());
+        p->recordid = query.value(15).toInt();
+        p->duplicate = query.value(16).toInt();
 
-        if (query.value(17).isNull() || query.value(17).toString().isEmpty())
-        {
-            p->originalAirDate = QDate (0, 1, 1);
-            p->hasAirDate = false;
-        }
-        else
-        {
-            p->originalAirDate =
-                QDate::fromString(query.value(17).toString(),Qt::ISODate);
-
-            if (p->originalAirDate > QDate(1940, 1, 1))
-                p->hasAirDate = true;
-            else
-                p->hasAirDate = false;
-        }
-        p->catType = query.value(18).toString();
-        p->recordid = query.value(19).toInt();
-        p->rectype = RecordingType(query.value(20).toInt());
-        p->recstatus = RecStatusType(query.value(21).toInt());
-        p->findid = query.value(22).toInt();
-
-        iterator it = schedList.pglist.begin();
-        for (; it != schedList.pglist.end(); ++it)
-        {
-            ProgramInfo *s = *it;
-            if (p->IsSameTimeslot(*s))
-            {
-                p->recordid = s->recordid;
-                p->recstatus = s->recstatus;
-                p->rectype = s->rectype;
-                p->recpriority = s->recpriority;
-                p->recstartts = s->recstartts;
-                p->recendts = s->recendts;
-                p->cardid = s->cardid;
-                p->inputid = s->inputid;
-                p->dupin = s->dupin;
-                p->dupmethod = s->dupmethod;
-                p->findid = s->findid;
-
-                if (s->recstatus == rsWillRecord ||
-                    s->recstatus == rsRecording)
-                {
-                    if (oneChanid)
-                    {
-                        p->chanid   = s->chanid;
-                        p->chanstr  = s->chanstr;
-                        p->chansign = s->chansign;
-                        p->channame = s->channame;
-                    }
-                    else if ((p->chanid != s->chanid) &&
-                             (p->chanstr != s->chanstr))
-                    {
-                        p->recstatus = rsOtherShowing;
-                    }
-                }
-            }
-        }
-
-        pglist.push_back(p);
+        destination.push_back(p);
     }
 
     return true;
 }
 
-bool ProgramList::FromRecorded( bool bDescending, ProgramList *pSchedList )
+bool LoadFromRecorded(
+    ProgramList &destination,
+    bool orderDescending,
+    bool possiblyInProgressTecordingsOnly,
+    const ProgramList &schedList)
 {
-    clear();
+    destination.clear();
 
     QString     fs_db_name = "";
     QDateTime   rectime    = QDateTime::currentDateTime().addSecs(
@@ -317,13 +248,12 @@
     // ----------------------------------------------------------------------
 
     QMap<QString, int> inUseMap;
+    QString   inUseKey;
+    QString   inUseForWhat;
+    QDateTime oneHourAgo = QDateTime::currentDateTime().addSecs(-61 * 60);
 
-    QString     inUseKey;
-    QString     inUseForWhat;
-    QDateTime   oneHourAgo = QDateTime::currentDateTime().addSecs(-61 * 60);
+    MSqlQuery query(MSqlQuery::InitCon());
 
-    MSqlQuery   query(MSqlQuery::InitCon());
-
     query.prepare("SELECT DISTINCT chanid, starttime, recusage "
                   " FROM inuseprograms WHERE lastupdatetime >= :ONEHOURAGO ;");
     query.bindValue(":ONEHOURAGO", oneHourAgo);
@@ -341,7 +271,8 @@
 
             if ((inUseForWhat == "player") ||
                 (inUseForWhat == "preview player") ||
-                (inUseForWhat == "PIP player"))
+                (inUseForWhat == "pipplayer") ||
+                (inUseForWhat == "pbpplayer"))
                 inUseMap[inUseKey] = inUseMap[inUseKey] | FL_INUSEPLAYING;
             else if (inUseForWhat == "recorder")
                 inUseMap[inUseKey] = inUseMap[inUseKey] | FL_INUSERECORDING;
@@ -380,7 +311,7 @@
         "recorded.hostname,channum,name,callsign,commflagged,cutlist,"
         "recorded.autoexpire,editing,bookmark,recorded.category,"
         "recorded.recgroup,record.dupin,record.dupmethod,"
-        "record.recordid,outputfilters,"
+        "recorded.recordid,channel.outputfilters,"
         "recorded.seriesid,recorded.programid,recorded.filesize, "
         "recorded.lastmodified, recorded.findid, "
         "recorded.originalairdate, recorded.playgroup, "
@@ -388,7 +319,9 @@
         "recorded.progend, recorded.stars, "
         "recordedprogram.audioprop+0, recordedprogram.videoprop+0, "
         "recordedprogram.subtitletypes+0, recorded.watched, "
-        "recorded.storagegroup "
+        "recorded.storagegroup, "
+        "recorded.transcoded, recorded.recpriority, "
+        "recorded.preserve, recordedprogram.airdate "
         "FROM recorded "
         "LEFT JOIN record ON recorded.recordid = record.recordid "
         "LEFT JOIN channel ON recorded.chanid = channel.chanid "
@@ -396,13 +329,19 @@
         " ( recorded.chanid    = recordedprogram.chanid AND "
         "   recorded.progstart = recordedprogram.starttime ) "
         "WHERE ( recorded.deletepending = 0 OR "
-        "        recorded.lastmodified <= DATE_SUB(NOW(), INTERVAL 5 MINUTE) "
-        "      ) "
-        "ORDER BY recorded.starttime";
+        "        DATE_ADD(recorded.lastmodified, INTERVAL 5 MINUTE) <= NOW() "
+        "      ) ";
 
-    if ( bDescending )
-        thequery += " DESC";
+    if (possiblyInProgressTecordingsOnly)
+    {
+        thequery +=
+            " AND recorded.endtime   >= NOW() "
+            " AND recorded.starttime <= NOW() ";
+    }
 
+    thequery += "ORDER BY recorded.starttime";
+    thequery += (orderDescending) ? " DESC " : "";
+
     QString chanorder = gContext->GetSetting("ChannelOrdering", "channum");
     if (chanorder != "channum")
         thequery += ", " + chanorder;
@@ -449,19 +388,15 @@
         }
         else
         {
-            proginfo->originalAirDate =
-                QDate::fromString(query.value(26).toString(),Qt::ISODate);
-
-            if (proginfo->originalAirDate > QDate(1940, 1, 1))
-                proginfo->hasAirDate  = true;
-            else
-                proginfo->hasAirDate  = false;
+            QDate oad = QDate::fromString(
+                query.value(26).toString(), Qt::ISODate);
+            proginfo->originalAirDate = oad;
+            proginfo->hasAirDate = oad.isValid() && (oad > QDate(1940, 1, 1));
         }
 
         proginfo->pathname = query.value(28).toString();
 
-
-        if (proginfo->hostname.isEmpty() || proginfo->hostname.isNull())
+        if (proginfo->hostname.isEmpty())
             proginfo->hostname = gContext->GetHostName();
 
         if (!query.value(7).toString().isEmpty())
@@ -484,6 +419,9 @@
         flags |=  query.value(12).toInt()                 ? FL_AUTOEXP  : 0;
         flags |= (query.value(14).toInt() == 1)           ? FL_BOOKMARK : 0;
         flags |= (query.value(35).toInt() == 1)           ? FL_WATCHED  : 0;
+        flags |= (query.value(37).toInt() == TRANSCODING_COMPLETE) ?
+            FL_TRANSCODED : 0;
+        flags |= (query.value(39).toInt() == 1)           ? FL_PRESERVED: 0;
 
         inUseKey = query.value(0).toString() + " " +
             query.value(1).toDateTime().toString(Qt::ISODate);
@@ -520,16 +458,18 @@
         proginfo->playgroup    = query.value(27).toString();
         proginfo->storagegroup = query.value(36).toString();
         proginfo->recstatus    = rsRecorded;
+        proginfo->recpriority  = query.value(38).toInt();
+        proginfo->year         = query.value(40).toString();
 
-        if ((pSchedList != NULL) && (proginfo->recendts > rectime))
+        if (proginfo->recendts > rectime)
         {
-            iterator it = pSchedList->pglist.begin();
-            for (; it != pSchedList->pglist.end(); ++it)
+            ProgramList::const_iterator it = schedList.begin();
+            for (; it != schedList.end(); ++it)
             {
-                ProgramInfo *s = *it;
-                if (s && s->recstatus    == rsRecording &&
-                    proginfo->chanid     == s->chanid   &&
-                    proginfo->recstartts == s->recstartts)
+                const ProgramInfo &s = **it;
+                if (s.recstatus          == rsRecording &&
+                    proginfo->chanid     == s.chanid    &&
+                    proginfo->recstartts == s.recstartts)
                 {
                     proginfo->recstatus = rsRecording;
                     break;
@@ -539,108 +479,69 @@
 
         proginfo->stars = query.value(31).toDouble();
 
-        pglist.push_back(proginfo);
+        destination.push_back(proginfo);
     }
 
     return true;
 }
 
-
-bool ProgramList::FromOldRecorded(const QString &sql, MSqlBindings &bindings)
+bool LoadFromScheduler(
+    ProgramList &destination, bool &hasConflicts,
+    QString tmptable, int recordid)
 {
-    clear();
-    MSqlQuery query(MSqlQuery::InitCon());
+    destination.clear();
+    hasConflicts = false;
 
-    query.prepare("SELECT oldrecorded.chanid, starttime, endtime, "
-                  " title, subtitle, description, category, seriesid, "
-                  " programid, channel.channum, channel.callsign, "
-                  " channel.name, findid, rectype, recstatus, recordid, "
-                  " duplicate "
-                  " FROM oldrecorded "
-                  " LEFT JOIN channel ON oldrecorded.chanid = channel.chanid "
-                  + sql);
-    query.bindValues(bindings);
+    if (gContext->IsBackend())
+        return false;
 
-    if (!query.exec() || !query.isActive())
+    QString query;
+    if (!tmptable.isEmpty())
     {
-        MythDB::DBError("ProgramList::FromOldRecorded", query);
-        return false;
+        query = QString("QUERY_GETALLPENDING %1 %2")
+            .arg(tmptable).arg(recordid);
     }
-
-    while (query.next())
+    else
     {
-        ProgramInfo *p = new ProgramInfo;
-        p->chanid = query.value(0).toString();
-        p->startts = QDateTime::fromString(query.value(1).toString(),
-                                           Qt::ISODate);
-        p->endts = QDateTime::fromString(query.value(2).toString(),
-                                         Qt::ISODate);
-        p->recstartts = p->startts;
-        p->recendts = p->endts;
-        p->lastmodified = p->startts;
-        p->title = query.value(3).toString();
-        p->subtitle = query.value(4).toString();
-        p->description = query.value(5).toString();
-        p->category = query.value(6).toString();
-        p->seriesid = query.value(7).toString();
-        p->programid = query.value(8).toString();
-        p->chanstr = query.value(9).toString();
-        p->chansign = query.value(10).toString();
-        p->channame = query.value(11).toString();
-        p->findid = query.value(12).toInt();
-        p->rectype = RecordingType(query.value(13).toInt());
-        p->recstatus = RecStatusType(query.value(14).toInt());
-        p->recordid = query.value(15).toInt();
-        p->duplicate = query.value(16).toInt();
+        query = QString("QUERY_GETALLPENDING");
+    }
 
-        pglist.push_back(p);
+    QStringList slist( query );
+    if (!gContext->SendReceiveStringList(slist) || slist.size() < 2)
+    {
+        VERBOSE(VB_IMPORTANT,
+                "LoadFromScheduler(): Error querying master.");
+        return false;
     }
 
-    return true;
-}
+    hasConflicts = slist[0].toInt();
 
-bool ProgramList::GetProgramDetailList(
-    QDateTime &nextRecordingStart, bool *hasConflicts, ProgramDetailList *list)
-{
-    nextRecordingStart = QDateTime();
+    bool result = true;
+    QStringList::const_iterator sit = slist.begin()+2;
 
-    bool dummy;
-    bool *conflicts = (hasConflicts) ? hasConflicts : &dummy;
-
-    ProgramList progList;
-    if (!progList.FromScheduler(*conflicts))
-        return false;
-
-    // find the earliest scheduled recording
-    ProgramList::const_iterator it = progList.begin();
-    for (; it != progList.end(); ++it)
+    while (result && sit != slist.end())
     {
-        if (((*it)->recstatus == rsWillRecord) &&
-            (nextRecordingStart.isNull() ||
-             nextRecordingStart > (*it)->recstartts))
-        {
-            nextRecordingStart = (*it)->recstartts;
-        }
+        ProgramInfo *p = new ProgramInfo();
+        result = p->FromStringList(sit, slist.end());
+        if (result)
+            destination.push_back(p);
+        else
+            delete p;
     }
 
-    if (!list)
-        return true;
-
-    // save the details of the earliest recording(s)
-    for (it = progList.begin(); it != progList.end(); ++it)
+    if (destination.size() != slist[1].toUInt())
     {
-        if (((*it)->recstatus  == rsWillRecord) &&
-            ((*it)->recstartts == nextRecordingStart))
-        {
-            ProgramDetail prog;
-            prog.channame  = (*it)->channame;
-            prog.title     = (*it)->title;
-            prog.subtitle  = (*it)->subtitle;
-            prog.startTime = (*it)->recstartts;
-            prog.endTime   = (*it)->recendts;
-            list->push_back(prog);
-        }
+        VERBOSE(VB_IMPORTANT,
+                "LoadFromScheduler(): Length mismatch.");
+        destination.clear();
+        result = false;
     }
 
-    return true;
+    return result;
 }
+
+bool LoadFromScheduler(ProgramList &destination)
+{
+    bool dummyConflicts;
+    return LoadFromScheduler(destination, dummyConflicts, "", -1);
+}
Index: programs/mythfrontend/playbackbox.cpp
===================================================================
--- programs/mythfrontend/playbackbox.cpp	(revision 22791)
+++ programs/mythfrontend/playbackbox.cpp	(working copy)
@@ -1110,7 +1110,7 @@
 
     if (m_noRecordingsText)
     {
-        if (!progList.isEmpty())
+        if (!progList.empty())
             m_noRecordingsText->SetVisible(false);
         else
         {
@@ -1257,7 +1257,7 @@
 
                 if (m_viewMask != VIEW_NONE &&
                     (p->recgroup != "LiveTV" || m_recGroup == "LiveTV"))
-                    m_progLists[""].prepend(p);
+                    m_progLists[""].push_front(p);
 
                 asKey = p->MakeUniqueKey();
                 if (asCache.contains(asKey))
@@ -1271,7 +1271,7 @@
                 {
                     QString tmpTitle = tr("LiveTV");
                     sortedList[tmpTitle.toLower()] = tmpTitle;
-                    m_progLists[tmpTitle.toLower()].prepend(p);
+                    m_progLists[tmpTitle.toLower()].push_front(p);
                     m_progLists[tmpTitle.toLower()].setAutoDelete(false);
                     continue;
                 }
@@ -1285,7 +1285,7 @@
 
                     if (!sortedList.contains(sTitle))
                         sortedList[sTitle] = p->title;
-                    m_progLists[sortedList[sTitle].toLower()].prepend(p);
+                    m_progLists[sortedList[sTitle].toLower()].push_front(p);
                     m_progLists[sortedList[sTitle].toLower()].setAutoDelete(false);
                 }
 
@@ -1293,7 +1293,7 @@
                     !p->recgroup.isEmpty()) // Show recording groups
                 {
                     sortedList[p->recgroup.toLower()] = p->recgroup;
-                    m_progLists[p->recgroup.toLower()].prepend(p);
+                    m_progLists[p->recgroup.toLower()].push_front(p);
                     m_progLists[p->recgroup.toLower()].setAutoDelete(false);
                 }
 
@@ -1301,7 +1301,7 @@
                     !p->category.isEmpty()) // Show categories
                 {
                     sortedList[p->category.toLower()] = p->category;
-                    m_progLists[p->category.toLower()].prepend(p);
+                    m_progLists[p->category.toLower()].push_front(p);
                     m_progLists[p->category.toLower()].setAutoDelete(false);
                 }
 
@@ -1312,7 +1312,7 @@
                     QString tmpTitle = QString("(%1)")
                                                .arg(searchRule[p->recordid]);
                     sortedList[tmpTitle.toLower()] = tmpTitle;
-                    m_progLists[tmpTitle.toLower()].prepend(p);
+                    m_progLists[tmpTitle.toLower()].push_front(p);
                     m_progLists[tmpTitle.toLower()].setAutoDelete(false);
                 }
 
@@ -1337,7 +1337,7 @@
                         if (recidEpisodes[p->recordid] == 1 ||
                             p->recordid == 0 )
                         {
-                            m_progLists[m_watchGroupLabel].prepend(p);
+                            m_progLists[m_watchGroupLabel].push_front(p);
                             m_progLists[m_watchGroupLabel].setAutoDelete(false);
                         }
                         else
@@ -4072,9 +4072,9 @@
     }
 
     // Create and add the "All Programs" entry
-    displayNames.prepend(tr("%1 [%n item(s)]", 0, totalItems)
-                         .arg(ProgramInfo::i18n("All Programs")));
-    groupNames.prepend("All Programs");
+    displayNames.push_front(tr("%1 [%n item(s)]", 0, totalItems)
+                            .arg(ProgramInfo::i18n("All Programs")));
+    groupNames.push_front("All Programs");
     m_recGroupType["All Programs"] = "recgroup";
 
     // Find each category, and the number of recordings in each
Index: programs/mythfrontend/guidegrid.cpp
===================================================================
--- programs/mythfrontend/guidegrid.cpp	(revision 22791)
+++ programs/mythfrontend/guidegrid.cpp	(working copy)
@@ -281,7 +281,7 @@
 
 void GuideGrid::Load(void)
 {
-    m_recList.FromScheduler();
+    LoadFromScheduler(m_recList);
     fillChannelInfos();
 
     int maxchannel = max((int)GetChannelCount() - 1, 0);
@@ -642,7 +642,7 @@
     bindings[":CHANID"]  = chanid;
 
     ProgramList dummy;
-    proglist.FromProgram(querystr, bindings, dummy);
+    LoadFromProgram(proglist, querystr, bindings, dummy, false);
 
     return proglist;
 }
@@ -1009,7 +1009,7 @@
         bindings[":STARTTS"] = m_currentStartTime.toString("yyyy-MM-ddThh:mm:00");
         bindings[":ENDTS"] = m_currentEndTime.toString("yyyy-MM-ddThh:mm:00");
 
-        proglist->FromProgram(querystr, bindings, m_recList);
+        LoadFromProgram(*proglist, querystr, bindings, m_recList, false);
     }
 
     return proglist;
@@ -1120,7 +1120,7 @@
 
     vector<ProgramInfo*>::iterator it = unknownlist.begin();
     for (; it != unknownlist.end(); ++it)
-        proglist->append(*it);
+        proglist->push_back(*it);
 
     MythRect programRect = m_guideGrid->GetArea();
 
@@ -1264,7 +1264,7 @@
 
         if (message == "SCHEDULE_CHANGE")
         {
-            m_recList.FromScheduler();
+            LoadFromScheduler(m_recList);
             fillProgramInfos();
             updateInfo();
         }
@@ -1570,7 +1570,7 @@
     maxchannel = max((int)GetChannelCount() - 1, 0);
     m_channelCount = min(m_guideGrid->getChannelCount(), maxchannel + 1);
 
-    m_recList.FromScheduler();
+    LoadFromScheduler(m_recList);
     fillProgramInfos();
 }
 
@@ -1956,7 +1956,7 @@
     ri.ToggleRecord();
     *pginfo = ri;
 
-    m_recList.FromScheduler();
+    LoadFromScheduler(m_recList);
     fillProgramInfos();
     updateInfo();
 }
Index: programs/mythfrontend/progfind.h
===================================================================
--- programs/mythfrontend/progfind.h	(revision 22791)
+++ programs/mythfrontend/progfind.h	(working copy)
@@ -1,14 +1,15 @@
 #ifndef PROGFIND_H_
 #define PROGFIND_H_
 
-// qt
+// Qt
 #include <QDateTime>
 #include <QEvent>
 
-// myth
+// MythTV
 #include "mythscreentype.h"
 #include "programlist.h"
 #include "mythdialogbox.h"
+#include "playercontext.h"
 
 // mythfrontend
 #include "schedulecommon.h"
Index: programs/mythfrontend/viewscheduled.cpp
===================================================================
--- programs/mythfrontend/viewscheduled.cpp	(revision 22791)
+++ programs/mythfrontend/viewscheduled.cpp	(working copy)
@@ -115,12 +115,12 @@
     return true;
 }
 
-void ViewScheduled::Load()
+void ViewScheduled::Load(void)
 {
-    m_recList.FromScheduler(m_conflictBool);
+    LoadFromScheduler(m_recList, m_conflictBool);
 }
 
-void ViewScheduled::Init()
+void ViewScheduled::Init(void)
 {
     LoadList(true);
 }
@@ -266,7 +266,7 @@
     m_recgroupList.clear();
 
     if (!useExistingData)
-        m_recList.FromScheduler(m_conflictBool);
+        LoadFromScheduler(m_recList, m_conflictBool);
 
     ProgramList::iterator pit = m_recList.begin();
     QString currentDate;
@@ -294,10 +294,10 @@
                 m_maxinput = pginfo->inputid;
 
             QDate date = (pginfo->recstartts).date();
-            m_recgroupList[date].append(pginfo);
+            m_recgroupList[date].push_back(pginfo);
             m_recgroupList[date].setAutoDelete(false);
 
-            m_recgroupList[m_defaultGroup].append(pginfo);
+            m_recgroupList[m_defaultGroup].push_back(pginfo);
 
             ++pit;
         }
@@ -339,7 +339,7 @@
 
         plist = m_recgroupList[m_currentGroup];
 
-        int listPos = plist.count() - 1;
+        int listPos = ((int) plist.size()) - 1;
         int i;
         for (i = listPos; i >= 0; --i)
         {
@@ -363,7 +363,7 @@
 
 void ViewScheduled::ChangeGroup(MythUIButtonListItem* item)
 {
-    if (!item || m_recList.isEmpty())
+    if (!item || m_recList.empty())
         return;
 
     QDate group = qVariantValue<QDate>(item->GetData());
@@ -382,9 +382,9 @@
                                                 (GetChild("norecordings_info"));
 
     if (norecordingText)
-        norecordingText->SetVisible(m_recList.isEmpty());
+        norecordingText->SetVisible(m_recList.empty());
 
-    if (m_recList.isEmpty())
+    if (m_recList.empty())
         return;
 
     ProgramList plist;
Index: programs/mythfrontend/statusbox.cpp
===================================================================
--- programs/mythfrontend/statusbox.cpp	(revision 22791)
+++ programs/mythfrontend/statusbox.cpp	(working copy)
@@ -624,9 +624,9 @@
     }
 
     ProgramList schedList;
-    schedList.FromScheduler();
+    LoadFromScheduler(schedList);
 
-    tmpstr = tr("%n matching showing(s)", "", schedList.count());
+    tmpstr = tr("%n matching showing(s)", "", schedList.size());
     AddLogLine(tmpstr, tmpstr);
 
     ProgramList::const_iterator it = schedList.begin();
Index: programs/mythfrontend/programrecpriority.cpp
===================================================================
--- programs/mythfrontend/programrecpriority.cpp	(revision 22791)
+++ programs/mythfrontend/programrecpriority.cpp	(working copy)
@@ -1257,7 +1257,7 @@
     m_nowMatch.clear();
     m_recMatch.clear();
     ProgramList schedList;
-    schedList.FromScheduler();
+    LoadFromScheduler(schedList);
     QDateTime now = QDateTime::currentDateTime();
 
     ProgramList::const_iterator it = schedList.begin();
Index: programs/mythfrontend/proglist.cpp
===================================================================
--- programs/mythfrontend/proglist.cpp	(revision 22791)
+++ programs/mythfrontend/proglist.cpp	(working copy)
@@ -8,26 +8,20 @@
 #include <algorithm>
 using namespace std;
 
-// qt
+// Qt
 #include <QApplication>
 #include <QRegExp>
 
-// libmyth
+// MythTV
 #include "mythcontext.h"
 #include "remoteutil.h"
-
-// libmythtv
 #include "scheduledrecording.h"
 #include "recordingrule.h"
 #include "channelutil.h"
 #include "recordinginfo.h"
-
-// libmythdb
 #include "mythdb.h"
 #include "mythdbcon.h"
 #include "mythverbose.h"
-
-// libmythui
 #include "mythuitext.h"
 #include "mythuibutton.h"
 #include "mythuibuttonlist.h"
@@ -289,7 +283,7 @@
         menuPopup->AddButton(tr("Upcoming"));
         menuPopup->AddButton(tr("Custom Edit"));
 
-        ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+        ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
         if (m_type != plPreviouslyRecorded)
         {
             if (pi && pi->recordid > 0)
@@ -612,7 +606,7 @@
 
 void ProgLister::quickRecord()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi)
         return;
@@ -624,7 +618,7 @@
 
 void ProgLister::select()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi)
         return;
@@ -637,14 +631,14 @@
 
 void ProgLister::edit()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     EditScheduled(pi);
 }
 
 void ProgLister::customEdit()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     EditCustom(pi);
 }
@@ -659,7 +653,7 @@
 
 void ProgLister::deleteRule()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi || pi->recordid <= 0)
         return;
@@ -690,7 +684,7 @@
 
 void ProgLister::deleteOldEpisode()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi)
         return;
@@ -705,7 +699,7 @@
     if (!ok)
         return;
 
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi)
         return;
@@ -724,7 +718,7 @@
 
 void ProgLister::deleteOldTitle()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi)
         return;
@@ -739,7 +733,7 @@
     if (!ok)
         return;
 
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi)
         return;
@@ -756,7 +750,7 @@
 
 void ProgLister::oldRecordedActions()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi)
         return;
@@ -797,7 +791,7 @@
 
 void ProgLister::upcoming()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     if (!pi || m_type == plTitle)
         return;
@@ -807,7 +801,7 @@
 
 void ProgLister::details()
 {
-    ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+    ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
 
     ShowDetails(pi);
 }
@@ -1407,11 +1401,13 @@
     }
 
     if (m_type == plPreviouslyRecorded)
-        m_itemList.FromOldRecorded(where, bindings);
+    {
+        LoadFromOldRecorded(m_itemList, where, bindings);
+    }
     else
     {
-        m_schedList.FromScheduler();
-        m_itemList.FromProgram(where, bindings, m_schedList, oneChanid);
+        LoadFromScheduler(m_schedList);
+        LoadFromProgram(m_itemList, where, bindings, m_schedList, oneChanid);
     }
 
     ProgramInfo *s;
@@ -1465,13 +1461,13 @@
     {
         vector<ProgramInfo *>::reverse_iterator r = sortedList.rbegin();
         for (; r != sortedList.rend(); r++)
-            m_itemList.append(*r);
+            m_itemList.push_back(*r);
     }
     else
     {
         vector<ProgramInfo *>::iterator i = sortedList.begin();
         for (; i != sortedList.end(); ++i)
-            m_itemList.append(*i);
+            m_itemList.push_back(*i);
     }
 
     if (updateDisp)
@@ -1481,7 +1477,7 @@
 void ProgLister::updateDisplay(bool restorePosition)
 {
     if (m_messageText)
-        m_messageText->SetVisible((m_itemList.count() == 0));
+        m_messageText->SetVisible(m_itemList.empty());
 
     InfoMap infoMap;
     ProgramInfo pginfo;
@@ -1516,7 +1512,7 @@
             comp = new plTitleSort();
 
         int i;
-        for (i = m_itemList.count() - 2; i >= 0; i--)
+        for (i = m_itemList.size() - 2; i >= 0; i--)
         {
             bool dobreak;
             if (m_reverseSort)
@@ -1699,7 +1695,7 @@
         {
             if (resulttext == tr("Allow this episode to re-record"))
             {
-                ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+                ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
                 if (pi)
                 {
                     RecordingInfo ri(*pi);
@@ -1709,7 +1705,7 @@
             }
             else if (resulttext == tr("Never record this episode"))
             {
-                ProgramInfo *pi = m_itemList.at(m_progList->GetCurrentPos());
+                ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
                 if (pi)
                 {
                     RecordingInfo ri(*pi);
Index: programs/mythfrontend/progfind.cpp
===================================================================
--- programs/mythfrontend/progfind.cpp	(revision 22791)
+++ programs/mythfrontend/progfind.cpp	(working copy)
@@ -1,7 +1,4 @@
-
-#include "progfind.h"
-
-// qt
+// Qt
 #include <QDateTime>
 #include <QApplication>
 #include <QStringList>
@@ -9,20 +6,14 @@
 #include <QKeyEvent>
 #include <QEvent>
 
-// libmythdb
+// MythTV
 #include "oldsettings.h"
 #include "mythdb.h"
 #include "mythdbcon.h"
 #include "mythdirs.h"
-
-// libmyth
 #include "mythcontext.h"
-
-// libmythtv
 #include "recordinginfo.h"
 #include "tv.h"
-
-// libmythui
 #include "mythuitext.h"
 #include "mythuitextedit.h"
 #include "mythuibuttonlist.h"
@@ -33,6 +24,7 @@
 #include "guidegrid.h"
 #include "proglist.h"
 #include "customedit.h"
+#include "progfind.h"
 
 #define LOC      QString("ProgFinder: ")
 #define LOC_ERR  QString("ProgFinder, Error: ")
@@ -587,15 +579,14 @@
 
     QDateTime progStart = QDateTime::currentDateTime();
 
-    m_schedList.FromScheduler();
-
     MSqlBindings bindings;
     QString querystr = "WHERE program.title = :TITLE "
                        "  AND program.endtime > :ENDTIME ";
     bindings[":TITLE"] = progTitle;
     bindings[":ENDTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
 
-    m_showData.FromProgram(querystr, bindings, m_schedList);
+    LoadFromScheduler(m_schedList);
+    LoadFromProgram(m_showData, querystr, bindings, m_schedList, false);
 
     updateTimesList();
 
Index: programs/mythbackend/mythxml.cpp
===================================================================
--- programs/mythbackend/mythxml.cpp	(revision 22791)
+++ programs/mythbackend/mythxml.cpp	(working copy)
@@ -571,15 +571,14 @@
     for (RecIter itRecList =  recList.begin();
                  itRecList != recList.end();   itRecList++)
     {
-        schedList.append( *itRecList );
+        schedList.push_back( *itRecList );
     }
 
     // ----------------------------------------------------------------------
 
     ProgramList progList;
+    LoadFromProgram( progList, sSQL, bindings, schedList, false );
 
-    progList.FromProgram( sSQL, bindings, schedList );
-
     // Build Response
 
     QDomDocument doc;
@@ -623,7 +622,7 @@
     list.push_back( NameValue( "NumOfChannels", iChanCount   ));
     list.push_back( NameValue( "Details"      , bDetails     ));
 
-    list.push_back( NameValue( "Count"        , (int)progList.count() ));
+    list.push_back( NameValue( "Count"        , (int)progList.size() ));
     list.push_back( NameValue( "AsOf"         , QDateTime::currentDateTime()
                                                 .toString( Qt::ISODate )));
     list.push_back( NameValue( "Version"      , MYTH_BINARY_VERSION ));
@@ -684,15 +683,14 @@
     for (RecIter itRecList =  recList.begin();
                  itRecList != recList.end();   itRecList++)
     {
-        schedList.append( *itRecList );
+        schedList.push_back( *itRecList );
     }
 
     // ----------------------------------------------------------------------
 
     ProgramList progList;
+    LoadFromProgram( progList, sSQL, bindings, schedList, false );
 
-    progList.FromProgram( sSQL, bindings, schedList );
-
     ProgramList::iterator pgit = progList.begin();
 
     if (pgit == progList.end())
@@ -971,15 +969,14 @@
     for (RecIter itRecList =  recList.begin();
                  itRecList != recList.end();   itRecList++)
     {
-        schedList.append( *itRecList );
+        schedList.push_back( *itRecList );
     }
 
     // ----------------------------------------------------------------------
 
     ProgramList progList;
+    LoadFromRecorded( progList, bDescending, false, schedList );
 
-    progList.FromRecorded( bDescending, &schedList );
-
     // Build Response XML
 
     QDomDocument doc;
@@ -995,7 +992,7 @@
 
     NameValues list;
 
-    list.push_back( NameValue( "Count"    , (int)progList.count()));
+    list.push_back( NameValue( "Count"    , (int)progList.size()));
     list.push_back( NameValue( "AsOf"     , QDateTime::currentDateTime()
                                             .toString( Qt::ISODate )));
     list.push_back( NameValue( "Version"  , MYTH_BINARY_VERSION ));
Index: programs/mythbackend/mainserver.cpp
===================================================================
--- programs/mythbackend/mainserver.cpp	(revision 22791)
+++ programs/mythbackend/mainserver.cpp	(working copy)
@@ -1077,7 +1077,7 @@
             {
                 if (!pinfo.FromStringList(sit, slist.end()))
                     break;
-                slavelist.append(new RecordingInfo(pinfo));
+                slavelist.push_back(new RecordingInfo(pinfo));
             }
             m_sched->SlaveConnected(slavelist);
         }
@@ -1276,312 +1276,108 @@
     MythSocket *pbssock = pbs->getSocket();
     QString playbackhost = pbs->getHostname();
 
-    QString fs_db_name = "";
-
-    QDateTime rectime = QDateTime::currentDateTime().addSecs(
-                            -gContext->GetNumSetting("RecordOverTime"));
-    RecIter ri;
-    RecList schedList;
+    RecList rlSchedList;
     if (m_sched)
-        m_sched->getAllPending(&schedList);
+        m_sched->getAllPending(&rlSchedList);
+    ProgramList schedList;
+    while (!rlSchedList.empty())
+    {
+        schedList.push_front(rlSchedList.front());
+        rlSchedList.pop_front();
+    }
 
-    QString ip = gContext->GetSetting("BackendServerIP");
-    QString port = gContext->GetSetting("BackendServerPort");
+    ProgramList destination;
+    LoadFromRecorded(
+        destination, (type == "Delete"), (type == "Recording"), schedList);
 
-    QMap<QString, int> inUseMap;
-    QString inUseKey;
-    QString inUseForWhat;
-    QDateTime oneHourAgo = QDateTime::currentDateTime().addSecs(-61 * 60);
-
-    MSqlQuery query(MSqlQuery::InitCon());
-
-    query.prepare("SELECT DISTINCT chanid, starttime, recusage "
-                  " FROM inuseprograms WHERE lastupdatetime >= :ONEHOURAGO ;");
-    query.bindValue(":ONEHOURAGO", oneHourAgo);
-
-    if (query.exec() && query.isActive() && query.size() > 0)
-        while (query.next())
-        {
-            inUseKey = query.value(0).toString() + " " +
-                       query.value(1).toDateTime().toString(Qt::ISODate);
-            inUseForWhat = query.value(2).toString();
-
-            if (!inUseMap.contains(inUseKey))
-                inUseMap[inUseKey] = 0;
-
-            if ((inUseForWhat == "player") ||
-                (inUseForWhat == "preview player") ||
-                (inUseForWhat == "pipplayer") ||
-                (inUseForWhat == "pbpplayer"))
-                inUseMap[inUseKey] = inUseMap[inUseKey] | FL_INUSEPLAYING;
-            else if (inUseForWhat == "recorder")
-                inUseMap[inUseKey] = inUseMap[inUseKey] | FL_INUSERECORDING;
-        }
-
-
-    QString thequery =
-        "SELECT recorded.chanid,recorded.starttime,recorded.endtime,"
-        "recorded.title,recorded.subtitle,recorded.description,"
-        "recorded.hostname,channum,name,callsign,commflagged,cutlist,"
-        "recorded.autoexpire,editing,bookmark,recorded.category,"
-        "recorded.recgroup,record.dupin,record.dupmethod,"
-        "recorded.recordid,channel.outputfilters,"
-        "recorded.seriesid,recorded.programid,recorded.filesize, "
-        "recorded.lastmodified, recorded.findid, "
-        "recorded.originalairdate, recorded.playgroup, "
-        "recorded.basename, recorded.progstart, "
-        "recorded.progend, recorded.stars, "
-        "recordedprogram.audioprop+0, recordedprogram.videoprop+0, "
-        "recordedprogram.subtitletypes+0, transcoded, "
-        "recorded.recpriority, watched, recorded.preserve, "
-        "recorded.storagegroup, recordedprogram.airdate "
-        "FROM recorded "
-        "LEFT JOIN record ON recorded.recordid = record.recordid "
-        "LEFT JOIN channel ON recorded.chanid = channel.chanid "
-        "LEFT JOIN recordedprogram ON "
-        " ( recorded.chanid = recordedprogram.chanid AND "
-        "  recorded.progstart = recordedprogram.starttime ) "
-        "WHERE ( recorded.deletepending = 0 OR "
-        "        DATE_ADD(recorded.lastmodified, INTERVAL 5 MINUTE) <= NOW() "
-        "      ) ";
-
-    if (type == "Recording")
-        thequery += "AND recorded.endtime >= NOW() AND "
-            "recorded.starttime <= NOW()";
-
-    thequery += "ORDER BY recorded.starttime";
-
-    if (type == "Delete")
-        thequery += " DESC";
-
-    QString chanorder = gContext->GetSetting("ChannelOrdering", "channum");
-    if (chanorder != "channum")
-        thequery += ", " + chanorder;
-    else // approximation which the DB can handle
-        thequery += ",atsc_major_chan,atsc_minor_chan,channum,callsign";
-
-    QStringList outputlist;
-    QString fileprefix = gContext->GetFilePrefix();
+    QStringList outputlist(QString::number(destination.size()));
     QMap<QString, QString> backendIpMap;
     QMap<QString, QString> backendPortMap;
+    QString ip   = gContext->GetSetting("BackendServerIP");
+    QString port = gContext->GetSetting("BackendServerPort");
 
-    query.prepare(thequery);
-
-    if (!query.exec() || !query.isActive())
+    ProgramList::iterator it = destination.begin();
+    for (it = destination.begin(); it != destination.end(); ++it)
     {
-        MythDB::DBError("MainServer::HandleQueryRecordings", query);
-        outputlist << "0";
-    }
-    else
-    {
-        outputlist << QString::number(query.size());
+        ProgramInfo *proginfo = *it;
+        PlaybackSock *slave = NULL;
 
-        while (query.next())
-        {
-            ProgramInfo *proginfo = new ProgramInfo;
+        if (proginfo->hostname != gContext->GetHostName())
+            slave = getSlaveByHostname(proginfo->hostname);
 
-            proginfo->chanid = query.value(0).toString();
-            proginfo->startts = query.value(29).toDateTime();
-            proginfo->endts = query.value(30).toDateTime();
-            proginfo->recstartts = query.value(1).toDateTime();
-            proginfo->recendts = query.value(2).toDateTime();
-            proginfo->title = query.value(3).toString();
-            proginfo->subtitle = query.value(4).toString();
-            proginfo->description = query.value(5).toString();
-            proginfo->hostname = query.value(6).toString();
-
-            proginfo->dupin = RecordingDupInType(query.value(17).toInt());
-            proginfo->dupmethod = RecordingDupMethodType(query.value(18).toInt());
-            proginfo->recordid = query.value(19).toInt();
-            proginfo->chanOutputFilters = query.value(20).toString();
-            proginfo->seriesid = query.value(21).toString();
-            proginfo->programid = query.value(22).toString();
-            proginfo->filesize = stringToLongLong(query.value(23).toString());
-            proginfo->lastmodified =
-                      QDateTime::fromString(query.value(24).toString(),
-                                            Qt::ISODate);
-            proginfo->findid = query.value(25).toInt();
-
-            if (query.value(26).isNull() ||
-                query.value(26).toString().isEmpty())
+        if ((proginfo->hostname == gContext->GetHostName()) ||
+            (!slave && masterBackendOverride))
+        {
+            proginfo->pathname = QString("myth://") + ip + ":" + port
+                + "/" + proginfo->pathname;
+            if (proginfo->filesize == 0)
             {
-                proginfo->originalAirDate = QDate (0, 1, 1);
-                proginfo->hasAirDate      = false;
-            }
-            else
-            {
-                proginfo->originalAirDate =
-                    QDate::fromString(query.value(26).toString(),Qt::ISODate);
-
-                if (proginfo->originalAirDate > QDate(1940, 1, 1))
-                    proginfo->hasAirDate  = true;
-                else
-                    proginfo->hasAirDate  = false;
-            }
-
-            proginfo->pathname = query.value(28).toString();
-
-            if (proginfo->hostname.isEmpty())
-                proginfo->hostname = gContext->GetHostName();
-
-            if (!query.value(7).toString().isEmpty())
-            {
-                proginfo->chanstr = query.value(7).toString();
-                proginfo->channame = query.value(8).toString();
-                proginfo->chansign = query.value(9).toString();
-            }
-            else
-            {
-                proginfo->chanstr = "#" + proginfo->chanid;
-                proginfo->channame = "#" + proginfo->chanid;
-                proginfo->chansign = "#" + proginfo->chanid;
-            }
-
-            // Taken out of programinfo.cpp just to reduce the number of queries
-            int flags = 0;
-            flags |= (query.value(10).toInt() == 1) ? FL_COMMFLAG : 0;
-            flags |= (query.value(11).toInt() == 1) ? FL_CUTLIST : 0;
-            flags |= query.value(12).toInt() ? FL_AUTOEXP : 0;
-            flags |= (query.value(14).toInt() == 1) ? FL_BOOKMARK : 0;
-            flags |= (query.value(35).toInt() == TRANSCODING_COMPLETE) ?
-                      FL_TRANSCODED : 0;
-            flags |= (query.value(37).toInt() == 1) ? FL_WATCHED : 0;
-            flags |= (query.value(38).toInt() == 1) ? FL_PRESERVED : 0;
-
-            inUseKey = query.value(0).toString() + " " +
-                       query.value(1).toDateTime().toString(Qt::ISODate);
-            if (inUseMap.contains(inUseKey))
-                flags |= inUseMap[inUseKey];
-
-            if (query.value(13).toInt())
-            {
-                flags |= FL_EDITING;
-            }
-            else if (query.value(10).toInt() == COMM_FLAG_PROCESSING)
-            {
-                if (JobQueue::IsJobRunning(JOB_COMMFLAG, proginfo))
-                    flags |= FL_EDITING;
-                else
-                    proginfo->SetCommFlagged(COMM_FLAG_NOT_FLAGGED);
-            }
-
-            proginfo->audioproperties = query.value(32).toInt();
-            proginfo->videoproperties = query.value(33).toInt();
-            proginfo->subtitleType = query.value(34).toInt();
-
-            proginfo->programflags = flags;
-
-            proginfo->category = query.value(15).toString();
-
-            proginfo->recgroup = query.value(16).toString();
-            proginfo->playgroup = query.value(27).toString();
-            proginfo->storagegroup =
-                query.value(39).toString();
-
-            proginfo->recpriority = query.value(36).toInt();
-            proginfo->year = query.value(40).toString();
-
-            proginfo->recstatus = rsRecorded;
-            if (proginfo->recendts > rectime)
-            {
-                for (ri = schedList.begin(); ri != schedList.end(); ri++)
+                QString tmpURL = GetPlaybackURL(proginfo);
+                QFile checkFile(tmpURL);
+                if (!tmpURL.isEmpty() && checkFile.exists())
                 {
-                    if ((*ri) && (*ri)->recstatus == rsRecording &&
-                        proginfo->chanid == (*ri)->chanid &&
-                        proginfo->recstartts == (*ri)->recstartts)
-                    {
-                        proginfo->recstatus = rsRecording;
-                        break;
-                    }
+                    proginfo->filesize = checkFile.size();
+                    if (proginfo->recendts < QDateTime::currentDateTime())
+                        proginfo->SetFilesize(proginfo->filesize);
                 }
             }
-
-            proginfo->stars = query.value(31).toDouble();
-
-            PlaybackSock *slave = NULL;
-
-            if (proginfo->hostname != gContext->GetHostName())
-                slave = getSlaveByHostname(proginfo->hostname);
-
-            if ((proginfo->hostname == gContext->GetHostName()) ||
-                (!slave && masterBackendOverride))
+        }
+        else if (!slave)
+        {
+            proginfo->pathname = GetPlaybackURL(proginfo);
+            if (proginfo->pathname.isEmpty())
             {
-                proginfo->pathname = QString("myth://") + ip + ":" + port
-                                     + "/" + proginfo->pathname;
-                if (proginfo->filesize == 0)
-                {
-                    QString tmpURL = GetPlaybackURL(proginfo);
-                    QFile checkFile(tmpURL);
-                    if (!tmpURL.isEmpty() && checkFile.exists())
-                    {
-                        proginfo->filesize = checkFile.size();
-                        if (proginfo->recendts < QDateTime::currentDateTime())
-                            proginfo->SetFilesize(proginfo->filesize);
-                    }
-                }
+                VERBOSE(VB_IMPORTANT,
+                        "MainServer::HandleQueryRecordings()"
+                        "\n\t\t\tCouldn't find backend for: " +
+                        QString("\n\t\t\t%1 : \"%2\"")
+                        .arg(proginfo->title).arg(proginfo->subtitle));
+
+                proginfo->filesize = 0;
+                proginfo->pathname = "file not found";
             }
-            else if (!slave)
+        }
+        else
+        {
+            if (proginfo->filesize == 0)
             {
-                proginfo->pathname = GetPlaybackURL(proginfo);
-                if (proginfo->pathname.isEmpty())
+                if (!slave->FillProgramInfo(proginfo, playbackhost))
                 {
                     VERBOSE(VB_IMPORTANT,
                             "MainServer::HandleQueryRecordings()"
-                            "\n\t\t\tCouldn't find backend for: " +
-                            QString("\n\t\t\t%1 : \"%2\"")
-                            .arg(proginfo->title).arg(proginfo->subtitle));
-
-                    proginfo->filesize = 0;
-                    proginfo->pathname = "file not found";
+                            "\n\t\t\tCould not fill program info "
+                            "from backend");
                 }
-            }
-            else
-            {
-                if (proginfo->filesize == 0)
-                {
-                    if (!slave->FillProgramInfo(proginfo, playbackhost))
-                    {
-                        VERBOSE(VB_IMPORTANT,
-                                "MainServer::HandleQueryRecordings()"
-                                "\n\t\t\tCould not fill program info "
-                                "from backend");
-                    }
-                    else
-                    {
-                        if (proginfo->recendts < QDateTime::currentDateTime())
-                            proginfo->SetFilesize(proginfo->filesize);
-                    }
-                }
                 else
                 {
-                    ProgramInfo *p = proginfo;
-                    if (!backendIpMap.contains(p->hostname))
-                        backendIpMap[p->hostname] =
-                            gContext->GetSettingOnHost("BackendServerIp",
-                                                       p->hostname);
-                    if (!backendPortMap.contains(p->hostname))
-                        backendPortMap[p->hostname] =
-                            gContext->GetSettingOnHost("BackendServerPort",
-                                                       p->hostname);
-                    p->pathname = QString("myth://") +
-                                  backendIpMap[p->hostname] + ":" +
-                                  backendPortMap[p->hostname] + "/" +
-                                  p->pathname;
+                    if (proginfo->recendts < QDateTime::currentDateTime())
+                        proginfo->SetFilesize(proginfo->filesize);
                 }
             }
+            else
+            {
+                ProgramInfo *p = proginfo;
+                if (!backendIpMap.contains(p->hostname))
+                    backendIpMap[p->hostname] =
+                        gContext->GetSettingOnHost("BackendServerIp",
+                                                   p->hostname);
+                if (!backendPortMap.contains(p->hostname))
+                    backendPortMap[p->hostname] =
+                        gContext->GetSettingOnHost("BackendServerPort",
+                                                   p->hostname);
+                p->pathname = QString("myth://") +
+                    backendIpMap[p->hostname] + ":" +
+                    backendPortMap[p->hostname] + "/" +
+                    p->pathname;
+            }
+        }
 
-            if (slave)
-                slave->DownRef();
+        if (slave)
+            slave->DownRef();
 
-            proginfo->ToStringList(outputlist);
-
-            delete proginfo;
-        }
+        proginfo->ToStringList(outputlist);
     }
 
-    for (ri = schedList.begin(); ri != schedList.end(); ri++)
-        delete (*ri);
-
     SendResponse(pbssock, outputlist);
 }
 
Index: programs/mythbackend/scheduler.cpp
===================================================================
--- programs/mythbackend/scheduler.cpp	(revision 22791)
+++ programs/mythbackend/scheduler.cpp	(working copy)
@@ -439,7 +439,8 @@
 void Scheduler::FillRecordListFromMaster(void)
 {
     RecordingList schedList(false);
-    schedList.FromScheduler();
+    bool dummy;
+    LoadFromScheduler(schedList, dummy);
 
     QMutexLocker lockit(reclist_lock);
 
Index: programs/mythwelcome/welcomedialog.h
===================================================================
--- programs/mythwelcome/welcomedialog.h	(revision 22791)
+++ programs/mythwelcome/welcomedialog.h	(working copy)
@@ -6,7 +6,7 @@
 
 // myth
 #include "tvremoteutil.h"
-#include "programinfo.h"
+#include "programdetail.h"
 #include "mythscreentype.h"
 #include "mythuibutton.h"
 #include "mythuitext.h"
Index: programs/mythwelcome/welcomedialog.cpp
===================================================================
--- programs/mythwelcome/welcomedialog.cpp	(revision 22791)
+++ programs/mythwelcome/welcomedialog.cpp	(working copy)
@@ -16,7 +16,6 @@
 #include "mythdbcon.h"
 #include "lcddevice.h"
 #include "tv.h"
-#include "programlist.h"
 #include "uitypes.h"
 #include "compat.h"
 #include "mythdirs.h"
@@ -520,7 +519,7 @@
         return false;
     }
 
-    ProgramList::GetProgramDetailList(
+    GetProgramDetailList(
         m_nextRecordingStart, &m_hasConflicts, &m_scheduledList);
 
     updateStatus();
Index: programs/mythshutdown/main.cpp
===================================================================
--- programs/mythshutdown/main.cpp	(revision 22791)
+++ programs/mythshutdown/main.cpp	(working copy)
@@ -13,8 +13,7 @@
 #include "mythsystem.h"
 #include "mythverbose.h"
 #include "mythversion.h"
-#include "programinfo.h"
-#include "programlist.h"
+#include "programdetail.h"
 #include "jobqueue.h"
 #include "tv.h"
 #include "remoteutil.h"
@@ -412,7 +411,7 @@
     }
 
     QDateTime nextRecordingStart;
-    ProgramList::GetProgramDetailList(nextRecordingStart);
+    GetProgramDetailList(nextRecordingStart);
 
     // set the wakeup time for the next scheduled recording
     if (!nextRecordingStart.isNull())
