Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit 44a65a73 authored by Clinton Stimpson's avatar Clinton Stimpson
Browse files

BUG: Use pqEventDispatcher::processEventsAndWait() in a few more places.

parent bef14c55
......@@ -378,7 +378,7 @@ void pqPythonEventSource::setContent(const QString& path)
QString pqPythonEventSource::getProperty(QString& object, const QString& prop)
{
// ensure other tasks have been completed
QCoreApplication::processEvents();
pqEventDispatcher::processEventsAndWait(1);
QVariant ret;
QObject* qobject = pqObjectNaming::GetObject(object);
......@@ -407,7 +407,7 @@ void pqPythonEventSource::setProperty(QString& object, QString& prop,
const QString& value)
{
// ensure other tasks have been completed
QCoreApplication::processEvents();
pqEventDispatcher::processEventsAndWait(1);
QVariant ret;
QObject* qobject = pqObjectNaming::GetObject(object);
......@@ -434,7 +434,7 @@ void pqPythonEventSource::threadSetProperty()
QStringList pqPythonEventSource::getChildren(QString& object)
{
// ensure other tasks have been completed
QCoreApplication::processEvents();
pqEventDispatcher::processEventsAndWait(1);
QStringList ret;
QObject* qobject = pqObjectNaming::GetObject(object);
......
......@@ -37,9 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QWaitCondition>
#include <QThread>
#include <QString>
#include <QEventLoop>
#include <QEvent>
#include <QApplication>
#include "pqEventDispatcher.h"
class pqThreadedEventSource::pqInternal : public QThread
{
......@@ -48,7 +47,7 @@ public:
pqInternal(pqThreadedEventSource& source)
: Source(source),
ShouldStop(0),
GotEvent(false)
GotEvent(0)
{
}
......@@ -60,10 +59,9 @@ public:
pqThreadedEventSource& Source;
QWaitCondition WaitCondition;
QEventLoop Loop;
QAtomic ShouldStop;
bool GotEvent;
QAtomic GotEvent;
QString CurrentObject;
QString CurrentCommand;
QString CurrentArgument;
......@@ -88,12 +86,13 @@ int pqThreadedEventSource::getNextEvent(
QString& command,
QString& arguments)
{
if(!this->Internal->GotEvent == true)
{
while(!this->Internal->GotEvent)
{
// wait for the other thread to post an event, while
// we keep the GUI alive.
this->Internal->Loop.exec();
}
pqEventDispatcher::processEventsAndWait(1000);
}
object = this->Internal->CurrentObject;
command = this->Internal->CurrentCommand;
......@@ -119,10 +118,6 @@ void pqThreadedEventSource::relayEvent(QString object, QString command, QString
this->Internal->CurrentCommand = command;
this->Internal->CurrentArgument = arguments;
this->Internal->GotEvent = true;
if(this->Internal->Loop.isRunning())
{
this->Internal->Loop.quit();
}
}
......
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