From c4d341ecf26d63cc7410756f8f7d1926c277f02f Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 7 Sep 2009 17:30:53 +0100 Subject: Modified file-loading code to use QDir::toNativeSeparators --- src/3rdparty/phonon/mmf/mediaobject.cpp | 5 ++++- src/3rdparty/phonon/mmf/utils.cpp | 15 --------------- src/3rdparty/phonon/mmf/utils.h | 9 --------- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index bf55781..a2a7e4d 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -23,6 +23,8 @@ along with this library. If not, see . #include "utils.h" #include "videoplayer.h" +#include + QT_BEGIN_NAMESPACE using namespace Phonon; @@ -101,7 +103,8 @@ MMF::MediaType MMF::MediaObject::fileMediaType MediaType result = MediaTypeUnknown; if (openRecognizer()) { - QHBufC fileNameSymbian = Utils::symbianFilename(fileName); + + const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName)); m_file.Close(); TInt err = m_file.Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly); diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp index df9ceae..cebc32e 100644 --- a/src/3rdparty/phonon/mmf/utils.cpp +++ b/src/3rdparty/phonon/mmf/utils.cpp @@ -31,21 +31,6 @@ void MMF::Utils::panic(PanicCode code) User::Panic(PanicCategory, code); } -QHBufC MMF::Utils::symbianFilename(const QString& qtFilename) -{ - _LIT(ForwardSlash, "/"); - _LIT(BackwardSlash, "\\"); - - QHBufC result(qtFilename); - TInt pos = result->Find(ForwardSlash); - while (pos != KErrNotFound) { - result->Des().Replace(pos, 1, BackwardSlash); - pos = result->Find(ForwardSlash); - } - - return result; -} - static const TInt KMimePrefixLength = 6; // either "audio/" or "video/" _LIT(KMimePrefixAudio, "audio/"); diff --git a/src/3rdparty/phonon/mmf/utils.h b/src/3rdparty/phonon/mmf/utils.h index c0487a7..5a26018 100644 --- a/src/3rdparty/phonon/mmf/utils.h +++ b/src/3rdparty/phonon/mmf/utils.h @@ -47,15 +47,6 @@ namespace Utils void panic(PanicCode code); /** - * Translate forward slashes to backslashes - * - * \note This function is a temporary measure, for use until the - * responsibility for constructing valid file paths is - * determined. - */ -QHBufC symbianFilename(const QString& qtFilename); - -/** * Determines whether the provided MIME type is an audio or video * type. If it is neither, the function returns MediaTypeUnknown. */ -- cgit v0.12