Make Playlist's InformOfCurrentSongChange public and use it when updating item instead of using UpdateItems (which will create a new item)

This commit is contained in:
Arnaud Bienner 2011-11-11 02:42:48 +01:00
parent 85ab8e260a
commit 48db13b353
3 changed files with 4 additions and 4 deletions

View File

@ -110,7 +110,7 @@ void Player::HandleLoadResult(const UrlHandler::LoadResult& result) {
Song song = item->Metadata();
song.set_length_nanosec(result.length_nanosec_);
item->SetTemporaryMetadata(song);
playlists_->active()->UpdateItems(SongList() << song);
playlists_->active()->InformOfCurrentSongChange();
}
engine_->Play(result.media_url_, stream_change_type_,
item->Metadata().has_cue(),

View File

@ -789,7 +789,8 @@ void GroovesharkService::SongUrlToShareReceived(QNetworkReply* reply) {
url_box.setWindowTitle(tr("Grooveshark song's URL"));
url_box.setText(url);
url_box.setStandardButtons(QMessageBox::Ok);
QPushButton* copy_to_clipboard_button = url_box.addButton(tr("Copy to clipboard"), QMessageBox::ActionRole);
QPushButton* copy_to_clipboard_button =
url_box.addButton(tr("Copy to clipboard"), QMessageBox::ActionRole);
url_box.exec();

View File

@ -236,6 +236,7 @@ class Playlist : public QAbstractListModel {
void StopAfter(int row);
void ReloadItems(const QList<int>& rows);
void InformOfCurrentSongChange();
// Changes rating of a song to the given value asynchronously
void RateSong(const QModelIndex& index, double rating);
@ -324,8 +325,6 @@ class Playlist : public QAbstractListModel {
// Removes rows with given indices from this playlist.
bool removeRows(QList<int>& rows);
void InformOfCurrentSongChange();
private slots:
void TracksAboutToBeDequeued(const QModelIndex&, int begin, int end);
void TracksDequeued();