remove signal-blocking variable, instead just connect to signal when ready

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett 2012-03-01 16:44:31 +00:00
parent 4c9bde5ec0
commit 7cf17ea27b
2 changed files with 4 additions and 11 deletions

View File

@ -115,10 +115,6 @@ public:
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler);
virtual wxVector<wxSharedPtr<wxWebViewHandler> > GetHandlers() { return m_handlerList; }
/** FIXME: hack to work around signals being received too early */
bool m_ready;
/** TODO: check if this can be made private
* The native control has a getter to check for busy state, but except in
* very recent versions of webkit this getter doesn't say everything we need

View File

@ -32,8 +32,6 @@ wxgtk_webview_webkit_load_status(GtkWidget* widget,
GParamSpec*,
wxWebViewWebKit *webKitCtrl)
{
if (!webKitCtrl->m_ready) return;
wxString url = webKitCtrl->GetCurrentURL();
WebKitLoadStatus status;
@ -395,7 +393,6 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
long style,
const wxString& name)
{
m_ready = false;
m_busy = false;
m_guard = false;
@ -414,9 +411,6 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
gtk_container_add(GTK_CONTAINER(m_widget), GTK_WIDGET(m_web_view));
gtk_widget_show(GTK_WIDGET(m_web_view));
g_signal_connect_after(m_web_view, "notify::load-status",
G_CALLBACK(wxgtk_webview_webkit_load_status),
this);
g_signal_connect_after(m_web_view, "navigation-policy-decision-requested",
G_CALLBACK(wxgtk_webview_webkit_navigation),
this);
@ -445,7 +439,10 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
history = webkit_web_view_get_back_forward_list(m_web_view);
m_historyLimit = webkit_web_back_forward_list_get_limit(history);
m_ready = true;
// last to avoid getting signal too early
g_signal_connect_after(m_web_view, "notify::load-status",
G_CALLBACK(wxgtk_webview_webkit_load_status),
this);
return true;
}