Commit 82dca181 authored by Clinton Stimpson's avatar Clinton Stimpson
Browse files

BUG: Remove wait functions. Use python's time.sleep() instead.

parent 2b6bdb77
......@@ -202,42 +202,6 @@ QtTesting_setProperty(PyObject* /*self*/, PyObject* args)
return Py_BuildValue(const_cast<char*>("s"), "");
}
static PyObject*
QtTesting_wait(PyObject* /*self*/, PyObject* args)
{
// void QtTesting.wait(msec)
int ms = 0;
if(!PyArg_ParseTuple(args, const_cast<char*>("i"), &ms))
{
PyErr_SetString(PyExc_TypeError, "bad arguments to wait(msec)");
return NULL;
}
if(Instance && QThread::currentThread() != QApplication::instance()->thread())
{
QMetaObject::invokeMethod(Instance, "threadWait", Qt::QueuedConnection,
Q_ARG(int, ms) );
if(!Instance->waitForGUI())
{
PyErr_SetString(PyExc_ValueError, "error waiting");
return NULL;
}
}
else if(QThread::currentThread() == QApplication::instance()->thread())
{
pqPythonEventSource::wait(ms);
}
else
{
PyErr_SetString(PyExc_AssertionError, "pqPythonEventSource not defined");
return NULL;
}
return Py_BuildValue(const_cast<char*>(""));
}
static PyObject*
QtTesting_getQtVersion(PyObject* /*self*/, PyObject* /*args*/)
{
......@@ -375,13 +339,6 @@ static PyMethodDef QtTestingMethods[] = {
METH_VARARGS,
const_cast<char*>("Get the version of Qt being used.")
},
{
const_cast<char*>("wait"),
QtTesting_wait,
METH_VARARGS,
const_cast<char*>("Have the python script wait for a specfied number"
" of msecs, while the Qt app is alive.")
},
{
const_cast<char*>("getChildren"),
QtTesting_getChildren,
......@@ -590,14 +547,3 @@ QString pqPythonEventSource::invokeMethod(QString& object, QString& method)
return ret.toString();
}
void pqPythonEventSource::threadWait(int ms)
{
this->wait(ms);
this->guiAcknowledge();
}
void pqPythonEventSource::wait(int ms)
{
pqEventDispatcher::processEventsAndWait(ms);
}
......@@ -52,7 +52,6 @@ public:
static void setProperty(QString& object, QString& prop, const QString& value);
static QStringList getChildren(QString& object);
static QString invokeMethod(QString& object, QString& method);
static void wait(int ms);
protected:
virtual void run();
......@@ -62,7 +61,6 @@ protected slots:
void threadSetProperty();
void threadGetChildren();
void threadInvokeMethod();
void threadWait(int);
private:
class pqInternal;
......
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