mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2025-01-01 12:26:13 +00:00
Moved Browser Cache and Storage inside config folder
Now it's easier to locate the folder on all OSs, you'll need to re-login If your cache is corrupted now you can manually clear it in the QtWebEngine folder in the config folder
This commit is contained in:
parent
f43313f681
commit
91329c1020
|
@ -36,6 +36,7 @@ class LoginWindow(QDialog):
|
||||||
self.webview = QWebEngineView()
|
self.webview = QWebEngineView()
|
||||||
profile = QWebEngineProfile(self.webview)
|
profile = QWebEngineProfile(self.webview)
|
||||||
profile.setPersistentCookiesPolicy(QWebEngineProfile.NoPersistentCookies)
|
profile.setPersistentCookiesPolicy(QWebEngineProfile.NoPersistentCookies)
|
||||||
|
profile.setPersistentStoragePath(str(configFolder / "QtWebEngine" / "Storage" / "OffTheRecord"))
|
||||||
self.page = self.CustomPage(profile, self.webview)
|
self.page = self.CustomPage(profile, self.webview)
|
||||||
self.page.loadFinished.connect(self.checkURL)
|
self.page.loadFinished.connect(self.checkURL)
|
||||||
self.webview.setPage(self.page)
|
self.webview.setPage(self.page)
|
||||||
|
@ -62,8 +63,8 @@ class MainWindow(QMainWindow):
|
||||||
appLogin_trigger = pyqtSignal()
|
appLogin_trigger = pyqtSignal()
|
||||||
|
|
||||||
class MainWebpage(QWebEnginePage):
|
class MainWebpage(QWebEnginePage):
|
||||||
def __init__(self, parent):
|
def __init__(self, profile, parent):
|
||||||
super().__init__(parent)
|
super().__init__(profile, parent)
|
||||||
actions = [
|
actions = [
|
||||||
QWebEnginePage.Back,
|
QWebEnginePage.Back,
|
||||||
QWebEnginePage.Forward,
|
QWebEnginePage.Forward,
|
||||||
|
@ -113,7 +114,10 @@ class MainWindow(QMainWindow):
|
||||||
self.setWindowIcon(QIcon(str(appDir / 'icon.ico')))
|
self.setWindowIcon(QIcon(str(appDir / 'icon.ico')))
|
||||||
self.setMinimumSize(800, 600)
|
self.setMinimumSize(800, 600)
|
||||||
self.webview = QWebEngineView()
|
self.webview = QWebEngineView()
|
||||||
self.page = self.MainWebpage(self.webview)
|
self.profile = QWebEngineProfile("Default", self.webview)
|
||||||
|
self.profile.setCachePath(str(configFolder / "QtWebEngine" / "Cache" / "Default"))
|
||||||
|
self.profile.setPersistentStoragePath(str(configFolder / "QtWebEngine" / "Storage" / "Default"))
|
||||||
|
self.page = self.MainWebpage(self.profile, self.webview)
|
||||||
self.page.loadFinished.connect(self.finishLoading)
|
self.page.loadFinished.connect(self.finishLoading)
|
||||||
self.webview.setPage(self.page)
|
self.webview.setPage(self.page)
|
||||||
self.setCentralWidget(self.webview)
|
self.setCentralWidget(self.webview)
|
||||||
|
@ -170,6 +174,7 @@ class MainWindow(QMainWindow):
|
||||||
h = -1
|
h = -1
|
||||||
with open(configFolder / '.UIposition', 'w') as f:
|
with open(configFolder / '.UIposition', 'w') as f:
|
||||||
f.write("|".join([str(x),str(y),str(w),str(h)]))
|
f.write("|".join([str(x),str(y),str(w),str(h)]))
|
||||||
|
self.page.deleteLater()
|
||||||
event.accept()
|
event.accept()
|
||||||
|
|
||||||
def finishLoading(self, ok):
|
def finishLoading(self, ok):
|
||||||
|
@ -227,6 +232,7 @@ if __name__ == '__main__':
|
||||||
app = QApplication([])
|
app = QApplication([])
|
||||||
configFolder = portable or getConfigFolder()
|
configFolder = portable or getConfigFolder()
|
||||||
x,y,w,h = get_position()
|
x,y,w,h = get_position()
|
||||||
|
makedirs(configFolder / "QtWebEngine", exist_ok=True)
|
||||||
window = MainWindow('deemix', 'http://'+url+':'+str(port), x,y,w,h)
|
window = MainWindow('deemix', 'http://'+url+':'+str(port), x,y,w,h)
|
||||||
t = Thread(target=run_server, args=(url, port, portable, window))
|
t = Thread(target=run_server, args=(url, port, portable, window))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue