gnome-utils r7895 - in trunk/baobab: . src



Author: pborelli
Date: Thu May  1 13:02:41 2008
New Revision: 7895
URL: http://svn.gnome.org/viewvc/gnome-utils?rev=7895&view=rev

Log:
2008-05-01  Paolo Borelli  <pborelli katamail com>

	* src/baobab-utils.c:
	* src/baobab.c:
	* src/baobab.h:
	* src/callbacks.c:
	Rename "start_proc_on_location" to "baobab_scan_location" for
	consistency with the rest of the API and move the stop_scan method
	to the main baobab API.



Modified:
   trunk/baobab/ChangeLog
   trunk/baobab/src/baobab-utils.c
   trunk/baobab/src/baobab.c
   trunk/baobab/src/baobab.h
   trunk/baobab/src/callbacks.c

Modified: trunk/baobab/src/baobab-utils.c
==============================================================================
--- trunk/baobab/src/baobab-utils.c	(original)
+++ trunk/baobab/src/baobab-utils.c	Thu May  1 13:02:41 2008
@@ -81,7 +81,7 @@
 		gtk_widget_hide (chooser);
 
 		file = g_file_new_for_uri (filename);
-		start_proc_on_location (file);
+		baobab_scan_location (file);
 		g_free (filename);
 		g_object_unref (file);
 	}
@@ -182,20 +182,6 @@
 	set_glade_widget_sens ("ck_allocated",
 			       !scanning &&
 			       baobab.is_local && !g_noactivescans);
-
-}
-
-void
-stop_scan (void)
-{
-	set_statusbar (_("Calculating percentage bars..."));
-	gtk_tree_model_foreach (GTK_TREE_MODEL (baobab.model),
-				show_bars, NULL);
-	gtk_tree_view_columns_autosize (GTK_TREE_VIEW (baobab.tree_view));
-
-	set_busy (FALSE);
-	check_menu_sens (FALSE);
-	set_statusbar (_("Ready"));
 }
 
 gboolean

Modified: trunk/baobab/src/baobab.c
==============================================================================
--- trunk/baobab/src/baobab.c	(original)
+++ trunk/baobab/src/baobab.c	Thu May  1 13:02:41 2008
@@ -97,11 +97,8 @@
 	}
 }
 
-/*
- * start scanning on a specific directory
- */
 void
-start_proc_on_location (GFile *file)
+baobab_scan_location (GFile *file)
 {
 	GdkCursor *cursor = NULL;
 	GtkWidget *ck_allocated;
@@ -113,6 +110,8 @@
 	if (iterstack !=NULL)
 		return;
 
+	if (current_location)
+		g_object_unref (current_location);
 	current_location = g_object_ref (file);
 
 	dir = g_file_get_uri (file);
@@ -175,7 +174,7 @@
 	GFile *file;
 
 	file = g_file_new_for_path (g_get_home_dir ());
-	start_proc_on_location (file);
+	baobab_scan_location (file);
 	g_object_unref (file);
 }
 
@@ -185,7 +184,7 @@
 	GFile *file;
 
 	file = g_file_new_for_uri ("file:///");
-	start_proc_on_location (file);
+	baobab_scan_location (file);
 	g_object_unref (file);
 }
 
@@ -198,7 +197,22 @@
 	set_label_scan (&g_fs);
 	show_label ();
 
-	start_proc_on_location (current_location);
+	baobab_scan_location (current_location);
+}
+
+void
+baobab_stop_scan (void)
+{
+	baobab.STOP_SCANNING = TRUE;
+
+	set_statusbar (_("Calculating percentage bars..."));
+	gtk_tree_model_foreach (GTK_TREE_MODEL (baobab.model),
+				show_bars, NULL);
+	gtk_tree_view_columns_autosize (GTK_TREE_VIEW (baobab.tree_view));
+
+	set_busy (FALSE);
+	check_menu_sens (FALSE);
+	set_statusbar (_("Ready"));
 }
 
 /*
@@ -760,8 +774,8 @@
 static gboolean
 start_proc_on_command_line (GFile *file)
 {
-	start_proc_on_location (file);
-	
+	baobab_scan_location (file);
+
 	return FALSE;
 }
 

Modified: trunk/baobab/src/baobab.h
==============================================================================
--- trunk/baobab/src/baobab.h	(original)
+++ trunk/baobab/src/baobab.h	Thu May  1 13:02:41 2008
@@ -90,10 +90,11 @@
 baobab_fs g_fs;
 
 void set_busy (gboolean busy);
-void start_proc_on_location (GFile *);
+void baobab_scan_location (GFile *);
 void baobab_scan_home (void);
 void baobab_scan_root (void);
 void baobab_rescan_current_dir (void);
+void baobab_stop_scan (void);
 void fill_model (struct chan_data *);
 void first_row (void);
 gboolean baobab_is_excluded_dir (const gchar *);

Modified: trunk/baobab/src/callbacks.c
==============================================================================
--- trunk/baobab/src/callbacks.c	(original)
+++ trunk/baobab/src/callbacks.c	Thu May  1 13:02:41 2008
@@ -59,7 +59,7 @@
 void
 on_esci1_activate (GtkObject *menuitem, gpointer user_data)
 {
-	baobab.STOP_SCANNING = TRUE;
+	baobab_stop_scan ();
 	gtk_main_quit ();
 }
 
@@ -123,8 +123,7 @@
 void
 on_menu_stop_activate (GtkMenuItem *menuitem, gpointer user_data)
 {
-	baobab.STOP_SCANNING = TRUE;
-	stop_scan ();
+	baobab_stop_scan ();
 }
 
 void
@@ -171,7 +170,7 @@
 	if (uri) {
 		GFile *file;
 		file = g_file_new_for_uri (uri);
-		start_proc_on_location (file);
+		baobab_scan_location (file);
 		g_object_unref (file);
 		g_free (uri);
 	}
@@ -186,8 +185,7 @@
 void
 on_tbstop_clicked (GtkToolButton *toolbutton, gpointer user_data)
 {
-	baobab.STOP_SCANNING = TRUE;
-	stop_scan ();
+	baobab_stop_scan ();
 }
 
 void
@@ -420,7 +418,7 @@
 		message (_("The folder does not exist."), "", GTK_MESSAGE_INFO, baobab.window);
 	}
 
-	start_proc_on_location (file);
+	baobab_scan_location (file);
 	g_object_unref (file);
 }
 



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