2753 self.__tabWidget.preferencesChanged() |
2753 self.__tabWidget.preferencesChanged() |
2754 |
2754 |
2755 self.searchEdit.preferencesChanged() |
2755 self.searchEdit.preferencesChanged() |
2756 |
2756 |
2757 if not self.isPrivate(): |
2757 if not self.isPrivate(): |
2758 # TODO: Cache settings |
2758 profile = self.webProfile() |
2759 pass |
2759 if Preferences.getWebBrowser("DiskCacheEnabled"): |
|
2760 profile.setHttpCacheType(QWebEngineProfile.DiskHttpCache) |
|
2761 profile.setHttpCacheMaximumSize( |
|
2762 Preferences.getWebBrowser("DiskCacheSize") * 1024 * 1024) |
|
2763 else: |
|
2764 profile.setHttpCacheType(QWebEngineProfile.MemoryHttpCache) |
|
2765 profile.setHttpCacheMaximumSize(0) |
2760 |
2766 |
2761 self.__virusTotal.preferencesChanged() |
2767 self.__virusTotal.preferencesChanged() |
2762 if not Preferences.getWebBrowser("VirusTotalEnabled") or \ |
2768 if not Preferences.getWebBrowser("VirusTotalEnabled") or \ |
2763 Preferences.getWebBrowser("VirusTotalServiceKey") == "": |
2769 Preferences.getWebBrowser("VirusTotalServiceKey") == "": |
2764 self.virustotalScanCurrentAct.setEnabled(False) |
2770 self.virustotalScanCurrentAct.setEnabled(False) |
3248 passwords, databases, downloads, flashCookies, zoomValues, |
3254 passwords, databases, downloads, flashCookies, zoomValues, |
3249 historyPeriod) = dlg.getData() |
3255 historyPeriod) = dlg.getData() |
3250 if history: |
3256 if history: |
3251 self.historyManager().clear(historyPeriod) |
3257 self.historyManager().clear(historyPeriod) |
3252 self.__tabWidget.clearClosedTabsList() |
3258 self.__tabWidget.clearClosedTabsList() |
|
3259 self.webProfile().clearAllVisitedLinks() |
3253 if searches: |
3260 if searches: |
3254 self.searchEdit.clear() |
3261 self.searchEdit.clear() |
3255 if downloads: |
3262 if downloads: |
3256 self.downloadManager().cleanup() |
3263 self.downloadManager().cleanup() |
3257 self.downloadManager().hide() |
3264 self.downloadManager().hide() |
4067 else: |
4074 else: |
4068 cls._webProfile = QWebEngineProfile.defaultProfile() |
4075 cls._webProfile = QWebEngineProfile.defaultProfile() |
4069 cls._webProfile.downloadRequested.connect( |
4076 cls._webProfile.downloadRequested.connect( |
4070 cls.downloadRequested) |
4077 cls.downloadRequested) |
4071 |
4078 |
4072 # TODO: Cache settings |
4079 # add the default user agent string |
|
4080 userAgent = cls._webProfile.httpUserAgent() |
|
4081 cls._webProfile.defaultUserAgent = userAgent |
|
4082 |
|
4083 if not private: |
|
4084 if Preferences.getWebBrowser("DiskCacheEnabled"): |
|
4085 cls._webProfile.setHttpCacheType( |
|
4086 QWebEngineProfile.DiskHttpCache) |
|
4087 cls._webProfile.setHttpCacheMaximumSize( |
|
4088 Preferences.getWebBrowser("DiskCacheSize") |
|
4089 * 1024 * 1024) |
|
4090 cls._webProfile.setCachePath(os.path.join( |
|
4091 Utilities.getConfigDir(), "web_browser")) |
|
4092 else: |
|
4093 cls._webProfile.setHttpCacheType( |
|
4094 QWebEngineProfile.MemoryHttpCache) |
|
4095 cls._webProfile.setHttpCacheMaximumSize(0) |
|
4096 cls._webProfile.setPersistentStoragePath(os.path.join( |
|
4097 Utilities.getConfigDir(), "web_browser", |
|
4098 "persistentstorage")) |
|
4099 cls._webProfile.setPersistentCookiesPolicy( |
|
4100 QWebEngineProfile.AllowPersistentCookies) |
4073 |
4101 |
4074 # Setup QWebChannel user script |
4102 # Setup QWebChannel user script |
4075 script = QWebEngineScript() |
4103 script = QWebEngineScript() |
4076 script.setName("_eric_webchannel") |
4104 script.setName("_eric_webchannel") |
4077 script.setInjectionPoint(QWebEngineScript.DocumentCreation) |
4105 script.setInjectionPoint(QWebEngineScript.DocumentCreation) |