diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-09-07 16:30:53 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-09-07 16:30:53 (GMT) |
commit | c4d341ecf26d63cc7410756f8f7d1926c277f02f (patch) | |
tree | b22708e341e4a89dd597a1b5d67e23a6dd4d19d7 /src/3rdparty/phonon/mmf | |
parent | 0ad37ee268f4a314ee31e70fc8b4acfc9aa46970 (diff) | |
download | Qt-c4d341ecf26d63cc7410756f8f7d1926c277f02f.zip Qt-c4d341ecf26d63cc7410756f8f7d1926c277f02f.tar.gz Qt-c4d341ecf26d63cc7410756f8f7d1926c277f02f.tar.bz2 |
Modified file-loading code to use QDir::toNativeSeparators
Diffstat (limited to 'src/3rdparty/phonon/mmf')
-rw-r--r-- | src/3rdparty/phonon/mmf/mediaobject.cpp | 5 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/utils.cpp | 15 | ||||
-rw-r--r-- | 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 <http://www.gnu.org/licenses/>. #include "utils.h" #include "videoplayer.h" +#include <QDir> + 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. */ |