From: Flavio Tordini Date: Wed, 4 Nov 2009 23:35:44 +0000 (+0100) Subject: Fix HD indicator randomly not working X-Git-Tag: 0.8~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ba86b15f4e720f72eb9c4f33b2978b1b2372ef9e;p=minitube Fix HD indicator randomly not working Stop timers on video change --- diff --git a/src/MediaView.cpp b/src/MediaView.cpp index 8427aa6..ea0df72 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -239,11 +239,14 @@ void MediaView::activeRowChanged(int row) { Video *video = listModel->videoAt(row); if (!video) return; + // now that we have a new video to play + // stop all the timers + workaroundTimer->stop(); + errorTimer->stop(); + // immediately show the loading widget videoAreaWidget->showLoading(video); - // mediaObject->pause(); - connect(video, SIGNAL(gotStreamUrl(QUrl)), SLOT(gotStreamUrl(QUrl))); // TODO handle signal in a proper slot and impl item error status connect(video, SIGNAL(errorStreamUrl(QString)), SLOT(handleError(QString))); @@ -286,7 +289,7 @@ void MediaView::gotStreamUrl(QUrl streamUrl) { qDebug() << "Cannot get sender"; return; } - bool ret = QMetaObject::invokeMethod(qApp->topLevelWidgets().first(), "hdIndicator", Qt::DirectConnection, Q_ARG(bool, video->isHd())); + bool ret = QMetaObject::invokeMethod(parent()->parent(), "hdIndicator", Qt::DirectConnection, Q_ARG(bool, video->isHd())); if (!ret) qDebug() << "hdIndicator invokeMethod failed"; }