Skip to content

Commit

Permalink
Fix StatusBox to account for template recording rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
gigem committed Feb 1, 2013
1 parent b10c806 commit 22c5dbf
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions mythtv/programs/mythfrontend/statusbox.cpp
Expand Up @@ -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", "",
Expand All @@ -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", "",
Expand Down

0 comments on commit 22c5dbf

Please sign in to comment.