[latexila] Add timestamp parameter to latexila_utils_show_uri()



commit 255eee2b969e87838218a848f4d337e78307fe00
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jan 1 12:14:23 2015 +0100

    Add timestamp parameter to latexila_utils_show_uri()
    
    The timestamp is probably needed for synctex to function properly.

 src/file_browser.vala                 |    2 +-
 src/liblatexila/latexila-build-tool.c |    1 +
 src/liblatexila/latexila-utils.c      |    6 ++++--
 src/liblatexila/latexila-utils.h      |    1 +
 src/structure.vala                    |    2 +-
 5 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/file_browser.vala b/src/file_browser.vala
index 56066c2..b63acdd 100644
--- a/src/file_browser.vala
+++ b/src/file_browser.vala
@@ -186,7 +186,7 @@ public class FileBrowser : Grid
 
             try
             {
-                Latexila.utils_show_uri (this.get_screen (), file.get_uri ());
+                Latexila.utils_show_uri (this.get_screen (), file.get_uri (), Gdk.CURRENT_TIME);
             }
             catch (Error e)
             {
diff --git a/src/liblatexila/latexila-build-tool.c b/src/liblatexila/latexila-build-tool.c
index 6da8ca4..dc6d53b 100644
--- a/src/liblatexila/latexila-build-tool.c
+++ b/src/liblatexila/latexila-build-tool.c
@@ -560,6 +560,7 @@ query_exists_cb (GFile        *file,
 
   latexila_utils_show_uri (gtk_widget_get_screen (GTK_WIDGET (data->build_view)),
                            uri,
+                           GDK_CURRENT_TIME,
                            &error);
 
   if (error != NULL)
diff --git a/src/liblatexila/latexila-utils.c b/src/liblatexila/latexila-utils.c
index 2f5de66..3cbc524 100644
--- a/src/liblatexila/latexila-utils.c
+++ b/src/liblatexila/latexila-utils.c
@@ -305,7 +305,8 @@ default_document_viewer_is_evince (const gchar *uri)
 /**
  * latexila_utils_show_uri:
  * @screen: (nullable): a #GdkScreen, or %NULL.
- * @uri: the URI to show
+ * @uri: the URI to show.
+ * @timestamp: a timestamp.
  * @error: (out) (optional): a %NULL #GError, or %NULL.
  *
  * Shows the @uri. If the URI is a PDF file and if Evince is the default
@@ -315,12 +316,13 @@ default_document_viewer_is_evince (const gchar *uri)
 void
 latexila_utils_show_uri (GdkScreen    *screen,
                          const gchar  *uri,
+                         guint32       timestamp,
                          GError      **error)
 {
   g_return_if_fail (uri != NULL);
   g_return_if_fail (error == NULL || *error == NULL);
 
-  if (gtk_show_uri (screen, uri, GDK_CURRENT_TIME, error))
+  if (gtk_show_uri (screen, uri, timestamp, error))
     {
       gchar *extension = latexila_utils_get_extension (uri);
 
diff --git a/src/liblatexila/latexila-utils.h b/src/liblatexila/latexila-utils.h
index 9d58327..99bcf1f 100644
--- a/src/liblatexila/latexila-utils.h
+++ b/src/liblatexila/latexila-utils.h
@@ -49,6 +49,7 @@ gboolean        latexila_utils_file_query_exists_finish         (GFile        *f
 
 void            latexila_utils_show_uri                         (GdkScreen    *screen,
                                                                  const gchar  *uri,
+                                                                 guint32       timestamp,
                                                                  GError      **error);
 
 G_END_DECLS
diff --git a/src/structure.vala b/src/structure.vala
index 4c4d446..a95256e 100644
--- a/src/structure.vala
+++ b/src/structure.vala
@@ -713,7 +713,7 @@ public class Structure : Grid
     {
         try
         {
-            Latexila.utils_show_uri (get_screen (), referenced_file.get_uri ());
+            Latexila.utils_show_uri (get_screen (), referenced_file.get_uri (), Gdk.CURRENT_TIME);
         }
         catch (Error e)
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]