From 22c5dbffcb39b15e38d05160fe91b89469818075 Mon Sep 17 00:00:00 2001 From: David Engel Date: Fri, 1 Feb 2013 10:30:59 -0600 Subject: [PATCH] Fix StatusBox to account for template recording rules. --- mythtv/programs/mythfrontend/statusbox.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/mythtv/programs/mythfrontend/statusbox.cpp b/mythtv/programs/mythfrontend/statusbox.cpp index 8a93efb1e35..cf06b6a3699 100644 --- a/mythtv/programs/mythfrontend/statusbox.cpp +++ b/mythtv/programs/mythfrontend/statusbox.cpp @@ -624,7 +624,24 @@ void StatusBox::doScheduleStatus() MSqlQuery query(MSqlQuery::InitCon()); - query.prepare("SELECT COUNT(*) FROM record WHERE search = 0"); + query.prepare("SELECT COUNT(*) FROM record WHERE type = :TEMPLATE"); + query.bindValue(":TEMPLATE", kTemplateRecord); + if (query.exec() && query.next()) + { + QString rules = tr("%n template rule(s) (is) defined", "", + query.value(0).toInt()); + AddLogLine(rules, helpmsg); + } + else + { + MythDB::DBError("StatusBox::doScheduleStatus()", query); + return; + } + + query.prepare("SELECT COUNT(*) FROM record " + "WHERE type <> :TEMPLATE AND search = :NOSEARCH"); + query.bindValue(":TEMPLATE", kTemplateRecord); + query.bindValue(":NOSEARCH", kNoSearch); if (query.exec() && query.next()) { QString rules = tr("%n standard rule(s) (is) defined", "", @@ -637,7 +654,8 @@ void StatusBox::doScheduleStatus() return; } - query.prepare("SELECT COUNT(*) FROM record WHERE search > 0"); + query.prepare("SELECT COUNT(*) FROM record WHERE search > :NOSEARCH"); + query.bindValue(":NOSEARCH", kNoSearch); if (query.exec() && query.next()) { QString rules = tr("%n search rule(s) are defined", "",