| 190 | |
| 191 | namespace KDevelop { |
| 192 | void DoInForeground::doIt() |
| 193 | { |
| 194 | if (QThread::currentThread() == QCoreApplication::instance()->thread()) { |
| 195 | // We're already in the foreground, just call the handler code |
| 196 | doInternal(); |
| 197 | } else { |
| 198 | QMutexLocker lock(&m_mutex); |
| 199 | QMetaObject::invokeMethod(this, "doInternalSlot", Qt::QueuedConnection); |
| 200 | m_wait.wait(&m_mutex); |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | DoInForeground::~DoInForeground() |
| 205 | { |