Using a consistent spelling of the application name (w.r.t. case-sensitivity)
whenever communicating with the desktop environment is common practice to
always have the same name displayed (as window title, in a window switcher
dialog, etc.). That is also what already has been done in Notify::show().
To enable or disable 'next' action, just rely on MPD's status value
'nextSongId'. Enable 'previous' action when there is more than one item in
the play queue or one item for which its duration is known and this is more
than 5 seconds. That is to also support the feature to go to the start of a
track if already played 5 seconds of it at least (which was introduced in
version 2.4.0). Corresponding implementation of Mpris and ThumbnailToolBar
updated accordingly.
- Also propagate status update to MPRIS interface similar to what has been
done in commit 5dd0942066.
The probably simplest solution is to call Mpris::updateStatus() always
when MainWindow::updateStatus() is called.
- Check for valid song ID in Mpris::CanPause() to return false if
connection to MPD has been lost.
- Move call to Mpris::updateCurrentSong() downwards to pick up the potential
update of current song's duration from MPD's total time value (introduced
by commit 1a38e468b7) and to avoid duplicate
notifications (cf. commit bba9cfd880).
- Update MPRIS status value CanSeek when MPD's total time changes.
- Set MPDStatusValues::timeElapsed and MPDStatusValues::timeTotal to 0
instead of -1 by default because the latter yields 65535 as these
variables are 16 bit unsigned integer.
Re-enable status update of CanPlay/CanPause and let Mpris::CanPlay()
only return true if the play queue is non-empty and so just let
Mpris::CanPause() return true unless MPD's state equals 'stopped'.
Allows the notification server to better identify where the notification comes from and that
it is a non-important notification that shouldn't e.g. clutter up the notification backlog.
Moreover, according to freedesktop Notifications spec the "appName" is a user-visible
name, so use applicationDisplayName for it.