From 2a4ab30a6981d36cf274da9dce083fd18a36b78e Mon Sep 17 00:00:00 2001 From: Arnaud Bienner Date: Tue, 13 Mar 2012 22:59:18 +0100 Subject: [PATCH] Connect player->playlistview signals directly in playlistview, now that we have an Application object which holds player. --- src/playlist/playlistview.cpp | 8 ++++++-- src/ui/mainwindow.cpp | 3 --- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index c881c3cf4..508f1c0b7 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -21,8 +21,9 @@ #include "playlistheader.h" #include "playlistview.h" #include "core/application.h" -#include "covers/currentartloader.h" #include "core/logging.h" +#include "core/player.h" +#include "covers/currentartloader.h" #include #include @@ -159,6 +160,9 @@ void PlaylistView::SetApplication(Application *app) { connect(app_->current_art_loader(), SIGNAL(ArtLoaded(const Song&, const QString&, const QImage&)), SLOT(CurrentSongChanged(const Song&, const QString&, const QImage&))); + connect(app_->player(), SIGNAL(Paused()), SLOT(StopGlowing())); + connect(app_->player(), SIGNAL(Playing()), SLOT(StartGlowing())); + connect(app_->player(), SIGNAL(Stopped()), SLOT(StopGlowing())); } void PlaylistView::SetItemDelegates(LibraryBackend* backend) { @@ -1119,7 +1123,7 @@ void PlaylistView::CurrentSongChanged(const Song& song, } void PlaylistView::set_background_image(const QImage& image) { - if (!(image.format() == QImage::Format_ARGB32)) + if (image.format() != QImage::Format_ARGB32) background_image_ = image.convertToFormat(QImage::Format_ARGB32); else background_image_ = image; diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index be769870e..df5ca9296 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -399,9 +399,6 @@ MainWindow::MainWindow(Application* app, connect(app_->player(), SIGNAL(TrackSkipped(PlaylistItemPtr)), SLOT(TrackSkipped(PlaylistItemPtr))); connect(app_->player(), SIGNAL(VolumeChanged(int)), SLOT(VolumeChanged(int))); - connect(app_->player(), SIGNAL(Paused()), ui_->playlist->view(), SLOT(StopGlowing())); - connect(app_->player(), SIGNAL(Playing()), ui_->playlist->view(), SLOT(StartGlowing())); - connect(app_->player(), SIGNAL(Stopped()), ui_->playlist->view(), SLOT(StopGlowing())); connect(app_->player(), SIGNAL(Paused()), ui_->playlist, SLOT(ActivePaused())); connect(app_->player(), SIGNAL(Playing()), ui_->playlist, SLOT(ActivePlaying())); connect(app_->player(), SIGNAL(Stopped()), ui_->playlist, SLOT(ActiveStopped()));