summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2011-10-13 19:56:28 +0200
committerQt by Nokia <qt-info@nokia.com>2012-03-30 01:19:59 +0200
commit74d2dba46041448c70dbd3049ae2a8277770baf6 (patch)
treeb7745d6387b86768b85a5e772dd654cb91412aa8 /src/gui/text
parent8cf66c3bc4482bbefad90ce7ad34ac6c3de8478f (diff)
Port to the new QUrl API
The use of any broken-down components of the query now needs QUrlQuery. The QUrl constructor and toString() are now rehabilitated and the preferred forms. Use toEncoded() and fromEncoded() now only when we need to store data in a QByteArray or the data comes from a QByteArray anyway. Change to toString() or the constructor if the data was in a QString. Change-Id: I9d761a628bef9c70185a48e927a61779a1642342 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextimagehandler.cpp4
-rw-r--r--src/gui/text/qtextodfwriter.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qtextimagehandler.cpp b/src/gui/text/qtextimagehandler.cpp
index abd283e459..6804dba95c 100644
--- a/src/gui/text/qtextimagehandler.cpp
+++ b/src/gui/text/qtextimagehandler.cpp
@@ -59,7 +59,7 @@ static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format)
QString name = format.name();
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources
name.prepend(QLatin1String("qrc"));
- QUrl url = QUrl::fromEncoded(name.toUtf8());
+ QUrl url = QUrl(name);
const QVariant data = doc->resource(QTextDocument::ImageResource, url);
if (data.type() == QVariant::Pixmap || data.type() == QVariant::Image) {
pm = qvariant_cast<QPixmap>(data);
@@ -134,7 +134,7 @@ static QImage getImage(QTextDocument *doc, const QTextImageFormat &format)
QString name = format.name();
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources
name.prepend(QLatin1String("qrc"));
- QUrl url = QUrl::fromEncoded(name.toUtf8());
+ QUrl url = QUrl(name);
const QVariant data = doc->resource(QTextDocument::ImageResource, url);
if (data.type() == QVariant::Image) {
image = qvariant_cast<QImage>(data);
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index 80adeb602c..c03805b95f 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -366,7 +366,7 @@ void QTextOdfWriter::writeInlineCharacter(QXmlStreamWriter &writer, const QTextF
QString name = imageFormat.name();
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources
name.prepend(QLatin1String("qrc"));
- QUrl url = QUrl::fromEncoded(name.toUtf8());
+ QUrl url = QUrl(name);
const QVariant data = m_document->resource(QTextDocument::ImageResource, url);
if (data.type() == QVariant::Image) {
image = qvariant_cast<QImage>(data);