1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-02-06 06:03:23 +01:00

Connect player->playlistview signals directly in playlistview, now that we have an Application object which holds player.

This commit is contained in:
Arnaud Bienner 2012-03-13 22:59:18 +01:00
parent 57e41af461
commit 2a4ab30a69
2 changed files with 6 additions and 5 deletions

View File

@ -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 <QCleanlooksStyle>
#include <QClipboard>
@ -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;

View File

@ -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()));