forked from jeena/FeedTheMonkey
first attempt for cache
This commit is contained in:
parent
c798e60300
commit
b7dbf29713
1 changed files with 7 additions and 1 deletions
|
@ -7,6 +7,7 @@ except:
|
|||
|
||||
import sys, os, json, tempfile, urllib, json
|
||||
from PyQt4 import QtGui, QtCore, QtWebKit, QtNetwork
|
||||
from PyQt4.QtNetwork import *
|
||||
from threading import Thread
|
||||
from sys import platform as _platform
|
||||
|
||||
|
@ -228,6 +229,11 @@ class Content(QtGui.QWidget):
|
|||
self.wb.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
|
||||
self.wb.linkClicked.connect(lambda url: self.openLink(url))
|
||||
|
||||
diskCache = QNetworkDiskCache()
|
||||
diskCache.setCacheDirectory("/tmp/feedmonkey")
|
||||
diskCache.setMaximumCacheSize(5*124*124)
|
||||
self.wb.page().networkAccessManager().setCache(diskCache)
|
||||
|
||||
self.setLayout(QtGui.QVBoxLayout(spacing=0))
|
||||
self.layout().setContentsMargins(0, 0, 0, 0)
|
||||
self.layout().addWidget(self.wb)
|
||||
|
@ -561,4 +567,4 @@ if __name__ == "__main__":
|
|||
app = QtGui.QApplication(sys.argv)
|
||||
wb = MainWindow()
|
||||
wb.show()
|
||||
sys.exit(app.exec_())
|
||||
sys.exit(app.exec_())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue