summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorvald Natvig <slicer@users.sourceforge.net>2009-12-02 19:26:39 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-12-02 19:26:39 (GMT)
commit2eb96bf5b68cbdcc1ebd2616b0b9e5f0f77eb257 (patch)
tree4325cdf758d9f50e59d1e1e8b1e5d2006499a62a
parentc0d237b7aa6e0257e3c3eee7336deaed1cf68252 (diff)
downloadQt-2eb96bf5b68cbdcc1ebd2616b0b9e5f0f77eb257.zip
Qt-2eb96bf5b68cbdcc1ebd2616b0b9e5f0f77eb257.tar.gz
Qt-2eb96bf5b68cbdcc1ebd2616b0b9e5f0f77eb257.tar.bz2
Add data: URL handling to QTextDocument::loadResource
Merge-request: 1560 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
-rw-r--r--src/gui/text/qtextdocument.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 523dd18..3b0a979 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -61,6 +61,7 @@
#include <qapplication.h>
#include "qtextcontrol_p.h"
#include "private/qtextedit_p.h"
+#include "private/qdataurl_p.h"
#include "qtextdocument_p.h"
#include <private/qprinter_p.h>
@@ -1924,6 +1925,10 @@ QVariant QTextDocument::loadResource(int type, const QUrl &name)
}
#endif
+ // handle data: URLs
+ if (r.isNull() && name.scheme() == QLatin1String("data"))
+ r = qDecodeDataUrl(name).second;
+
// if resource was not loaded try to load it here
if (!doc && r.isNull() && name.isRelative()) {
QUrl currentURL = d->url;