file-roller r2331 - in trunk: . src



Author: paobac
Date: Thu Jun 19 17:57:58 2008
New Revision: 2331
URL: http://svn.gnome.org/viewvc/file-roller?rev=2331&view=rev

Log:
2008-06-19  Paolo Bacchilega  <paobac svn gnome org>

	* src/fr-window.c (action_performed): do not reload the archive if
	an error occurs when adding files in batch mode.
	(fr_window_stop_activity_mode): do not allow the activity_ref counter
	to be negative.
		
	* src/file-utils.c (uri_is_filetype, dir_is_empty)
	(dir_contains_one_object, get_dir_content_if_unique): check for file
	existance before anythink else.

Modified:
   trunk/ChangeLog
   trunk/src/file-utils.c
   trunk/src/fr-window.c

Modified: trunk/src/file-utils.c
==============================================================================
--- trunk/src/file-utils.c	(original)
+++ trunk/src/file-utils.c	Thu Jun 19 17:57:58 2008
@@ -79,6 +79,12 @@
 	GError    *error = NULL;
 	
 	file = g_file_new_for_uri (uri);
+	
+	if (! g_file_query_exists (file, NULL)) {
+		g_object_unref (file);
+		return FALSE;
+	}
+	
 	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE, 0, NULL, &error);
 	if (error == NULL) {
 		result = (g_file_info_get_file_type (info) == file_type);
@@ -139,6 +145,12 @@
 	int              n = 0;
 
 	file = g_file_new_for_uri (uri);
+	
+	if (! g_file_query_exists (file, NULL)) {
+		g_object_unref (file);
+		return TRUE;
+	}
+	
 	file_enum = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &error);
 	if (error != NULL) {
 		g_warning ("Failed to enumerate children of %s: %s", uri, error->message);
@@ -175,6 +187,12 @@
 	int              n = 0;
 
 	file = g_file_new_for_uri (uri);
+	
+	if (! g_file_query_exists (file, NULL)) {
+		g_object_unref (file);
+		return FALSE;
+	}
+	
 	file_enum = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &err);
 	if (err != NULL) {
 		g_warning ("Failed to enumerate children of %s: %s", uri, err->message);
@@ -223,6 +241,12 @@
 	char            *content_uri = NULL;
 	
 	file = g_file_new_for_uri (uri);
+	
+	if (! g_file_query_exists (file, NULL)) {
+		g_object_unref (file);
+		return NULL;
+	}
+	
 	file_enum = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &err);
 	if (err != NULL) {
 		g_warning ("Failed to enumerate children of %s: %s", uri, err->message);

Modified: trunk/src/fr-window.c
==============================================================================
--- trunk/src/fr-window.c	(original)
+++ trunk/src/fr-window.c	Thu Jun 19 17:57:58 2008
@@ -3035,13 +3035,11 @@
 
 	case FR_ACTION_ADDING_FILES:
 		close_progress_dialog (window, FALSE);
-		if (error->type != FR_PROC_ERROR_NONE) {
-			fr_window_archive_reload (window);
-			return;
+		if (error->type == FR_PROC_ERROR_NONE) {
+			if (window->priv->archive_new) 
+				window->priv->archive_new = FALSE;
+			fr_window_add_to_recent_list (window, window->priv->archive_uri);
 		}
-		if (window->priv->archive_new) 
-			window->priv->archive_new = FALSE;
-		fr_window_add_to_recent_list (window, window->priv->archive_uri);
 		if (! window->priv->batch_mode) {
 			fr_window_archive_reload (window);
 			return;
@@ -3062,7 +3060,6 @@
 			}
 			break;
 		}
-
 		if (window->priv->convert_data.converting) {
 			char *source_dir;
 			
@@ -3086,15 +3083,6 @@
 			else
 				close_progress_dialog (window, FALSE);
 		}
-		/*
-		else if (window->priv->view_folder_after_extraction) {
-			if (window->priv->batch_mode) {
-				g_usleep (G_USEC_PER_SEC);
-				view_extraction_destination_folder (window);
-			}
-			else
-				g_timeout_add (500, view_extraction_destination_folder, window);
-		}*/
 		break;
 
 	default:
@@ -6718,7 +6706,12 @@
 {
 	g_return_if_fail (window != NULL);
 
-	if (--window->priv->activity_ref > 0)
+	if (window->priv->activity_ref == 0)
+		return;
+
+	window->priv->activity_ref--;
+
+	if (window->priv->activity_ref > 0)
 		return;
 
 	if (window->priv->activity_timeout_handle == 0)



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