Ticket #264: core.diff

File core.diff, 953 bytes (added by rudi, 12 years ago)

Replaced waitForFinished() by an eventloop

  • core.cpp

     
    2121#include <QFileInfo>
    2222#include <QRegExp>
    2323#include <QTextStream>
     24#include <QEventLoop>
    2425
    2526#include <cmath>
    2627
     
    22262227                return;
    22272228        }
    22282229
     2230#ifdef Q_OS_OS2
     2231        QEventLoop eventLoop;
     2232
     2233        connect(proc, SIGNAL(processExited()), &eventLoop, SLOT(quit()));
     2234
     2235        tellmp("quit");
     2236
     2237        QTimer::singleShot(5000, &eventLoop, SLOT(quit()));
     2238        eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
     2239
     2240        if (proc->isRunning()) {
     2241                qWarning("Core::stopMplayer: process didn't finish. Killing it...");
     2242                proc->kill();
     2243        }
     2244#else
    22292245    tellmp("quit");
    22302246   
    22312247        qDebug("Core::stopMplayer: Waiting mplayer to finish...");
     
    22332249                qWarning("Core::stopMplayer: process didn't finish. Killing it...");
    22342250                proc->kill();
    22352251        }
     2252#endif
    22362253
    22372254        qDebug("Core::stopMplayer: Finished. (I hope)");
    22382255}