[file-roller: 11/123] removed the cancellable attribute from the archive



commit e7ea78a81ede4b6785cedf586c341df8290bd1c3
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Jul 18 10:18:41 2012 +0200

    removed the cancellable attribute from the archive
    
    it was useless

 src/fr-archive.c |   20 +++-----------------
 src/fr-archive.h |    3 +--
 src/fr-command.c |    6 +++++-
 3 files changed, 9 insertions(+), 20 deletions(-)
---
diff --git a/src/fr-archive.c b/src/fr-archive.c
index 75bda3b..ce5c0fa 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -71,7 +71,6 @@ struct _FrArchivePrivate {
 
 	/* internal */
 
-	GCancellable  *cancellable;
 	gboolean       creating_archive;
 	char          *extraction_destination;
 	gboolean       have_write_permissions;     /* true if we have the
@@ -231,7 +230,6 @@ fr_archive_finalize (GObject *object)
 	archive = FR_ARCHIVE (object);
 
 	_fr_archive_set_uri (archive, NULL);
-	g_object_unref (archive->priv->cancellable);
 
 	/* Chain up */
 
@@ -289,7 +287,6 @@ fr_archive_class_init (FrArchiveClass *klass)
 	gobject_class->set_property = fr_archive_set_property;
 	gobject_class->get_property = fr_archive_get_property;
 
-	klass->start = NULL;
 	klass->progress = NULL;
 	klass->message = NULL;
 	klass->stoppable = NULL;
@@ -368,6 +365,7 @@ fr_archive_class_init (FrArchiveClass *klass)
 			      fr_marshal_VOID__INT,
 			      G_TYPE_NONE,
 			      1, G_TYPE_INT);
+
 	fr_archive_signals[PROGRESS] =
 		g_signal_new ("progress",
 			      G_TYPE_FROM_CLASS (klass),
@@ -440,7 +438,6 @@ fr_archive_init (FrArchive *self)
         self->propListFromFile = FALSE;
 
 	self->priv->file = NULL;
-	self->priv->cancellable = g_cancellable_new ();
 	self->priv->creating_archive = FALSE;
 	self->priv->extraction_destination = NULL;
 	self->priv->have_write_permissions = FALSE;
@@ -809,9 +806,6 @@ fr_archive_open (GFile               *file,
         					   open_data,
                                                    (GDestroyNotify) load_data_free);
 
-        /* FIXME: libarchive
-         fr_archive_action_started (archive, FR_ACTION_LOADING_ARCHIVE); */
-
         /* load a few bytes to guess the archive type */
 
 	g_file_read_async (open_data->file,
@@ -856,7 +850,6 @@ fr_archive_load (FrArchive           *archive,
 		archive->files = g_ptr_array_sized_new (FILE_ARRAY_INITIAL_SIZE);
 	}
 
-	fr_archive_action_started (archive, FR_ACTION_LISTING_CONTENT);
 	FR_ARCHIVE_GET_CLASS (archive)->load (archive, password, cancellable, callback, user_data);
 }
 
@@ -1620,18 +1613,11 @@ fr_archive_change_name (FrArchive  *archive,
 }
 
 
-GCancellable *
-fr_archive_get_cancellable (FrArchive *self)
-{
-	return self->priv->cancellable;
-}
-
-
 void
-fr_archive_action_started (FrArchive *self,
+fr_archive_action_started (FrArchive *archive,
 			   FrAction   action)
 {
-	g_signal_emit (self,
+	g_signal_emit (archive,
 		       fr_archive_signals[START],
 		       0,
 		       action);
diff --git a/src/fr-archive.h b/src/fr-archive.h
index 98781f5..5cb799b 100644
--- a/src/fr-archive.h
+++ b/src/fr-archive.h
@@ -490,9 +490,8 @@ void          fr_archive_set_multi_volume        (FrArchive           *archive,
 					          GFile               *file);
 void          fr_archive_change_name             (FrArchive           *archive,
 						  const char          *filename);
-GCancellable *fr_archive_get_cancellable         (FrArchive           *archive);
 void          fr_archive_action_started          (FrArchive           *archive,
-						  FrAction             action);
+                                                  FrAction             action);
 void          fr_archive_progress                (FrArchive           *archive,
 						  double               fraction);
 void          fr_archive_message                 (FrArchive           *archive,
diff --git a/src/fr-command.c b/src/fr-command.c
index dbca513..8ff27f9 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -1087,6 +1087,7 @@ _fr_command_add (FrCommand      *self,
 		 gboolean        encrypt_header,
 		 FrCompression   compression,
 		 guint           volume_size,
+		 GCancellable   *cancellable,
 		 GError        **error)
 {
 	FrArchive *archive = FR_ARCHIVE (self);
@@ -1155,7 +1156,7 @@ _fr_command_add (FrCommand      *self,
 		return FALSE;
 	}
 
-	self->creating_archive = ! g_file_query_exists (self->priv->local_copy, fr_archive_get_cancellable (FR_ARCHIVE (self)));
+	self->creating_archive = ! g_file_query_exists (self->priv->local_copy, cancellable);
 
 	/* create the new archive in a temporary sub-directory, this allows
 	 * to cancel the operation without losing the original archive and
@@ -1422,6 +1423,7 @@ _fr_command_add_local_files (FrCommand           *self,
 			       encrypt_header,
 			       compression,
 			       volume_size,
+			       cancellable,
 			       &error))
 	{
 		if (error != NULL) {
@@ -2877,6 +2879,7 @@ fr_command_paste_clipboard (FrArchive           *archive,
 			       encrypt_header,
 			       compression,
 			       volume_size,
+			       cancellable,
 			       &error))
 	{
 		GSimpleAsyncResult *result;
@@ -3214,6 +3217,7 @@ fr_command_update_open_files (FrArchive           *archive,
 				 encrypt_header,
 				 compression,
 				 volume_size,
+				 cancellable,
 				 NULL);
 
 		g_list_free (local_file_list);



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