Commit a4116259 authored by Vlad Seryakov's avatar Vlad Seryakov Committed by Orgad Shaneh

OS X: Avoid multiple slotLoadFinished calls

Seems like Web delegate is not consistent enough, we need to keep track
ourselves.

Change-Id: Icff1f6b5a642df73eb2e80dd74baf44257e3e28e
Reviewed-by: default avatarVlad Seryakov <vseryakov@gmail.com>
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent d57a261e
......@@ -201,6 +201,7 @@ static void ensureProtocolHandler()
{
WebFrame *mainFrame;
Help::Internal::MacWebKitHelpViewer *viewer;
bool finished;
}
- (id)initWithMainFrame:(WebFrame *)frame viewer:(Help::Internal::MacWebKitHelpViewer *)viewer;
......@@ -220,6 +221,7 @@ static void ensureProtocolHandler()
if (self) {
mainFrame = frame;
viewer = helpViewer;
finished = false;
}
return self;
}
......@@ -227,8 +229,10 @@ static void ensureProtocolHandler()
- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
{
Q_UNUSED(sender)
if (frame == mainFrame)
if (frame == mainFrame) {
finished = false;
viewer->slotLoadStarted();
}
}
- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame
......@@ -242,23 +246,29 @@ static void ensureProtocolHandler()
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
Q_UNUSED(sender)
if (frame == mainFrame)
if (frame == mainFrame && !finished) {
finished = true;
viewer->slotLoadFinished();
}
}
- (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
{
Q_UNUSED(sender)
Q_UNUSED(error)
if (frame == mainFrame)
if (frame == mainFrame && !finished) {
finished = true;
viewer->slotLoadFinished();
}
}
- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
{
Q_UNUSED(error)
if (frame == mainFrame)
if (frame == mainFrame && !finished) {
finished = true;
viewer->slotLoadFinished();
}
}
@end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment