[Libreoffice-commits] core.git: libreofficekit/qa

Michael Stahl mstahl at redhat.com
Mon Mar 6 15:44:25 UTC 2017


 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 45dd570ac474c336cceac1ca2792f243ee125fa2
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Mar 6 13:13:52 2017 +0100

    libreofficekit: GTK 3.22 deprecates gtk_show_uri
    
    Avoid -Werror=deprecated-declaration and use
    gtk_show_uri_on_window instead, which needs a GtkWindow.
    
    Change-Id: Ia77978348809c8d88cb2823a1549cbdeffcc6c97
    Reviewed-on: https://gerrit.libreoffice.org/34926
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 0ad1c2e..ed1d7f1 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -1525,10 +1525,17 @@ static void signalPart(LOKDocView* pLOKDocView, int nPart, gpointer /*pData*/)
 }
 
 /// User clicked on a command button -> inform LOKDocView.
-static void signalHyperlink(LOKDocView* /*pLOKDocView*/, char* pPayload, gpointer /*pData*/)
+static void signalHyperlink(LOKDocView* pLOKDocView, char* pPayload, gpointer /*pData*/)
 {
     GError* pError = nullptr;
+#if GTK_CHECK_VERSION(3,22,0)
+    gtk_show_uri_on_window(
+            GTK_WINDOW (gtk_widget_get_toplevel(GTK_WIDGET(pLOKDocView))),
+            pPayload, GDK_CURRENT_TIME, &pError);
+#else
+    (void) pLOKDocView;
     gtk_show_uri(nullptr, pPayload, GDK_CURRENT_TIME, &pError);
+#endif
     if (pError != nullptr)
     {
         g_warning("Unable to show URI %s : %s", pPayload, pError->message);


More information about the Libreoffice-commits mailing list