Changeset View
Changeset View
Standalone View
Standalone View
webenginepart/src/settings/webenginesettings.cpp
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | 72 | public: | |||
---|---|---|---|---|---|
126 | QStringList fonts; | 126 | QStringList fonts; | ||
127 | QStringList defaultFonts; | 127 | QStringList defaultFonts; | ||
128 | 128 | | |||
129 | KDEPrivate::FilterSet adBlackList; | 129 | KDEPrivate::FilterSet adBlackList; | ||
130 | KDEPrivate::FilterSet adWhiteList; | 130 | KDEPrivate::FilterSet adWhiteList; | ||
131 | QList< QPair< QString, QChar > > m_fallbackAccessKeysAssignments; | 131 | QList< QPair< QString, QChar > > m_fallbackAccessKeysAssignments; | ||
132 | 132 | | |||
133 | KSharedConfig::Ptr nonPasswordStorableSites; | 133 | KSharedConfig::Ptr nonPasswordStorableSites; | ||
134 | bool m_internalPdfViewer; | ||||
134 | }; | 135 | }; | ||
135 | 136 | | |||
136 | class WebEngineSettingsPrivate : public QObject, public WebEngineSettingsData | 137 | class WebEngineSettingsPrivate : public QObject, public WebEngineSettingsData | ||
137 | { | 138 | { | ||
138 | Q_OBJECT | 139 | Q_OBJECT | ||
139 | public: | 140 | public: | ||
140 | void adblockFilterLoadList(const QString& filename) | 141 | void adblockFilterLoadList(const QString& filename) | ||
141 | { | 142 | { | ||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | 293 | { | |||
293 | return d->m_underlineLink; | 294 | return d->m_underlineLink; | ||
294 | } | 295 | } | ||
295 | 296 | | |||
296 | bool WebEngineSettings::hoverLink() const | 297 | bool WebEngineSettings::hoverLink() const | ||
297 | { | 298 | { | ||
298 | return d->m_hoverLink; | 299 | return d->m_hoverLink; | ||
299 | } | 300 | } | ||
300 | 301 | | |||
302 | bool WebEngineSettings::internalPdfViewer() const | ||||
303 | { | ||||
304 | return d->m_internalPdfViewer; | ||||
305 | } | ||||
306 | | ||||
301 | void WebEngineSettings::init() | 307 | void WebEngineSettings::init() | ||
302 | { | 308 | { | ||
303 | initWebEngineSettings(); | 309 | initWebEngineSettings(); | ||
304 | 310 | | |||
305 | KConfig global( QStringLiteral("khtmlrc"), KConfig::NoGlobals ); | 311 | KConfig global( QStringLiteral("khtmlrc"), KConfig::NoGlobals ); | ||
306 | init( &global, true ); | 312 | init( &global, true ); | ||
307 | 313 | | |||
308 | KSharedConfig::Ptr local = KSharedConfig::openConfig(); | 314 | KSharedConfig::Ptr local = KSharedConfig::openConfig(); | ||
▲ Show 20 Lines • Show All 171 Lines • ▼ Show 20 Line(s) | 403 | { | |||
480 | 486 | | |||
481 | if (cgHtml.readEntry("UserStyleSheetEnabled", false)) { | 487 | if (cgHtml.readEntry("UserStyleSheetEnabled", false)) { | ||
482 | if (reset || cgHtml.hasKey("UserStyleSheet")) | 488 | if (reset || cgHtml.hasKey("UserStyleSheet")) | ||
483 | d->m_userSheet = cgHtml.readEntry("UserStyleSheet", QString()); | 489 | d->m_userSheet = cgHtml.readEntry("UserStyleSheet", QString()); | ||
484 | } else { | 490 | } else { | ||
485 | d->m_userSheet.clear(); | 491 | d->m_userSheet.clear(); | ||
486 | } | 492 | } | ||
487 | 493 | | |||
494 | if (reset || cgHtml.hasKey("InternalPdfViewer")) { | ||||
495 | d->m_internalPdfViewer = cgHtml.readEntry("InternalPdfViewer", false); | ||||
496 | } | ||||
497 | | ||||
488 | d->m_formCompletionEnabled = cgHtml.readEntry("FormCompletion", true); | 498 | d->m_formCompletionEnabled = cgHtml.readEntry("FormCompletion", true); | ||
489 | d->m_maxFormCompletionItems = cgHtml.readEntry("MaxFormCompletionItems", 10); | 499 | d->m_maxFormCompletionItems = cgHtml.readEntry("MaxFormCompletionItems", 10); | ||
490 | d->m_autoDelayedActionsEnabled = cgHtml.readEntry ("AutoDelayedActions", true); | 500 | d->m_autoDelayedActionsEnabled = cgHtml.readEntry ("AutoDelayedActions", true); | ||
491 | d->m_jsErrorsEnabled = cgHtml.readEntry("ReportJSErrors", true); | 501 | d->m_jsErrorsEnabled = cgHtml.readEntry("ReportJSErrors", true); | ||
492 | const QStringList accesskeys = cgHtml.readEntry("FallbackAccessKeysAssignments", QStringList()); | 502 | const QStringList accesskeys = cgHtml.readEntry("FallbackAccessKeysAssignments", QStringList()); | ||
493 | d->m_fallbackAccessKeysAssignments.clear(); | 503 | d->m_fallbackAccessKeysAssignments.clear(); | ||
494 | for( QStringList::ConstIterator it = accesskeys.begin(); it != accesskeys.end(); ++it ) | 504 | for( QStringList::ConstIterator it = accesskeys.begin(); it != accesskeys.end(); ++it ) | ||
495 | if( (*it).length() > 2 && (*it)[ 1 ] == ':' ) | 505 | if( (*it).length() > 2 && (*it)[ 1 ] == ':' ) | ||
▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Line(s) | |||||
701 | // QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::WebGLEnabled, d->m_enableWebGL); | 711 | // QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::WebGLEnabled, d->m_enableWebGL); | ||
702 | // Turn on HTML 5 local and offline storage capabilities... | 712 | // Turn on HTML 5 local and offline storage capabilities... | ||
703 | // QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::OfflineStorageDatabaseEnabled, d->m_enableOfflineStorageDb); | 713 | // QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::OfflineStorageDatabaseEnabled, d->m_enableOfflineStorageDb); | ||
704 | // QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::OfflineWebApplicationCacheEnabled, d->m_enableOfflineWebAppCache); | 714 | // QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::OfflineWebApplicationCacheEnabled, d->m_enableOfflineWebAppCache); | ||
705 | QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, d->m_enableLocalStorage); | 715 | QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, d->m_enableLocalStorage); | ||
706 | 716 | | |||
707 | QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::ScrollAnimatorEnabled, smoothScrolling() != KSmoothScrollingDisabled); | 717 | QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::ScrollAnimatorEnabled, smoothScrolling() != KSmoothScrollingDisabled); | ||
708 | 718 | | |||
719 | #ifdef WEBENGINE_PDF_VIEWER | ||||
720 | QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::PdfViewerEnabled, internalPdfViewer()); | ||||
721 | #endif | ||||
722 | | ||||
709 | // These numbers should be calculated from real "logical" DPI/72, using a default dpi of 96 for now | 723 | // These numbers should be calculated from real "logical" DPI/72, using a default dpi of 96 for now | ||
710 | computeFontSizes(96); | 724 | computeFontSizes(96); | ||
711 | } | 725 | } | ||
712 | 726 | | |||
713 | 727 | | |||
714 | void WebEngineSettings::computeFontSizes( int logicalDpi ) | 728 | void WebEngineSettings::computeFontSizes( int logicalDpi ) | ||
715 | { | 729 | { | ||
716 | if (zoomToDPI()) | 730 | if (zoomToDPI()) | ||
▲ Show 20 Lines • Show All 556 Lines • Show Last 20 Lines |