diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-12-02 11:39:44 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-12-02 14:19:27 (GMT) |
commit | 3ed427637dd76da371174e14b0f7f2a15801fcac (patch) | |
tree | 527b464d6d4561f37686d84a922d4bfb5f616ce1 /src/3rdparty/phonon/mmf/audioplayer.cpp | |
parent | 7c70e69511817127aa4691339af4a6aa07c1502a (diff) | |
download | Qt-3ed427637dd76da371174e14b0f7f2a15801fcac.zip Qt-3ed427637dd76da371174e14b0f7f2a15801fcac.tar.gz Qt-3ed427637dd76da371174e14b0f7f2a15801fcac.tar.bz2 |
Added error strings to Phonon MMF backend
Note that changing Utils from a namespace into a class, and then
using Q_DECLARE_TR_FUNCTIONS in the class declaration, was necessary
in order to be able to call tr(...) from the implementation of
Utils::symbianErrorToString.
Task-number: QTBUG-4994
Reviewed-by: Oswald Buddenhagen
Diffstat (limited to 'src/3rdparty/phonon/mmf/audioplayer.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/audioplayer.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 8fccfe6..72d6684 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -51,9 +51,8 @@ void MMF::AudioPlayer::construct() TRACE_ENTRY_0(); TRAPD(err, m_player.reset(CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone))); - if (KErrNone != err) { - changeState(ErrorState); - } + if (KErrNone != err) + setError("Creation of audio player failed", err); TRACE_EXIT_0(); } @@ -151,7 +150,7 @@ qint64 MMF::AudioPlayer::currentTime() const // If we don't cast away constness here, we simply have to ignore // the error. - const_cast<AudioPlayer*>(this)->setError(NormalError); + const_cast<AudioPlayer*>(this)->setError(tr("Getting position failed"), err); } return result; @@ -186,8 +185,7 @@ void MMF::AudioPlayer::MapcInitComplete(TInt aError, updateMetaData(); changeState(StoppedState); } else { - // TODO: set different error states according to value of aError? - setError(NormalError); + setError(tr("Opening clip failed"), aError); } TRACE_EXIT_0(); @@ -208,8 +206,7 @@ void MMF::AudioPlayer::MapcPlayComplete(TInt aError) changeState(StoppedState); // TODO: move on to m_nextSource } else { - // TODO: do something with aError? - setError(NormalError); + setError(tr("Playback complete"), aError); } /* |