[Xfce4-commits] <thunar:master> Don't open a useless tab (bug #9519).

Nick Schermer noreply at xfce.org
Sun Dec 2 21:34:02 CET 2012


Updating branch refs/heads/master
         to f41318058de59d5645db0a524ec3d7740782e2dd (commit)
       from 7e317eb0b6036698a0bb2e36ac16776647f14726 (commit)

commit f41318058de59d5645db0a524ec3d7740782e2dd
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Dec 2 20:33:54 2012 +0100

    Don't open a useless tab (bug #9519).

 thunar/thunar-session-client.c |    7 +++++--
 thunar/thunar-window.c         |    4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/thunar/thunar-session-client.c b/thunar/thunar-session-client.c
index 46a944d..5bbc8d3 100644
--- a/thunar/thunar-session-client.c
+++ b/thunar/thunar-session-client.c
@@ -299,7 +299,6 @@ thunar_session_client_restore (ThunarSessionClient *session_client)
 
       /* determine the URI for the new window */
       uris = xfce_rc_read_list_entry (rc, "URI", ";");
-      g_message ("%d uris", uris ? g_strv_length (uris) : 0);
       if (G_UNLIKELY (uris == NULL))
         continue;
 
@@ -400,7 +399,11 @@ thunar_session_client_save_yourself (SmcConn              connection,
                   fprintf (fp, "PAGE=%d\n", active_page);
                   fprintf (fp, "URI=");
                   for (n = 0; uris[n] != NULL; n++)
-                    fprintf (fp, "%s;", uris[n]);
+                    {
+                      fprintf (fp, "%s", uris[n]);
+                      if (G_LIKELY (uris[n + 1] != NULL))
+                        fprintf (fp, ";");
+                    }
                   fprintf (fp, "\n\n");
 
                   /* cleanup */
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 2e3c6f1..defdb3d 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -3645,6 +3645,10 @@ thunar_window_set_directories (ThunarWindow   *window,
 
   for (n = 0; uris[n] != NULL; n++)
     {
+      /* check if the string looks like an uri */
+      if (!exo_str_looks_like_an_uri (uris[n]))
+        continue;
+
       /* get the file for the uri */
       directory = thunar_file_get_for_uri (uris[n], NULL);
       if (G_UNLIKELY (directory == NULL))


More information about the Xfce4-commits mailing list