diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-10-22 19:50:52 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-10-22 20:34:20 +0200 |
commit | 57f1983c164bc8553c6b6aa7ac320f00e5405548 (patch) | |
tree | 6cfbec33f6e385ceb5cbfa0168f4a9f27f0c8e57 /src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp | |
parent | 5baebfc68dd67def412bcbaa7c61b43d05e6ee42 (diff) | |
download | qt4-tools-57f1983c164bc8553c6b6aa7ac320f00e5405548.tar.gz |
Updated WebKit from /home/jturcott/dev/webkit/ to qtwebkit-4.6-snapshot-22102009 ( 0639bb8e812c8923287cd5523248ca64fa5f7a50 )
Changes in WebKit/qt since the last update:
Jocelyn: fatal error from script, sha1 in src/3rdparty/webkit/VERSION is bad
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp | 70 |
1 files changed, 65 insertions, 5 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp index eedf7d1571..ffa21e4fad 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp @@ -62,6 +62,8 @@ public: QString localStoragePath; QString offlineWebApplicationCachePath; qint64 offlineStorageDefaultQuota; + float printingMinimumShrinkFactor; + float printingMaximumShrinkFactor; void apply(); WebCore::Settings* settings; @@ -174,6 +176,12 @@ void QWebSettingsPrivate::apply() QString storagePath = !localStoragePath.isEmpty() ? localStoragePath : global->localStoragePath; settings->setLocalStorageDatabasePath(storagePath); + float minimumShrinkFactor = printingMinimumShrinkFactor > 0.0f ? printingMinimumShrinkFactor : global->printingMinimumShrinkFactor; + settings->setPrintingMinimumShrinkFactor(minimumShrinkFactor); + + float maximumShrinkFactor = printingMaximumShrinkFactor > 0.0f ? printingMaximumShrinkFactor : global->printingMaximumShrinkFactor; + settings->setPrintingMaximumShrinkFactor(maximumShrinkFactor); + value = attributes.value(QWebSettings::ZoomTextOnly, global->attributes.value(QWebSettings::ZoomTextOnly)); settings->setZoomsTextOnly(value); @@ -377,6 +385,9 @@ QWebSettings::QWebSettings() d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, false); d->attributes.insert(QWebSettings::SessionStorageEnabled, true); d->offlineStorageDefaultQuota = 5 * 1024 * 1024; + d->defaultTextEncoding = QLatin1String("iso-8859-1"); + d->printingMinimumShrinkFactor = 0.0f; + d->printingMaximumShrinkFactor = 0.0f; } /*! @@ -491,6 +502,60 @@ QString QWebSettings::defaultTextEncoding() const } /*! + \since 4.7 + Specifies minimum shrink fator allowed for printing. If set to 0 a + default value is used. + + When printing, content will be shrunk to reduce page usage, it + will reduced by a factor between printingMinimumShrinkFactor and + printingMaximumShrinkFactor. + + \sa printingMinimumShrinkFactor() + \sa setPrintingMaximumShrinkFactor() + \sa printingMaximumShrinkFactor() +*/ +void QWebSettings::setPrintingMinimumShrinkFactor(float printingMinimumShrinkFactor) +{ + d->printingMinimumShrinkFactor = printingMinimumShrinkFactor; + d->apply(); +} + +/*! + \since 4.7 + returns the minimum shrink factor used for printing. + + \sa setPrintingMinimumShrinkFactor() +*/ +float QWebSettings::printingMinimumShrinkFactor() const +{ + return d->printingMinimumShrinkFactor; +} + +/*! + \since 4.7 + Specifies maximum shrink fator allowed for printing. If set to 0 a + default value is used. + + \sa setPrintingMinimumShrinkFactor() +*/ +void QWebSettings::setPrintingMaximumShrinkFactor(float printingMaximumShrinkFactor) +{ + d->printingMaximumShrinkFactor = printingMaximumShrinkFactor; + d->apply(); +} + +/*! + \since 4.7 + returns the maximum shrink factor used for printing. + + \sa setPrintingMinimumShrinkFactor() +*/ +float QWebSettings::printingMaximumShrinkFactor() const +{ + return d->printingMaximumShrinkFactor; +} + +/*! Sets the path of the icon database to \a path. The icon database is used to store "favicons" associated with web sites. @@ -628,11 +693,6 @@ void QWebSettings::clearMemoryCaches() // Invalidating the font cache and freeing all inactive font data. WebCore::fontCache()->invalidate(); -#if ENABLE(OFFLINE_WEB_APPLICATIONS) - // Empty the application cache. - WebCore::cacheStorage().empty(); -#endif - // Empty the Cross-Origin Preflight cache WebCore::CrossOriginPreflightResultCache::shared().empty(); } |