summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorrootavish <[email protected]>2016-05-14 12:19:24 -0700
committerrootavish <[email protected]>2016-05-17 10:04:04 -0700
commitf9b37020767638898f0cd0d036f864fe40b2ec92 (patch)
tree15dfe26dbc6ab2830493048c12f9370a91d9fcaf /shell
parente9ff838f4de64653799c8a8b79610ad073e8a52c (diff)
downloadatril-f9b37020767638898f0cd0d036f864fe40b2ec92.tar.bz2
atril-f9b37020767638898f0cd0d036f864fe40b2ec92.tar.xz
Remove the check for a parent, more intuitive conditions
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-window.c8
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);