Commit 6d5d3ff6 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

testhelper: stop using a global event loop object

Using a global event loop object can only introduce unexpected side effects,
in particular if a job emits the result signal more than once (which
should not happen, but somehow it does with LoadJobs).

parent ead95518
......@@ -25,13 +25,12 @@
#include "testhelper.h"
QEventLoop TestHelper::m_eventLoop;
void TestHelper::startAndWaitForResult(KJob *job)
QObject::connect(job, &KJob::result, &m_eventLoop, &QEventLoop::quit);
QEventLoop eventLoop;
QObject::connect(job, &KJob::result, &eventLoop, &QEventLoop::quit);
m_eventLoop.exec(); // krazy:exclude=crashy
eventLoop.exec(); // krazy:exclude=crashy
QVector<Archive::Entry*> TestHelper::getEntryList(Archive *archive)
......@@ -58,8 +58,6 @@ private:
* It's useful when we need a sorted list of entries.
static QMap<QString, Archive::Entry*> getEntryMap(const QVector<Archive::Entry*> &entries);
static QEventLoop m_eventLoop;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment