Rename namespace QtMultimedia::MetaData -> QMediaMetaData

Main code, examples, tests and docs updated. Method:
1. Remove unused forward-declarations, "class QMediaMetaData"
2. Mass find+replace "QtMultimedia::MetaData" -> "QMediaMetaData"
3. Un-nest from the QtMultimedia namespace in qtmedianamespace.h

For consistency (with minimal disruption), namespaces with a "Qt" prefix
will be renamed. Also, Qt guidelines don't include nested namespaces
(http://lists.qt-project.org/pipermail/development/2012-October/006756.html)

Part of the Header Consistency Project
(http://lists.qt-project.org/pipermail/development/2012-October/007570.html)

Change-Id: I40e59c1cf58c1792725e735e9285c51bc5f226b1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Sze Howe Koh
2012-10-31 19:37:48 +08:00
committed by The Qt Project
parent 0affd9023f
commit 00d7092163
33 changed files with 494 additions and 496 deletions

View File

@@ -129,8 +129,8 @@ QMediaStreamsControl::~QMediaStreamsControl()
Returns the meta-data value of \a key for a given \a stream.
Useful metadata keys are QtMultimedia::MetaData::Title,
QtMultimedia::MetaData::Description and QtMultimedia::MetaData::Language.
Useful metadata keys are QMediaMetaData::Title,
QMediaMetaData::Description and QMediaMetaData::Language.
*/
/*!

View File

@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
its current media it will implement QMetaDataReaderControl. This control
provides functions for both retrieving and setting meta-data values.
Meta-data may be addressed by the keys defined in the
QtMultimedia::MetaData namespace.
QMediaMetaData namespace.
The functionality provided by this control is exposed to application
code by the meta-data members of QMediaObject, and so meta-data access

View File

@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
current media it will implement QMetaDataWriterControl. This control
provides functions for both retrieving and setting meta-data values.
Meta-data may be addressed by the keys defined in the
QtMultimedia::MetaData namespace.
QMediaMetaData namespace.
The functionality provided by this control is exposed to application code
by the meta-data members of QMediaObject, and so meta-data access is

View File

@@ -114,9 +114,9 @@ they are documented elsewhere.
\li Meta-data enumeration changes
\li In Qt Multimedia Kit the available meta-data keys were in an enumeration
in the \c QtMultimediaKit namespace. These meta-data keys have been changed
to string literals in the \c {QtMultimedia::MetaData} namespace - generally your
to string literals in the \c {QMediaMetaData} namespace - generally your
source code will mostly be compatible unless you have created variables or
parameters with the \c {QtMultimedia::MetaData} type - you should replace these
parameters with the \c {QMediaMetaData} type - you should replace these
with \c QString.
\row
\li Meta-data method changes

View File

@@ -103,18 +103,18 @@ public:
int length = line.mid(8, artistStart < 8 ? -1 : artistStart - 8).trimmed().toInt(&ok);
if (ok && length > 0) {
//convert from second to milisecond
m_extraInfo[QtMultimedia::MetaData::Duration] = QVariant(length * 1000);
m_extraInfo[QMediaMetaData::Duration] = QVariant(length * 1000);
}
if (artistStart > 0) {
int titleStart = getSplitIndex(line, artistStart);
if (titleStart > artistStart) {
m_extraInfo[QtMultimedia::MetaData::Author] = line.mid(artistStart + 1,
m_extraInfo[QMediaMetaData::Author] = line.mid(artistStart + 1,
titleStart - artistStart - 1).trimmed().
replace(QLatin1String("--"), QLatin1String("-"));
m_extraInfo[QtMultimedia::MetaData::Title] = line.mid(titleStart + 1).trimmed().
m_extraInfo[QMediaMetaData::Title] = line.mid(titleStart + 1).trimmed().
replace(QLatin1String("--"), QLatin1String("-"));
} else {
m_extraInfo[QtMultimedia::MetaData::Title] = line.mid(artistStart + 1).trimmed().
m_extraInfo[QMediaMetaData::Title] = line.mid(artistStart + 1).trimmed().
replace(QLatin1String("--"), QLatin1String("-"));
}
}
@@ -262,13 +262,13 @@ Version=2
m_item[QLatin1String("url")] = getValue(lineIndex, line);
setFlag(FileRead);
} else if (!containsFlag(TitleRead) && line.startsWith(m_titleName)) {
m_item[QtMultimedia::MetaData::Title] = getValue(lineIndex, line);
m_item[QMediaMetaData::Title] = getValue(lineIndex, line);
setFlag(TitleRead);
} else if (!containsFlag(LengthRead) && line.startsWith(m_lengthName)) {
//convert from seconds to miliseconds
int length = getValue(lineIndex, line).toInt();
if (length > 0)
m_item[QtMultimedia::MetaData::Duration] = length * 1000;
m_item[QMediaMetaData::Duration] = length * 1000;
setFlag(LengthRead);
} else if (line.startsWith(QLatin1String("NumberOfEntries"))) {
m_state = Footer;

View File

@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
functions for things like:
\list
\li Accessing the currently playing media's metadata (\l {QMediaObject::metaData()} and \l {QtMultimedia::MetaData}{predefined meta-data keys})
\li Accessing the currently playing media's metadata (\l {QMediaObject::metaData()} and \l {QMediaMetaData}{predefined meta-data keys})
\li Checking to see if the media playback service is currently available (\l {QMediaObject::availability()})
\endlist

View File

@@ -347,7 +347,7 @@ bool QMediaObject::isMetaDataAvailable() const
/*!
Returns the value associated with a meta-data \a key.
See the list of predefined \l {QtMultimedia::MetaData}{meta-data keys}.
See the list of predefined \l {QMediaMetaData}{meta-data keys}.
*/
QVariant QMediaObject::metaData(const QString &key) const
{

View File

@@ -68,9 +68,9 @@ namespace
Fall back to the less-performant QLatin1String in this case.
*/
#if defined(Q_CC_GNU) && defined(Q_COMPILER_LAMBDA)
# define Q_DEFINE_METADATA(key) const QString QtMultimedia::MetaData::key(QStringLiteral(#key))
# define Q_DEFINE_METADATA(key) const QString QMediaMetaData::key(QStringLiteral(#key))
#else
# define Q_DEFINE_METADATA(key) const QString QtMultimedia::MetaData::key(QLatin1String(#key))
# define Q_DEFINE_METADATA(key) const QString QMediaMetaData::key(QLatin1String(#key))
#endif
// Common
@@ -187,7 +187,7 @@ Q_DEFINE_METADATA(ThumbnailImage);
/*!
\namespace QtMultimedia::MetaData
\namespace QMediaMetaData
\inheaderfile qtmedianamespace.h
This namespace provides identifiers for meta-data attributes.

View File

@@ -57,9 +57,7 @@ class QString;
#define Q_DECLARE_METADATA(key) Q_MULTIMEDIA_EXPORT extern const QString key
namespace QtMultimedia
{
namespace MetaData {
namespace QMediaMetaData {
#ifdef Q_QDOC
// QDoc does not like macros, so try to keep this in sync :)
QString Title;
@@ -287,6 +285,8 @@ namespace QtMultimedia
#endif
}
namespace QtMultimedia
{
enum SupportEstimate
{
NotSupported,