Skip to content

Commit

Permalink
Fix a couple more places where we weren't checking the return value o…
Browse files Browse the repository at this point in the history
…f QSqlQuery::next(), this should be the last of them.
  • Loading branch information
stuartm committed May 24, 2012
1 parent 29ca559 commit 271a9bf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mythtv/libs/libmythtv/profilegroup.cpp
Expand Up @@ -111,9 +111,8 @@ QString ProfileGroup::getName(int group)
.arg(group);
result.prepare(querystr);

if (result.exec() && result.isActive() && result.size() > 0)
if (result.exec() && result.next())
{
result.next();
return result.value(0).toString();
}

Expand All @@ -128,7 +127,7 @@ bool ProfileGroup::allowedGroupName(void)
.arg(getName()).arg(host->getValue());
result.prepare(querystr);

if (result.exec() && result.isActive() && result.size() > 0)
if (result.exec() && result.next())
return false;
return true;
}
Expand Down Expand Up @@ -285,9 +284,8 @@ void ProfileGroupEditor::callDelete(void)
"id = %1 AND is_default = 0;").arg(id);
result.prepare(querystr);

if (result.exec() && result.isActive() && result.size() > 0)
if (result.exec() && result.next())
{
result.next();
QString message = QObject::tr("Delete profile group:") +
QString("\n'%1'?").arg(ProfileGroup::getName(id));

Expand Down

0 comments on commit 271a9bf

Please sign in to comment.