diff options
Diffstat (limited to 'src/quick/util/qquickfontloader.cpp')
-rw-r--r-- | src/quick/util/qquickfontloader.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/quick/util/qquickfontloader.cpp b/src/quick/util/qquickfontloader.cpp index 991ea7b295..9972071408 100644 --- a/src/quick/util/qquickfontloader.cpp +++ b/src/quick/util/qquickfontloader.cpp @@ -28,8 +28,6 @@ QT_BEGIN_NAMESPACE -#define FONTLOADER_MAXIMUM_REDIRECT_RECURSION 16 - class QQuickFontObject : public QObject { Q_OBJECT @@ -44,7 +42,6 @@ Q_SIGNALS: void fontDownloaded(int id); private: - int redirectCount = 0; QNetworkReply *reply = nullptr; private Q_SLOTS: @@ -74,20 +71,6 @@ void QQuickFontObject::download(const QUrl &url, QNetworkAccessManager *manager) void QQuickFontObject::replyFinished() { if (reply) { - redirectCount++; - if (redirectCount < FONTLOADER_MAXIMUM_REDIRECT_RECURSION) { - QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); - if (redirect.isValid()) { - QUrl url = reply->url().resolved(redirect.toUrl()); - QNetworkAccessManager *manager = reply->manager(); - reply->deleteLater(); - reply = nullptr; - download(url, manager); - return; - } - } - redirectCount = 0; - if (!reply->error()) { id = QFontDatabase::addApplicationFontFromData(reply->readAll()); emit fontDownloaded(id); @@ -312,7 +295,7 @@ void QQuickFontLoader::updateFontInfo(int id) text: "Fancy font" font.family: webFont.font.family font.weight: webFont.font.weight - font.style: webFont.font.style + font.styleName: webFont.font.styleName font.pixelSize: 24 } } @@ -381,12 +364,11 @@ QString QQuickFontLoader::name() const \qmlproperty enumeration QtQuick::FontLoader::status This property holds the status of font loading. It can be one of: - \list - \li FontLoader.Null - no font has been set - \li FontLoader.Ready - the font has been loaded - \li FontLoader.Loading - the font is currently being loaded - \li FontLoader.Error - an error occurred while loading the font - \endlist + + \value FontLoader.Null no font has been set + \value FontLoader.Ready the font has been loaded + \value FontLoader.Loading the font is currently being loaded + \value FontLoader.Error an error occurred while loading the font Use this status to provide an update or respond to the status change in some way. For example, you could: |