Remove change_title signal in QWebPage.

When emitting it inside acceptNaviationRequest we don't know if javascript will
open a new window, so we could end up setting the title for the *wrong*
(current) tab.

It seems there isn't any good solution to this problem - in
QWebView.createWindow we won't know what the URL is - so we currently just
leave it blank.
This commit is contained in:
Florian Bruhin 2014-09-25 17:33:44 +02:00
parent 5b7ee5d382
commit f294e28fca
2 changed files with 0 additions and 4 deletions

View File

@ -44,11 +44,9 @@ class BrowserPage(QWebPage):
Signals:
start_download: Emitted when a file should be downloaded.
change_title: Emitted when the title should be changed.
"""
start_download = pyqtSignal('QNetworkReply*')
change_title = pyqtSignal(str)
def __init__(self, parent=None):
super().__init__(parent)
@ -305,5 +303,4 @@ class BrowserPage(QWebPage):
objreg.get('tabbed-browser').tabopen(url, True)
return False
else:
self.change_title.emit(urlstr)
return True

View File

@ -102,7 +102,6 @@ class WebView(QWebView):
objreg.register('tab-{}'.format(tab_id), self.registry, scope='meta')
page.linkHovered.connect(self.linkHovered)
page.mainFrame().loadStarted.connect(self.on_load_started)
page.change_title.connect(self.titleChanged)
self.urlChanged.connect(self.on_url_changed)
page.mainFrame().loadFinished.connect(self.on_load_finished)
self.loadProgress.connect(lambda p: setattr(self, 'progress', p))