[gnome-builder/wip/gtk4-port] libide/webkit: implement reload w/ bypass for page
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/webkit: implement reload w/ bypass for page
- Date: Fri, 3 Jun 2022 22:57:11 +0000 (UTC)
commit 1bde2d52d7b8e55a76949833548fde911bfaf733
Author: Christian Hergert <chergert redhat com>
Date: Fri Jun 3 15:56:46 2022 -0700
libide/webkit: implement reload w/ bypass for page
src/libide/webkit/ide-webkit-page.c | 26 ++++++++++++++++++++++++++
src/libide/webkit/ide-webkit-page.h | 22 +++++++++++++---------
2 files changed, 39 insertions(+), 9 deletions(-)
---
diff --git a/src/libide/webkit/ide-webkit-page.c b/src/libide/webkit/ide-webkit-page.c
index b49d665a9..0179e9e68 100644
--- a/src/libide/webkit/ide-webkit-page.c
+++ b/src/libide/webkit/ide-webkit-page.c
@@ -480,3 +480,29 @@ ide_webkit_page_go_forward (IdeWebkitPage *self)
IDE_EXIT;
}
+
+void
+ide_webkit_page_reload (IdeWebkitPage *self)
+{
+ IdeWebkitPagePrivate *priv = ide_webkit_page_get_instance_private (self);
+
+ g_return_if_fail (IDE_IS_WEBKIT_PAGE (self));
+
+ if (webkit_web_view_is_loading (priv->web_view))
+ webkit_web_view_stop_loading (priv->web_view);
+
+ webkit_web_view_reload (priv->web_view);
+}
+
+void
+ide_webkit_page_reload_ignoring_cache (IdeWebkitPage *self)
+{
+ IdeWebkitPagePrivate *priv = ide_webkit_page_get_instance_private (self);
+
+ g_return_if_fail (IDE_IS_WEBKIT_PAGE (self));
+
+ if (webkit_web_view_is_loading (priv->web_view))
+ webkit_web_view_stop_loading (priv->web_view);
+
+ webkit_web_view_reload_bypass_cache (priv->web_view);
+}
diff --git a/src/libide/webkit/ide-webkit-page.h b/src/libide/webkit/ide-webkit-page.h
index 0e73c86ff..0608b4ae3 100644
--- a/src/libide/webkit/ide-webkit-page.h
+++ b/src/libide/webkit/ide-webkit-page.h
@@ -35,20 +35,24 @@ struct _IdeWebkitPageClass
};
IDE_AVAILABLE_IN_ALL
-IdeWebkitPage *ide_webkit_page_new (void);
+IdeWebkitPage *ide_webkit_page_new (void);
IDE_AVAILABLE_IN_ALL
-void ide_webkit_page_load_uri (IdeWebkitPage *self,
- const char *uri);
+void ide_webkit_page_load_uri (IdeWebkitPage *self,
+ const char *uri);
IDE_AVAILABLE_IN_ALL
-gboolean ide_webkit_page_focus_address (IdeWebkitPage *self);
+gboolean ide_webkit_page_focus_address (IdeWebkitPage *self);
IDE_AVAILABLE_IN_ALL
-gboolean ide_webkit_page_get_show_toolbar (IdeWebkitPage *self);
+gboolean ide_webkit_page_get_show_toolbar (IdeWebkitPage *self);
IDE_AVAILABLE_IN_ALL
-void ide_webkit_page_set_show_toolbar (IdeWebkitPage *self,
- gboolean show_toolbar);
+void ide_webkit_page_set_show_toolbar (IdeWebkitPage *self,
+ gboolean show_toolbar);
IDE_AVAILABLE_IN_ALL
-void ide_webkit_page_go_back (IdeWebkitPage *self);
+void ide_webkit_page_go_back (IdeWebkitPage *self);
IDE_AVAILABLE_IN_ALL
-void ide_webkit_page_go_forward (IdeWebkitPage *self);
+void ide_webkit_page_go_forward (IdeWebkitPage *self);
+IDE_AVAILABLE_IN_ALL
+void ide_webkit_page_reload (IdeWebkitPage *self);
+IDE_AVAILABLE_IN_ALL
+void ide_webkit_page_reload_ignoring_cache (IdeWebkitPage *self);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]