61 |
61 |
62 QTHELP_AVAILABLE = True |
62 QTHELP_AVAILABLE = True |
63 except ImportError: |
63 except ImportError: |
64 QTHELP_AVAILABLE = False |
64 QTHELP_AVAILABLE = False |
65 |
65 |
66 from eric7 import Globals, Preferences, Utilities |
66 from eric7 import EricUtilities, Preferences, Utilities |
67 from eric7.__version__ import Version |
67 from eric7.__version__ import Version |
68 from eric7.EricGui import EricPixmapCache |
68 from eric7.EricGui import EricPixmapCache |
69 from eric7.EricGui.EricAction import EricAction |
69 from eric7.EricGui.EricAction import EricAction |
70 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor |
70 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor |
71 from eric7.EricNetwork.EricNetworkIcon import EricNetworkIcon |
71 from eric7.EricNetwork.EricNetworkIcon import EricNetworkIcon |
535 @param enable flag indicating to enabled icon storage |
535 @param enable flag indicating to enabled icon storage |
536 @type bool |
536 @type bool |
537 """ |
537 """ |
538 if enable: |
538 if enable: |
539 iconDatabasePath = os.path.join( |
539 iconDatabasePath = os.path.join( |
540 Globals.getConfigDir(), "web_browser", "favicons" |
540 EricUtilities.getConfigDir(), "web_browser", "favicons" |
541 ) |
541 ) |
542 if not os.path.exists(iconDatabasePath): |
542 if not os.path.exists(iconDatabasePath): |
543 os.makedirs(iconDatabasePath) |
543 os.makedirs(iconDatabasePath) |
544 else: |
544 else: |
545 iconDatabasePath = "" # setting an empty path disables it |
545 iconDatabasePath = "" # setting an empty path disables it |
2903 linkName = link |
2903 linkName = link |
2904 |
2904 |
2905 applPath = os.path.join(getConfig("ericDir"), "eric7_browser.py") |
2905 applPath = os.path.join(getConfig("ericDir"), "eric7_browser.py") |
2906 args = [] |
2906 args = [] |
2907 args.append(applPath) |
2907 args.append(applPath) |
2908 args.append("--config={0}".format(Globals.getConfigDir())) |
2908 args.append("--config={0}".format(EricUtilities.getConfigDir())) |
2909 if self.__settingsDir: |
2909 if self.__settingsDir: |
2910 args.append("--settings={0}".format(self.__settingsDir)) |
2910 args.append("--settings={0}".format(self.__settingsDir)) |
2911 args.append("--private") |
2911 args.append("--private") |
2912 if linkName: |
2912 if linkName: |
2913 args.append(linkName) |
2913 args.append(linkName) |
3842 Class method to determine the name of the QtHelp collection file. |
3842 Class method to determine the name of the QtHelp collection file. |
3843 |
3843 |
3844 @return path of the QtHelp collection file |
3844 @return path of the QtHelp collection file |
3845 @rtype str |
3845 @rtype str |
3846 """ |
3846 """ |
3847 qthelpDir = os.path.join(Globals.getConfigDir(), "qthelp") |
3847 qthelpDir = os.path.join(EricUtilities.getConfigDir(), "qthelp") |
3848 if not os.path.exists(qthelpDir): |
3848 if not os.path.exists(qthelpDir): |
3849 os.makedirs(qthelpDir) |
3849 os.makedirs(qthelpDir) |
3850 return os.path.join(qthelpDir, "eric7help.qhc") |
3850 return os.path.join(qthelpDir, "eric7help.qhc") |
3851 |
3851 |
3852 @classmethod |
3852 @classmethod |
5397 ) |
5397 ) |
5398 cls._webProfile.setHttpCacheMaximumSize( |
5398 cls._webProfile.setHttpCacheMaximumSize( |
5399 Preferences.getWebBrowser("DiskCacheSize") * 1024 * 1024 |
5399 Preferences.getWebBrowser("DiskCacheSize") * 1024 * 1024 |
5400 ) |
5400 ) |
5401 cls._webProfile.setCachePath( |
5401 cls._webProfile.setCachePath( |
5402 os.path.join(Globals.getConfigDir(), "web_browser") |
5402 os.path.join(EricUtilities.getConfigDir(), "web_browser") |
5403 ) |
5403 ) |
5404 else: |
5404 else: |
5405 cls._webProfile.setHttpCacheType( |
5405 cls._webProfile.setHttpCacheType( |
5406 QWebEngineProfile.HttpCacheType.MemoryHttpCache |
5406 QWebEngineProfile.HttpCacheType.MemoryHttpCache |
5407 ) |
5407 ) |
5408 cls._webProfile.setHttpCacheMaximumSize(0) |
5408 cls._webProfile.setHttpCacheMaximumSize(0) |
5409 cls._webProfile.setPersistentStoragePath( |
5409 cls._webProfile.setPersistentStoragePath( |
5410 os.path.join( |
5410 os.path.join( |
5411 Globals.getConfigDir(), "web_browser", "persistentstorage" |
5411 EricUtilities.getConfigDir(), "web_browser", "persistentstorage" |
5412 ) |
5412 ) |
5413 ) |
5413 ) |
5414 cls._webProfile.setPersistentCookiesPolicy( |
5414 cls._webProfile.setPersistentCookiesPolicy( |
5415 QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies |
5415 QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies |
5416 ) |
5416 ) |