[Goodies-commits] r3187 - in ristretto/trunk: . src

Stephan Arts stephan at xfce.org
Sat Sep 8 16:05:26 CEST 2007


Author: stephan
Date: 2007-09-08 14:05:26 +0000 (Sat, 08 Sep 2007)
New Revision: 3187

Modified:
   ristretto/trunk/ristretto.desktop.in
   ristretto/trunk/src/main.c
Log:

Improve .desktop file (fix max's bug)
Allow ristretto to open multiple files from the cli



Modified: ristretto/trunk/ristretto.desktop.in
===================================================================
--- ristretto/trunk/ristretto.desktop.in	2007-09-08 13:56:05 UTC (rev 3186)
+++ ristretto/trunk/ristretto.desktop.in	2007-09-08 14:05:26 UTC (rev 3187)
@@ -4,7 +4,7 @@
 _Name=Ristretto Image Viewer
 _Comment=Xfce Image viewer
 _GenericName=Image Viewer
-Exec=ristretto
+Exec=ristretto %F
 Icon=ristretto
 Terminal=false
 Type=Application

Modified: ristretto/trunk/src/main.c
===================================================================
--- ristretto/trunk/src/main.c	2007-09-08 13:56:05 UTC (rev 3186)
+++ ristretto/trunk/src/main.c	2007-09-08 14:05:26 UTC (rev 3187)
@@ -113,6 +113,7 @@
 {
     ThunarVfsPath *path = NULL;
     GtkWidget *viewer = NULL;
+    gint n = 1;
 
 
     #ifdef ENABLE_NLS
@@ -156,10 +157,10 @@
     g_signal_connect(G_OBJECT(navigator), "iter-changed", G_CALLBACK(cb_rstto_nav_file_changed), window);
 
 
-    if(argc == 2)
-        path = thunar_vfs_path_new(argv[1], NULL);
-    if (path)
+    for (n = 1; n < argc; ++n)
     {
+        path = thunar_vfs_path_new(argv[n], NULL);
+
         ThunarVfsInfo *info = thunar_vfs_info_new_for_path(path, NULL);
         if(info)
         {
@@ -170,11 +171,11 @@
             }
             else
             {
-                GDir *dir = g_dir_open(argv[1], 0, NULL);
+                GDir *dir = g_dir_open(argv[n], 0, NULL);
                 const gchar *filename = g_dir_read_name(dir);
                 while (filename)
                 {
-                    gchar *path_name = g_strconcat(argv[1],  "/", filename, NULL);
+                    gchar *path_name = g_strconcat(argv[n],  "/", filename, NULL);
                     ThunarVfsPath *file_path = thunar_vfs_path_new(path_name, NULL);
                     if (file_path)
                     {




More information about the Goodies-commits mailing list