From a98e03a99254a2e824dd6bf6f6a28fd49644b6b8 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Tue, 21 Jul 2009 12:01:09 +0200 Subject: [PATCH] Clear the loadingWidget when doing a new search --- src/MediaView.cpp | 9 ++++++++- src/loadingwidget.cpp | 6 ++++++ src/loadingwidget.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/MediaView.cpp b/src/MediaView.cpp index 1f178bd..bd3eb7a 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -104,11 +104,15 @@ void MediaView::setMediaObject(Phonon::MediaObject *mediaObject) { void MediaView::search(SearchParams *searchParams) { this->searchParams = searchParams; + // start serching for videos + listModel->search(searchParams); + // this implies that the enum and the bar action order is the same sortBar->setCheckedAction(searchParams->sortBy()-1); - listModel->search(searchParams); listView->setFocus(); + + loadingWidget->clear(); } void MediaView::disappear() { @@ -138,9 +142,12 @@ void MediaView::stateChanged(Phonon::State newState, Phonon::State /*oldState*/) // play() has already been called when setting the source // but Phonon on Linux needs a little more help to start playback mediaObject->play(); + + // Workaround for Mac playback start problem if (!timerPlayFlag) { QTimer::singleShot(1000, this, SLOT(timerPlay())); } + break; case Phonon::PausedState: diff --git a/src/loadingwidget.cpp b/src/loadingwidget.cpp index bf6c3f3..d9596dc 100644 --- a/src/loadingwidget.cpp +++ b/src/loadingwidget.cpp @@ -67,3 +67,9 @@ void LoadingWidget::bufferStatus(int percent) { progressBar->setValue(percent); */ } + +void LoadingWidget::clear() { + titleLabel->clear(); + descriptionLabel->clear(); + // progressBar->hide(); +} diff --git a/src/loadingwidget.h b/src/loadingwidget.h index ba7ff10..3117bad 100644 --- a/src/loadingwidget.h +++ b/src/loadingwidget.h @@ -11,6 +11,7 @@ class LoadingWidget : public QWidget { public: LoadingWidget(QWidget *parent); void setVideo(Video *video); + void clear(); public slots: void bufferStatus(int); -- 2.39.5