diff options
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 eedf7d1..ffa21e4 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(); } |