summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-05-03 17:02:39 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-03 20:21:25 +0200
commitd60c44f65149b40ca5bd8646da5dc68918dc45bf (patch)
tree4f5e7f1dd9c6fda60e5525ee1107e4024fa4bf47
parent866a7e0c6850af866b3f1723365a68535906ad12 (diff)
Change uses of {to,from}Ascii to {to,from}Latin1
This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I08a85e645e960dd2ebd58ec5020ab5dc5dbec297 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
-rw-r--r--src/gallery/simple/qmdlite.cpp10
-rw-r--r--src/gallery/simple/qmdlitemusic.cpp8
-rwxr-xr-xsrc/gallery/simple/qsimplegalleryqueryresultset.cpp66
-rw-r--r--src/gallery/simple/qsimplegalleryresultset.cpp62
4 files changed, 73 insertions, 73 deletions
diff --git a/src/gallery/simple/qmdlite.cpp b/src/gallery/simple/qmdlite.cpp
index 4b6d775..9ff4d7c 100644
--- a/src/gallery/simple/qmdlite.cpp
+++ b/src/gallery/simple/qmdlite.cpp
@@ -187,7 +187,7 @@ QVariant QMdLitePrivate::insert (const QString &table, QStringList& properties,
Q_ASSERT (properties.length() == values.length());
#ifdef _SQLITE_QMDBACKEND
- QString queryStr(QString::fromAscii("INSERT INTO ").append(table).append(" ("));
+ QString queryStr(QString::fromLatin1("INSERT INTO ").append(table).append(" ("));
queryStr.append(properties.join(", ")).append(") VALUES (");
for (int ii=0; ii<values.length(); ii++) {
if (values.at(ii).isNull())
@@ -229,7 +229,7 @@ bool QMdLitePrivate::update (const QString &table, QVariant id, const QStringLis
{
Q_ASSERT (properties.length() == values.length());
#ifdef _SQLITE_QMDBACKEND
- QString queryStr(QString::fromAscii("UPDATE ").append(table).append(" SET "));
+ QString queryStr(QString::fromLatin1("UPDATE ").append(table).append(" SET "));
for (int ii=0; ii<properties.length(); ii++) {
if (values.at(ii).isNull())
queryStr.append("=NULL");
@@ -280,7 +280,7 @@ bool QMdLitePrivate::update (const QString &table, QVariant id, const QStringLis
}
QString QMdLitePrivate::cleanStr (const QString &str) {
- if (str.isNull() || str.length() < 1) return QString::fromAscii(" ");
+ if (str.isNull() || str.length() < 1) return QString::fromLatin1(" ");
QString ret = str;
//QRegExp re("\\(.*\\)|\\{.*\\}|\\[.*\\]|<.*>|[\\(\\)_\\{\\}\\[\\]\\!@#$\\^&\\*\\+\\=\\|\\\\/\"'\\?~`]");
QRegExp re(QLatin1String("[\\(\\)_\\{\\}\\[\\]\\!@#$\\^&\\*\\+\\=\\|\\\\/\"'\\?~`]"));
@@ -305,7 +305,7 @@ bool QMdLitePrivate::remove(const QString &table, QList<QVariant> &ids)
idStrs.append(numStr);
}
- QString queryStr(QString::fromAscii("DELETE FROM ").append(table).append(" WHERE id IN ("));
+ QString queryStr(QString::fromLatin1("DELETE FROM ").append(table).append(" WHERE id IN ("));
queryStr.append(idStrs.join(", ")).append(")");
qDebug() << "Delete query: " << queryStr;
@@ -347,7 +347,7 @@ QString QMdLitePrivate::dbDirName ()
{
QString ret = QDir::homePath();
if (ret.isEmpty())
- ret = QString::fromAscii("/krakatau");
+ ret = QString::fromLatin1("/krakatau");
ret.append (QDir::separator()).append(QLatin1String(".qmdlite"));
if (!QFile::exists (ret)) {
diff --git a/src/gallery/simple/qmdlitemusic.cpp b/src/gallery/simple/qmdlitemusic.cpp
index c4828a4..878c2a7 100644
--- a/src/gallery/simple/qmdlitemusic.cpp
+++ b/src/gallery/simple/qmdlitemusic.cpp
@@ -148,9 +148,9 @@ QMdLiteMusicPrivate::~QMdLiteMusicPrivate ()
QString QMdLiteMusicPrivate::albumArtImageBaseName (const QString& albumArtist, const QString& title)
{
QString helper = cleanStr (title);
- QString ret = QString::fromAscii(QCryptographicHash::hash ( helper.toLocal8Bit(), QCryptographicHash::Md5).toHex());
+ QString ret = QString::fromLatin1(QCryptographicHash::hash ( helper.toLocal8Bit(), QCryptographicHash::Md5).toHex());
helper = cleanStr(albumArtist);
- ret.append(QLatin1String("-")).append(QString::fromAscii(QCryptographicHash::hash ( helper.toLocal8Bit(), QCryptographicHash::Md5).toHex()));
+ ret.append(QLatin1String("-")).append(QString::fromLatin1(QCryptographicHash::hash ( helper.toLocal8Bit(), QCryptographicHash::Md5).toHex()));
return ret;
}
@@ -495,12 +495,12 @@ QString QMdLiteMusic::albumArtThumbnailImagePath (const QString& title)
#ifdef QT_OPENGL_ES
thumbnailName = QMdLiteMusicPrivate::albumArtCompressedTexturePath(QMdLiteMusicPrivate::musicAlbumArtDir()+imageBaseName);
if (!QFile::exists(thumbnailName)) {
- thumbnailName = QMdLiteMusicPrivate::albumArtCompressedTexturePath(QString::fromAscii(":/image/default"));
+ thumbnailName = QMdLiteMusicPrivate::albumArtCompressedTexturePath(QString::fromLatin1(":/image/default"));
}
#else
thumbnailName = QMdLiteMusicPrivate::albumArtThumbnailImagePath(QMdLiteMusicPrivate::musicAlbumArtDir()+imageBaseName);
if (!QFile::exists(thumbnailName)) {
- thumbnailName = QMdLiteMusicPrivate::albumArtThumbnailImagePath(QString::fromAscii(":/image/default"));
+ thumbnailName = QMdLiteMusicPrivate::albumArtThumbnailImagePath(QString::fromLatin1(":/image/default"));
}
#endif
//qDebug() << "albumArtThumbnailImagePath returning: " << thumbnailName;
diff --git a/src/gallery/simple/qsimplegalleryqueryresultset.cpp b/src/gallery/simple/qsimplegalleryqueryresultset.cpp
index 9b8ea42..7e14bb5 100755
--- a/src/gallery/simple/qsimplegalleryqueryresultset.cpp
+++ b/src/gallery/simple/qsimplegalleryqueryresultset.cpp
@@ -87,34 +87,34 @@ void QSimpleGalleryQueryResultSet::createQuery()
bool isJsonDb = musicDb.dbType();
//m_isValid = true;
QStringList propertyList;
- propertyList << QString::fromAscii("albumArt")
- << QString::fromAscii("title")
- << QString::fromAscii("artist")
- << QString::fromAscii("albumArtist");
+ propertyList << QString::fromLatin1("albumArt")
+ << QString::fromLatin1("title")
+ << QString::fromLatin1("artist")
+ << QString::fromLatin1("albumArtist");
//m_result.clear();
- QString filterStr = filterToString(QString::fromAscii("albums"), m_request->filter(), isJsonDb);
+ QString filterStr = filterToString(QString::fromLatin1("albums"), m_request->filter(), isJsonDb);
// Add the root item to the query
if (!m_request->rootItem().toString().isEmpty()) {
- QStringList parts = m_request->rootItem().toString().split(QString::fromAscii(":/"));
- if (QString::compare(QString::fromAscii("artist"), parts.at(0), Qt::CaseInsensitive) == 0) {
+ QStringList parts = m_request->rootItem().toString().split(QString::fromLatin1(":/"));
+ if (QString::compare(QString::fromLatin1("artist"), parts.at(0), Qt::CaseInsensitive) == 0) {
QString artistCleaned(parts.at(1));
// TODO: Jsondb stuff here
if (isJsonDb) {
- artistCleaned.replace(QString::fromAscii("\""), QString::fromAscii("\\\""));
- artistCleaned.replace(QString::fromAscii("\\"), QString::fromAscii("\\\\"));
+ artistCleaned.replace(QString::fromLatin1("\""), QString::fromLatin1("\\\""));
+ artistCleaned.replace(QString::fromLatin1("\\"), QString::fromLatin1("\\\\"));
QString artistFilter(QLatin1String("[?artist=\""));
- artistFilter.append(artistCleaned).append(QString::fromAscii("\"]"));
+ artistFilter.append(artistCleaned).append(QString::fromLatin1("\"]"));
filterStr.prepend(artistFilter);
//qDebug() << filterStr;
}
else {
- artistCleaned.replace(QString::fromAscii("'"), QString::fromAscii("''"));
+ artistCleaned.replace(QString::fromLatin1("'"), QString::fromLatin1("''"));
if (!filterStr.isEmpty())
- filterStr.append(QString::fromAscii(" AND artist = '")).append(artistCleaned).append(QString::fromAscii("'"));
+ filterStr.append(QString::fromLatin1(" AND artist = '")).append(artistCleaned).append(QString::fromLatin1("'"));
else
- filterStr.append(QString::fromAscii("artist = '")).append(artistCleaned).append(QString::fromAscii("'"));
+ filterStr.append(QString::fromLatin1("artist = '")).append(artistCleaned).append(QString::fromLatin1("'"));
}
}
}
@@ -157,11 +157,11 @@ void QSimpleGalleryQueryResultSet::createQuery()
bool isJsonDb = musicDb.dbType();
//m_isValid = true;
//m_result.clear();
- QString filterStr = filterToString(QString::fromAscii("songs"), m_request->filter(), isJsonDb);
+ QString filterStr = filterToString(QString::fromLatin1("songs"), m_request->filter(), isJsonDb);
bool artistRootItem = false;
if (!m_request->rootItem().toString().isEmpty()) {
- QStringList parts = m_request->rootItem().toString().split(QString::fromAscii(":/"));
- if (QString::compare(QString::fromAscii("artist"), parts.at(0), Qt::CaseInsensitive) == 0) {
+ QStringList parts = m_request->rootItem().toString().split(QString::fromLatin1(":/"));
+ if (QString::compare(QString::fromLatin1("artist"), parts.at(0), Qt::CaseInsensitive) == 0) {
artistRootItem = true;
m_itemType = QDocumentGallery::AlbumArtist;
m_resultQuery = musicDb.createArtistAlbumsQuery(parts.at(1), filterStr);
@@ -217,19 +217,19 @@ void QSimpleGalleryQueryResultSet::createQuery()
//m_isValid = true;
//m_result.clear();
QStringList propertyList;
- propertyList << QString::fromAscii("url")
- << QString::fromAscii("title")
- << QString::fromAscii("artist")
- << QString::fromAscii("albumTitle")
- << QString::fromAscii("albumArtist")
- << QString::fromAscii("albumArt")
- << QString::fromAscii("trackNumber")
- << QString::fromAscii("genre");
- QString filterStr = filterToString(QString::fromAscii("songs"), m_request->filter(), isJsonDb);
+ propertyList << QString::fromLatin1("url")
+ << QString::fromLatin1("title")
+ << QString::fromLatin1("artist")
+ << QString::fromLatin1("albumTitle")
+ << QString::fromLatin1("albumArtist")
+ << QString::fromLatin1("albumArt")
+ << QString::fromLatin1("trackNumber")
+ << QString::fromLatin1("genre");
+ QString filterStr = filterToString(QString::fromLatin1("songs"), m_request->filter(), isJsonDb);
// Add the root item to the query
// TODO: add jsondb support to below
if (!m_request->rootItem().toString().isEmpty()) {
- QStringList parts = m_request->rootItem().toString().split(QString::fromAscii(":/"));
+ QStringList parts = m_request->rootItem().toString().split(QString::fromLatin1(":/"));
/*if (QString::compare("album", parts.at(0), Qt::CaseInsensitive) == 0) {
if (isJsonDb) {
QString albumFilter(QLatin1String("[?_uuid in \""));
@@ -244,22 +244,22 @@ void QSimpleGalleryQueryResultSet::createQuery()
filterStr.append("songs.albumId = ").append(parts.at(1));
}
}
- else*/ if (QString::compare(QString::fromAscii("artist"), parts.at(0), Qt::CaseInsensitive) == 0) {
+ else*/ if (QString::compare(QString::fromLatin1("artist"), parts.at(0), Qt::CaseInsensitive) == 0) {
QString artistCleaned(parts.at(1));
if (isJsonDb) {
- artistCleaned.replace(QString::fromAscii("\""), QString::fromAscii("\\\""));
- artistCleaned.replace(QString::fromAscii("\\"), QString::fromAscii("\\\\"));
+ artistCleaned.replace(QString::fromLatin1("\""), QString::fromLatin1("\\\""));
+ artistCleaned.replace(QString::fromLatin1("\\"), QString::fromLatin1("\\\\"));
QString artistFilter(QLatin1String("[?artist=\""));
- artistFilter.append(artistCleaned).append(QString::fromAscii("\"]"));
+ artistFilter.append(artistCleaned).append(QString::fromLatin1("\"]"));
filterStr.prepend(artistFilter);
//qDebug() << filterStr;
}
else {
- artistCleaned.replace(QString::fromAscii("'"), QString::fromAscii("''"));
+ artistCleaned.replace(QString::fromLatin1("'"), QString::fromLatin1("''"));
if (!filterStr.isEmpty())
- filterStr.append(QString::fromAscii(" AND songs.artist = ")).append(artistCleaned);
+ filterStr.append(QString::fromLatin1(" AND songs.artist = ")).append(artistCleaned);
else
- filterStr.append(QString::fromAscii("songs.artist = ")).append(artistCleaned);
+ filterStr.append(QString::fromLatin1("songs.artist = ")).append(artistCleaned);
}
}
}
diff --git a/src/gallery/simple/qsimplegalleryresultset.cpp b/src/gallery/simple/qsimplegalleryresultset.cpp
index 0345812..20e8b92 100644
--- a/src/gallery/simple/qsimplegalleryresultset.cpp
+++ b/src/gallery/simple/qsimplegalleryresultset.cpp
@@ -92,7 +92,7 @@ QString QSimpleGalleryResultSet::_jsonDbFilterToString(const QString &tableName,
QGalleryUnionFilter unionFilter = filter.toUnionFilter();
for (int ii=0; ii<unionFilter.filters().length(); ii++) {
if (ii)
- ret.append(QString::fromAscii(" | "));
+ ret.append(QString::fromLatin1(" | "));
ret.append(_jsonDbFilterToString(tableName, unionFilter.filters()[ii], !inOr));
}
if (!inOr)
@@ -103,10 +103,10 @@ QString QSimpleGalleryResultSet::_jsonDbFilterToString(const QString &tableName,
QGalleryMetaDataFilter metadataFilter = filter.toMetaDataFilter();
if (!inOr)
ret.append(QLatin1String("[?"));
- if (metadataFilter.propertyName().compare(QString::fromAscii("albumTitle"), Qt::CaseInsensitive) == 0)
- ret.append(QString::fromAscii("album.title"));
- else if (metadataFilter.propertyName().compare(QString::fromAscii("albumArtist"), Qt::CaseInsensitive) == 0)
- ret.append(QString::fromAscii("album.artist"));
+ if (metadataFilter.propertyName().compare(QString::fromLatin1("albumTitle"), Qt::CaseInsensitive) == 0)
+ ret.append(QString::fromLatin1("album.title"));
+ else if (metadataFilter.propertyName().compare(QString::fromLatin1("albumArtist"), Qt::CaseInsensitive) == 0)
+ ret.append(QString::fromLatin1("album.artist"));
/*else if (metadataFilter.propertyName().compare("albumCover", Qt::CaseInsensitive) == 0)
ret.append ("albumId->url");*/
else
@@ -114,62 +114,62 @@ QString QSimpleGalleryResultSet::_jsonDbFilterToString(const QString &tableName,
switch (metadataFilter.comparator()) {
case QGalleryFilter::Equals:
if (metadataFilter.isNegated())
- ret.append(QString::fromAscii("!"));
- ret.append(QString::fromAscii("="));
- ret.append(QString::fromAscii("\"")).append(metadataFilter.value().toString()).append(QString::fromAscii("\""));
+ ret.append(QString::fromLatin1("!"));
+ ret.append(QString::fromLatin1("="));
+ ret.append(QString::fromLatin1("\"")).append(metadataFilter.value().toString()).append(QString::fromLatin1("\""));
break;
case QGalleryFilter::LessThan:
if (metadataFilter.isNegated())
- ret.append(QString::fromAscii(">="));
+ ret.append(QString::fromLatin1(">="));
else
- ret.append(QString::fromAscii("<"));
+ ret.append(QString::fromLatin1("<"));
ret.append(metadataFilter.value().toString());
break;
case QGalleryFilter::GreaterThan:
if (metadataFilter.isNegated())
- ret.append(QString::fromAscii("<="));
+ ret.append(QString::fromLatin1("<="));
else
- ret.append(QString::fromAscii(">"));
+ ret.append(QString::fromLatin1(">"));
ret.append(metadataFilter.value().toString());
break;
case QGalleryFilter::LessThanEquals:
if (metadataFilter.isNegated())
- ret.append(QString::fromAscii(">"));
+ ret.append(QString::fromLatin1(">"));
else
- ret.append(QString::fromAscii("<="));
+ ret.append(QString::fromLatin1("<="));
ret.append(metadataFilter.value().toString());
break;
case QGalleryFilter::GreaterThanEquals:
if (metadataFilter.isNegated())
- ret.append(QString::fromAscii("<"));
+ ret.append(QString::fromLatin1("<"));
else
- ret.append(QString::fromAscii(">="));
+ ret.append(QString::fromLatin1(">="));
ret.append(metadataFilter.value().toString());
break;
case QGalleryFilter::Contains:
- ret.append(QString::fromAscii("=~"));
- ret.append(QString::fromAscii("\"/*")).append(metadataFilter.value().toString().
- replace(QString::fromAscii("\""), QString::fromAscii("\\\""))).append(QString::fromAscii("*/iw\""));
+ ret.append(QString::fromLatin1("=~"));
+ ret.append(QString::fromLatin1("\"/*")).append(metadataFilter.value().toString().
+ replace(QString::fromLatin1("\""), QString::fromLatin1("\\\""))).append(QString::fromLatin1("*/iw\""));
break;
case QGalleryFilter::StartsWith:
- ret.append(QString::fromAscii("=~"));
- ret.append(QString::fromAscii("\"/")).append(metadataFilter.value().toString().
- replace(QString::fromAscii("\""), QString::fromAscii("\\\""))).append(QString::fromAscii("*/iw\""));
+ ret.append(QString::fromLatin1("=~"));
+ ret.append(QString::fromLatin1("\"/")).append(metadataFilter.value().toString().
+ replace(QString::fromLatin1("\""), QString::fromLatin1("\\\""))).append(QString::fromLatin1("*/iw\""));
break;
case QGalleryFilter::EndsWith:
- ret.append(QString::fromAscii("=~"));
- ret.append(QString::fromAscii("\"/*")).append(metadataFilter.value().toString().
- replace(QString::fromAscii("\""), QString::fromAscii("\\\""))).append(QString::fromAscii("/iw\""));
+ ret.append(QString::fromLatin1("=~"));
+ ret.append(QString::fromLatin1("\"/*")).append(metadataFilter.value().toString().
+ replace(QString::fromLatin1("\""), QString::fromLatin1("\\\""))).append(QString::fromLatin1("/iw\""));
break;
case QGalleryFilter::Wildcard:
- ret.append(QString::fromAscii("=~"));
- ret.append(QString::fromAscii("\"/*")).append(metadataFilter.value().toString().
- replace(QString::fromAscii("\""), QString::fromAscii("\\\""))).append(QString::fromAscii("*/iw\""));
+ ret.append(QString::fromLatin1("=~"));
+ ret.append(QString::fromLatin1("\"/*")).append(metadataFilter.value().toString().
+ replace(QString::fromLatin1("\""), QString::fromLatin1("\\\""))).append(QString::fromLatin1("*/iw\""));
break;
case QGalleryFilter::RegExp:
- ret.append(QString::fromAscii("=~"));
- ret.append(QString::fromAscii("\"/")).append(metadataFilter.value().toString().
- replace(QString::fromAscii("\""), QString::fromAscii("\\\""))).append(QString::fromAscii("/i\""));
+ ret.append(QString::fromLatin1("=~"));
+ ret.append(QString::fromLatin1("\"/")).append(metadataFilter.value().toString().
+ replace(QString::fromLatin1("\""), QString::fromLatin1("\\\""))).append(QString::fromLatin1("/i\""));
break;
}
if (!inOr)