fix playlist update
This commit is contained in:
@@ -200,6 +200,9 @@ Song & Song::operator=(const Song &s)
|
|||||||
itsTrack = s.itsTrack;
|
itsTrack = s.itsTrack;
|
||||||
itsYear = s.itsYear;
|
itsYear = s.itsYear;
|
||||||
itsGenre = s.itsGenre;
|
itsGenre = s.itsGenre;
|
||||||
|
itsComposer = s.itsComposer;
|
||||||
|
itsPerformer = s.itsPerformer;
|
||||||
|
itsDisc = s.itsDisc;
|
||||||
itsComment = s.itsComment;
|
itsComment = s.itsComment;
|
||||||
itsHash = s.itsHash;
|
itsHash = s.itsHash;
|
||||||
itsMinutesLength = s.itsMinutesLength;
|
itsMinutesLength = s.itsMinutesLength;
|
||||||
@@ -212,12 +215,12 @@ Song & Song::operator=(const Song &s)
|
|||||||
|
|
||||||
bool Song::operator==(const Song &s) const
|
bool Song::operator==(const Song &s) const
|
||||||
{
|
{
|
||||||
return itsFile == s.itsFile && itsArtist == s.itsArtist && itsTitle == s.itsTitle && itsAlbum == s.itsAlbum && itsTrack == s.itsTrack && itsYear == s.itsYear && itsGenre == s.itsGenre && itsComment == s.itsComment && itsHash == s.itsHash && itsMinutesLength && s.itsMinutesLength && itsSecondsLength == s.itsSecondsLength && itsPosition == s.itsPosition && itsID == s.itsID;
|
return itsFile == s.itsFile && itsArtist == s.itsArtist && itsTitle == s.itsTitle && itsAlbum == s.itsAlbum && itsTrack == s.itsTrack && itsYear == s.itsYear && itsGenre == s.itsGenre && itsComposer == s.itsComposer && itsPerformer == s.itsPerformer && itsDisc == s.itsDisc && itsComment == s.itsComment && itsHash == s.itsHash && itsMinutesLength && s.itsMinutesLength && itsSecondsLength == s.itsSecondsLength && itsPosition == s.itsPosition && itsID == s.itsID;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Song::operator!=(const Song &s) const
|
bool Song::operator!=(const Song &s) const
|
||||||
{
|
{
|
||||||
return itsFile != s.itsFile || itsArtist != s.itsArtist || itsTitle != s.itsTitle || itsAlbum != s.itsAlbum || itsTrack != s.itsTrack || itsYear != s.itsYear || itsGenre != s.itsGenre || itsComment != s.itsComment || itsHash != s.itsHash || itsMinutesLength || s.itsMinutesLength || itsSecondsLength != s.itsSecondsLength || itsPosition != s.itsPosition || itsID != s.itsID;
|
return itsFile != s.itsFile || itsArtist != s.itsArtist || itsTitle != s.itsTitle || itsAlbum != s.itsAlbum || itsTrack != s.itsTrack || itsYear != s.itsYear || itsGenre != s.itsGenre || itsComposer != s.itsComposer || itsPerformer != s.itsPerformer || itsDisc != s.itsDisc || itsComment != s.itsComment || itsHash != s.itsHash || itsMinutesLength != s.itsMinutesLength || itsSecondsLength != s.itsSecondsLength || itsPosition != s.itsPosition || itsID != s.itsID;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Song::operator<(const Song &s) const
|
bool Song::operator<(const Song &s) const
|
||||||
|
|||||||
@@ -201,16 +201,10 @@ void NcmpcppStatusChanged(MPDConnection *Mpd, MPDStatusChanges changed, void *da
|
|||||||
|
|
||||||
for (SongList::iterator it = vPlaylist.begin(); it != vPlaylist.end(); it++, i++)
|
for (SongList::iterator it = vPlaylist.begin(); it != vPlaylist.end(); it++, i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
(*j)->GetEmptyFields(1);
|
|
||||||
(*it)->GetEmptyFields(1);
|
|
||||||
if (**it != **j)
|
if (**it != **j)
|
||||||
{
|
{
|
||||||
(*it)->GetEmptyFields(0);
|
**it = **j;
|
||||||
(*j)->GetEmptyFields(0);
|
mPlaylist->UpdateOption(i, DisplaySong(**it));
|
||||||
Song *s = new Song(**j);
|
|
||||||
**it = *s;
|
|
||||||
mPlaylist->UpdateOption(i, DisplaySong(*s));
|
|
||||||
}
|
}
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user