[nautilus] application: pass in the array length while looping over it



commit a5a4bddf12ff29205757858af81fd3665a68c3f2
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue May 31 10:59:26 2011 -0400

    application: pass in the array length while looping over it

 src/nautilus-application.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 6cce364..fc8a3d3 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -752,6 +752,7 @@ open_window (NautilusApplication *application,
 static void
 open_windows (NautilusApplication *application,
 	      GFile **files,
+	      gint n_files,
 	      GdkScreen *screen,
 	      const char *geometry)
 {
@@ -762,7 +763,7 @@ open_windows (NautilusApplication *application,
 		open_window (application, NULL, screen, geometry);
 	} else {
 		/* Open windows at each requested location. */
-		for (i = 0; files[i] != NULL; i++) {
+		for (i = 0; i < n_files; i++) {
 			open_window (application, files[i], screen, geometry);
 		}
 	}
@@ -778,7 +779,7 @@ nautilus_application_open (GApplication *app,
 
 	DEBUG ("Open called on the GApplication instance; %d files", n_files);
 
-	open_windows (self, files,
+	open_windows (self, files, n_files,
 		      gdk_screen_get_default (),
 		      self->priv->geometry);
 }



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