diff options
author | rootavish <[email protected]> | 2016-05-14 12:19:24 -0700 |
---|---|---|
committer | rootavish <[email protected]> | 2016-05-17 10:04:04 -0700 |
commit | f9b37020767638898f0cd0d036f864fe40b2ec92 (patch) | |
tree | 15dfe26dbc6ab2830493048c12f9370a91d9fcaf | |
parent | e9ff838f4de64653799c8a8b79610ad073e8a52c (diff) | |
download | atril-f9b37020767638898f0cd0d036f864fe40b2ec92.tar.bz2 atril-f9b37020767638898f0cd0d036f864fe40b2ec92.tar.xz |
Remove the check for a parent, more intuitive conditions
-rw-r--r-- | shell/ev-window.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c index 3053c03e..8a4553e4 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -1579,22 +1579,22 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document) ev_window_warning_message (ev_window, "%s", _("The document contains only empty pages")); } + #if ENABLE_EPUB - GtkWidget *parent= gtk_widget_get_parent(ev_window->priv->webview); if (document->iswebdocument == TRUE && - parent == NULL ) + ev_window->priv->view != NULL) { /*We have encountered a web document, replace the atril view with a web view, if the web view is not already loaded.*/ gtk_container_remove (GTK_CONTAINER(ev_window->priv->scrolled_window), ev_window->priv->view); ev_view_disconnect_handlers(EV_VIEW(ev_window->priv->view)); - g_object_unref(ev_window->priv->view); + g_object_unref(ev_window->priv->view); ev_window->priv->view = NULL; gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window), ev_window->priv->webview); gtk_widget_show(ev_window->priv->webview); } - else { + else if(ev_window->priv->webview != NULL && document->iswebdocument == FALSE) { /*Since the document is not a webdocument might as well get rid of the webview now*/ ev_web_view_disconnect_handlers(EV_WEB_VIEW(ev_window->priv->webview)); g_object_ref_sink(ev_window->priv->webview); |