Multiple EngineController and related fixes, incl. fix for release_blocker bug 299890 (squashed commits, recent on top)

Review Request #105610 - Created July 18, 2012 and submitted

Matěj Laitl
EngineController: don't do serious work in slotAboutToFinish()

...because slotAboutToFinish() may be called twice (or not at all) per
track by some Phonon backends (hi, vlc) - increase play count rather in
slotNewTrackPlaying() or in slotFinished(). This also needs to change
how m_currentTrack is handled, because slotNewTrackPlaying() needs to
have the old one in m_currentTrack.

Also, PlaylistActions::requestNextTrack() is changed to be a read-only
method that shouldn't change playlist state especially when there is no
next track. PlaylistActions::reflectPlaybackFinished() is introduced to
do the thing and is called from EngineController::slotFinished(), which
is a much better place for it than slotAboutToFinish().

Reporters of CCed bugs, please re-test your bug with this commit
applied, it is possible it has been resolved by this patch.

BUG: 299890
CCBUG: 268892
CCBUG: 277197
CCBUG: 302652
CCBUG: 303580
CCBUG: 302240

MetaStream: match track by QUrl, not by QString

Fixes a bug where MetaStram::Track didn't update tags here because
pretty url was used in signal, but it compared against encoded url
(the one with %20 instead of spaces).

MetaStream: big clean-up, implement play statistics methods

 * remove many unused and useless methods such as setTitle() and
 * additionally take genre, comment, track number from Engine
   Controller's signal
 * implement rating, score, first & last play and play count. These are
   rather debugging tool for EngineController, but they also give you
   nice info on how many songs have played in the stream
 * no need to reimplement observer pattern, use MetaBase implementation
 * implement length, EngineController will emit length info soon

EngineController: introduce trackFinishedPlaying() signal

Used do call track->finishedPlaying() now, to be used in
scrobbling when it is emitted for streams, too.

EngineController: reduce code duplication among play() and stop()

EngineController: rework slotMetaDataChanged(), nearly no functional change

 * get data from Phonon to meta QVariantMap more intelligently
 * m_lastTrack and trackChanged had effect only in debug message, ditch
 * note that m_currentTrack may be inaccurate there
 * rename isMetadataSpam() to isInRecentMetaDataHistory() to describe
   the functionality better
 * less debug() spam, specifically be rather quiet for duplicate
   signals from phonon
 * Phonon doesn't provide track length, but it does provide track
   description that we save as "comments" now.
 * trackData() method was unused and likely meant for
   slotMetaDataChanged(); ditch it
Works for me, fixes mentioned bug and more smaller glitches.
Matěj Laitl
Matěj Laitl
Matěj Laitl
Bart Cerneels
Commit Hook
This review has been submitted with commit adfdb3ba4ee53c721b229b2dd4315397470f5711 by Mat?j Laitl to branch master.
Matěj Laitl
Review request changed

Status: Closed (submitted)