Skip to content

Commit

Permalink
Test the return value of QEventLoop::exec earlier.
Browse files Browse the repository at this point in the history
The clang-tidy "implicit boolean conversion" check pointed out a
function where an integer was implicitly converted to a boolean and
then later implicitly converted back to an integer for an 'if'
statement.  Fix both of these implicit conversions.

https://clang.llvm.org/extra/clang-tidy/checks/readability-implicit-bool-conversion.html
  • Loading branch information
linuxdude42 committed Mar 26, 2019
1 parent 623062f commit f13e3fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/mythsingledownload.cpp
Expand Up @@ -37,13 +37,13 @@ bool MythSingleDownload::DownloadURL(const QUrl &url, QByteArray *buffer,
m_timer.setSingleShot(true);
m_timer.start(timeout); // 30 secs. by default

bool ret = event_loop.exec(); // blocks stack until quit() is called
bool ret = event_loop.exec() != 0; // blocks stack until quit() is called

disconnect(&m_timer, SIGNAL(timeout()), &event_loop, SLOT(quit()));
disconnect(m_reply, SIGNAL(finished()), &event_loop, SLOT(quit()));
disconnect(m_reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(Progress(qint64,qint64)));

if (ret != 0)
if (ret)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "evenloop failed");
}
Expand Down

0 comments on commit f13e3fb

Please sign in to comment.