diff --git a/declarativeimports/krunnermodel/runnermodel.cpp b/declarativeimports/krunnermodel/runnermodel.cpp index b2de36a93..7c5485b47 100644 --- a/declarativeimports/krunnermodel/runnermodel.cpp +++ b/declarativeimports/krunnermodel/runnermodel.cpp @@ -31,6 +31,7 @@ RunnerModel::RunnerModel(QObject *parent) : QAbstractListModel(parent), m_manager(0), m_startQueryTimer(new QTimer(this)), + m_runningChangedTimeout(new QTimer(this)), m_running(false) { QHash roles; @@ -50,6 +51,10 @@ RunnerModel::RunnerModel(QObject *parent) m_startQueryTimer->setSingleShot(true); m_startQueryTimer->setInterval(10); connect(m_startQueryTimer, SIGNAL(timeout()), this, SLOT(startQuery())); + + //FIXME: HACK: some runners stay in a running but finished state, not possible to say if it's actually over + m_runningChangedTimeout->setSingleShot(true); + connect(m_runningChangedTimeout, SIGNAL(timeout()), this, SLOT(queryHasFinished())); } int RunnerModel::rowCount(const QModelIndex& index) const @@ -189,6 +194,7 @@ void RunnerModel::matchesChanged(const QList &matches) m_matches = matches; endResetModel(); emit countChanged(); + m_runningChangedTimeout->start(3000); } void RunnerModel::queryHasFinished() diff --git a/declarativeimports/krunnermodel/runnermodel.h b/declarativeimports/krunnermodel/runnermodel.h index 82e28cb8c..3dc80d75d 100644 --- a/declarativeimports/krunnermodel/runnermodel.h +++ b/declarativeimports/krunnermodel/runnermodel.h @@ -116,6 +116,7 @@ private: QStringList m_pendingRunnersList; QString m_pendingQuery; QTimer *m_startQueryTimer; + QTimer *m_runningChangedTimeout; bool m_running; };