[Xfce4-commits] r23295 - in xarchiver/branches/xarchiver-psybsd: libxarchiver src

Stephan Arts stephan at xfce.org
Thu Oct 5 22:27:01 UTC 2006


Author: stephan
Date: 2006-10-05 22:27:00 +0000 (Thu, 05 Oct 2006)
New Revision: 23295

Modified:
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.h
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
   xarchiver/branches/xarchiver-psybsd/src/archive_store.c
   xarchiver/branches/xarchiver-psybsd/src/archive_store.h
   xarchiver/branches/xarchiver-psybsd/src/main_window.c
Log:
Applied patch from Peter de Ridder <pc.ridder at zonnet.nl>

- Implemented archive-store
- removed assert
- added view-options to zip support object

- reduced memory usage



Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c	2006-10-05 21:28:56 UTC (rev 23294)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c	2006-10-05 22:27:00 UTC (rev 23295)
@@ -94,6 +94,7 @@
 void
 lxa_archive_support_gnu_tar_init(LXAArchiveSupportGnuTar *support)
 {
+	/* TODO: free return value of g_find_program_in_path */
 	LXAArchiveSupport *archive_support = LXA_ARCHIVE_SUPPORT(support);
 
 	archive_support->id = "Gnu Tar";
@@ -105,7 +106,6 @@
 
 	lxa_archive_support_add_mime(archive_support, "application/x-tar");
 	/* Check for existence of compress -- required for x-tarz */
-	/* TODO: free return value of g_find_program_in_path */
 	if(g_find_program_in_path("compress"))
 		lxa_archive_support_add_mime(archive_support, "application/x-tarz");
 	/* Check for existence of gzip -- required for x-compressed-tar*/
@@ -195,8 +195,13 @@
 {
 	LXAArchiveSupportGnuTar *support;
 
-	support = g_object_new(LXA_TYPE_ARCHIVE_SUPPORT_GNU_TAR, "view-time", TRUE, "view-date", TRUE, "view-owner", TRUE, "view-rights", TRUE, "view-size", TRUE, NULL);
-	/* support = g_object_new(LXA_TYPE_ARCHIVE_SUPPORT_GNU_TAR, NULL); */
+	support = g_object_new(LXA_TYPE_ARCHIVE_SUPPORT_GNU_TAR, 
+	                       "view-time", TRUE, 
+												 "view-date", TRUE,
+												 "view-owner", TRUE,
+												 "view-rights", TRUE,
+												 "view-size", TRUE,
+												 NULL);
 
 	return LXA_ARCHIVE_SUPPORT(support);
 }
@@ -460,7 +465,6 @@
 	lxa_execute(command, archive, NULL, NULL, lxa_archive_support_gnu_tar_compress_parse_output, NULL);
 }
 
-/* TODO: fix g_value stuff */
 gboolean
 lxa_archive_support_gnu_tar_refresh_parse_output(GIOChannel *ioc, GIOCondition cond, gpointer data)
 {
@@ -545,18 +549,14 @@
 				props_iter += sizeof(gchar *);
 			}
 
-			/* g_value_init(&props[5], G_TYPE_STRING);*/
-
 			gchar *temp = g_strrstr (&line[n],"->"); 
 			if (temp ) 
 			{ 
 				temp_filename = g_strstrip(g_strndup(&line[n], strlen(line) - strlen(temp) - n )); 
-				/*g_value_set_string (&props[5], g_strstrip(g_strndup (&temp[3] , strlen(temp))) ); */
 			} 
 			else 
 			{ 
 				temp_filename = g_strstrip(g_strndup(&line[n], strlen(line)-n-1)); 
-				/*g_value_set_string (&props[5], g_strdup(" ") ); */
 			} 
  
 			entry = lxa_archive_add_file(archive, temp_filename);
@@ -727,6 +727,7 @@
 			g_value_set_uint(value, LXA_ARCHIVE_SUPPORT_GNU_TAR(object)->_extr_strip);
 			break;
 
+/* */
 		case LXA_ARCHIVE_SUPPORT_GNU_TAR_VIEW_SIZE:
 			g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_GNU_TAR(object)->_view_size);
 			break;

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.h	2006-10-05 21:28:56 UTC (rev 23294)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.h	2006-10-05 22:27:00 UTC (rev 23295)
@@ -20,7 +20,6 @@
 
 G_BEGIN_DECLS
 
-
 #define LXA_TYPE_ARCHIVE_SUPPORT_GNU_TAR lxa_archive_support_gnu_tar_get_type()
 
 #define LXA_ARCHIVE_SUPPORT_GNU_TAR(obj)         ( \
@@ -51,6 +50,7 @@
 	gboolean _extr_touch;
 	guint    _extr_strip;
 
+/* Optional properties */
 	gboolean _view_size;
 	gboolean _view_date;
 	gboolean _view_time;

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c	2006-10-05 21:28:56 UTC (rev 23294)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c	2006-10-05 22:27:00 UTC (rev 23295)
@@ -33,6 +33,14 @@
 	LXA_ARCHIVE_SUPPORT_ZIP_EXTRACT_OVERWRITE = 1,
 	LXA_ARCHIVE_SUPPORT_ZIP_ADD_COMPRESSION_LEVEL,
 	LXA_ARCHIVE_SUPPORT_ZIP_PASSWORD,
+
+	LXA_ARCHIVE_SUPPORT_ZIP_VIEW_SIZE,
+	LXA_ARCHIVE_SUPPORT_ZIP_VIEW_DATE,
+	LXA_ARCHIVE_SUPPORT_ZIP_VIEW_TIME,
+	LXA_ARCHIVE_SUPPORT_ZIP_VIEW_RATIO,
+	LXA_ARCHIVE_SUPPORT_ZIP_VIEW_LENGTH,
+	LXA_ARCHIVE_SUPPORT_ZIP_VIEW_METHOD,
+	LXA_ARCHIVE_SUPPORT_ZIP_VIEW_CRC_32
 };
 
 void
@@ -215,6 +223,29 @@
 		case LXA_ARCHIVE_SUPPORT_ZIP_PASSWORD:
 			g_value_set_string (value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_extr_password);
 			break;
+
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_SIZE:
+			g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_size);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_DATE:
+			g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_date);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_TIME:
+			g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_time);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_RATIO:
+			g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_ratio);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_LENGTH:
+			g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_length);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_METHOD:
+			g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_method);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_CRC_32:
+			g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_crc_32);
+			break;
+
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(object,prop_id,pspec);
 			break;
@@ -232,6 +263,29 @@
 		case LXA_ARCHIVE_SUPPORT_ZIP_PASSWORD:
 			LXA_ARCHIVE_SUPPORT_ZIP(object)->_extr_password = (gchar *)g_value_get_string(value);
 			break;
+
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_SIZE:
+			LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_size = g_value_get_boolean(value);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_TIME:
+			LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_time = g_value_get_boolean(value);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_DATE:
+			LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_date = g_value_get_boolean(value);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_RATIO:
+			LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_ratio = g_value_get_boolean(value);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_LENGTH:
+			LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_length = g_value_get_boolean(value);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_METHOD:
+			LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_method = g_value_get_boolean(value);
+			break;
+		case LXA_ARCHIVE_SUPPORT_ZIP_VIEW_CRC_32:
+			LXA_ARCHIVE_SUPPORT_ZIP(object)->_view_crc_32 = g_value_get_boolean(value);
+			break;
+
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(object,prop_id,pspec);
 			break;

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h	2006-10-05 21:28:56 UTC (rev 23294)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h	2006-10-05 22:27:00 UTC (rev 23295)
@@ -48,6 +48,14 @@
 	LXAArchiveSupport parent;
 	gboolean  _extr_overwrite;
 	gchar    *_extr_password;
+
+	gboolean  _view_size;
+	gboolean  _view_time;
+	gboolean  _view_date;
+	gboolean  _view_ratio;
+	gboolean  _view_length;
+	gboolean  _view_method;
+	gboolean  _view_crc_32;
 };
 
 typedef struct _LXAArchiveSupportZipClass LXAArchiveSupportZipClass;

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-05 21:28:56 UTC (rev 23294)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-05 22:27:00 UTC (rev 23295)
@@ -387,7 +387,9 @@
 {
 	g_return_val_if_fail(entry, NULL);
 	lxa_entry_flush_buffer(entry);
-	g_return_val_if_fail(n >= 0 && n < entry->n_children, NULL);
-	return entry->children[n];
+	if(n >= 0 && n < entry->n_children)
+		return entry->children[n];
+	else
+		return NULL;
 }
 

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-10-05 21:28:56 UTC (rev 23294)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-10-05 22:27:00 UTC (rev 23295)
@@ -132,8 +132,6 @@
 	as->archive = NULL;
 	as->current_entry = NULL;
 	as->props._show_icons = FALSE;
-	as->n_columns = 0;
-	as->column_types = NULL;
 }
 
 static void
@@ -157,8 +155,12 @@
 	g_return_val_if_fail(XA_IS_ARCHIVE_STORE(tree_model), 0);
 
 	XAArchiveStore *store = XA_ARCHIVE_STORE(tree_model);
+	LXAArchive *archive = store->archive;
+
+	if(!archive)
+		return 0;
 	
-	return store->n_columns + store->props._show_icons?1:0;
+	return archive->column_number + store->props._show_icons?1:0;
 }
 
 static GType
@@ -167,7 +169,11 @@
 	g_return_val_if_fail(XA_IS_ARCHIVE_STORE(tree_model), G_TYPE_INVALID);	
 
 	XAArchiveStore *store = XA_ARCHIVE_STORE(tree_model);
+	LXAArchive *archive = store->archive;
 
+	if(!archive)
+		return G_TYPE_INVALID;
+
 	if(store->props._show_icons)
 	{
 		if(index == 0)
@@ -175,11 +181,9 @@
 		index--;
 	}
 
-	g_return_val_if_fail(index < store->n_columns, G_TYPE_INVALID);
+	g_return_val_if_fail(index < archive->column_number, G_TYPE_INVALID);
 
-	g_debug("xa_archive_store_get_column_type {%i} = %i", index, store->column_types[index]);
-
-	return store->column_types[index];
+	return archive->column_types[index];
 }
 
 static gboolean
@@ -227,8 +231,6 @@
 	iter->user_data2 = store->current_entry->data;
 	iter->user_data3 = GINT_TO_POINTER(index);
 
-	g_debug("xa_archive_store_get_iter {%i, %s}", index, entry->filename);
-
 	return TRUE;
 }
 
@@ -252,8 +254,6 @@
 	GtkTreePath *path = gtk_tree_path_new();
 	gtk_tree_path_append_index(path, pos);
 
-	g_debug("xa_archive_store_get_path = %i", pos);
-
 	return path;
 }
 
@@ -263,8 +263,6 @@
 static void 
 xa_archive_store_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value)
 {
-	g_debug("xa_archive_store_get_value (%i)", column);
-
 	g_return_if_fail (XA_IS_ARCHIVE_STORE (tree_model));
 
 	XAArchiveStore *store = XA_ARCHIVE_STORE(tree_model);
@@ -275,10 +273,10 @@
 	if(store->props._show_icons)
 		column--;
 
-	g_return_if_fail (column < store->n_columns);
+	g_return_if_fail (column < (gint)archive->column_number);
 
 	if(column >= 0)
-		g_value_init(value, store->column_types[column]);
+		g_value_init(value, archive->column_types[column]);
 
 	LXAEntry *entry = ((LXAEntry *)iter->user_data);
 	gpointer props_iter = entry->props;
@@ -295,6 +293,21 @@
 		{
 			g_value_set_string(value, "..");
 		}
+		else
+		{
+			switch(archive->column_types[column])
+			{
+				case G_TYPE_STRING:
+					g_value_set_string(value, "");
+					break;
+				case G_TYPE_UINT64:
+					g_value_set_uint64(value, 0);
+					break;
+				case G_TYPE_UINT:
+					g_value_set_uint(value, 0);
+					break;
+			}
+		}
 	}
 	else
 	{
@@ -311,7 +324,7 @@
 		{
 			for(;i<column;i++)
 			{
-				switch(store->column_types[i])
+				switch(archive->column_types[i])
 				{
 					case G_TYPE_STRING:
 						props_iter+=sizeof(gchar *);
@@ -324,7 +337,7 @@
 						break;
 				}
 			}
-			switch(store->column_types[column])
+			switch(archive->column_types[column])
 			{
 				case G_TYPE_STRING:
 					g_value_set_string(value, *(gchar **)props_iter);
@@ -360,15 +373,12 @@
 	iter->user_data = entry;
 	iter->user_data3 = GINT_TO_POINTER(pos);
 
-	g_debug("xa_archive_store_iter_next {%i, %s}", pos, entry->filename);
 	return TRUE;
 }
 
 static gboolean
 xa_archive_store_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent)
 {
-	g_debug("xa_archive_store_iter_children (%x)", parent);
-
 	g_return_val_if_fail(XA_IS_ARCHIVE_STORE(tree_model), FALSE);
 
 	XAArchiveStore *store = XA_ARCHIVE_STORE(tree_model);
@@ -424,7 +434,6 @@
 	/* only support lists: iter is always NULL */
 	g_return_val_if_fail(iter == NULL, FALSE);
 
-	g_debug("xa_archive_store_iter_n_children = %i", lxa_entry_children_length(entry) + (&archive->root_entry == entry)?0:1);
 	return lxa_entry_children_length(entry) + (&archive->root_entry == entry)?0:1;
 }
 
@@ -462,7 +471,6 @@
 	iter->user_data2 = store->current_entry->data;
 	iter->user_data3 = GINT_TO_POINTER(n);
 
-	g_debug("xa_archive_store_iter_nth_child {%i}", n);
 	return TRUE;
 }
 
@@ -539,7 +547,7 @@
 	gint index = indices[depth];
 	gint i = 0;
 	GtkTreePath *path_ = NULL;
-	GtkTreeIter *iter = NULL;
+	GtkTreeIter iter;
 
 	if(&archive->root_entry != entry)
 	{
@@ -568,44 +576,45 @@
 		path_ = gtk_tree_path_new();
 		gtk_tree_path_append_index(path_, 0);
 
-		iter = g_new(GtkTreeIter, 1);
+		iter.stamp = store->stamp;
+		iter.user_data = &store->up_entry;
+		iter.user_data2 = entry;
+		iter.user_data3 = GINT_TO_POINTER(-1);
 
-		iter->stamp = store->stamp;
-		iter->user_data = &store->up_entry;
-		iter->user_data2 = entry;
-		iter->user_data3 = GINT_TO_POINTER(-1);
-
 		if(0 < prev_size)
-			gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path, iter);
+			gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path_, &iter);
 		else
-			gtk_tree_model_row_inserted(GTK_TREE_MODEL(store), path, iter);
+			gtk_tree_model_row_inserted(GTK_TREE_MODEL(store), path_, &iter);
 
+		gtk_tree_path_free(path_);
 		i=1;
 	}
 
-	for(index = 0; i < new_size; i++, index++)
+	for(index = 0; index < new_size; i++, index++)
 	{
 		path_ = gtk_tree_path_new();
 		gtk_tree_path_append_index(path_, i);
 
-		iter = g_new(GtkTreeIter, 1);
+		iter.stamp = store->stamp;
+		iter.user_data = lxa_entry_children_nth_data(entry, index);
+		iter.user_data2 = entry;
+		iter.user_data3 = GINT_TO_POINTER(index);
 
-		iter->stamp = store->stamp;
-		iter->user_data = lxa_entry_children_nth_data(entry, index);
-		iter->user_data2 = entry;
-		iter->user_data3 = GINT_TO_POINTER(index);
-
 		if(i < prev_size)
-			gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path_, iter);
+			gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path_, &iter);
 		else
-			gtk_tree_model_row_inserted(GTK_TREE_MODEL(store), path_, iter);
+			gtk_tree_model_row_inserted(GTK_TREE_MODEL(store), path_, &iter);
+
+		gtk_tree_path_free(path_);
 	}
-	for(; i < prev_size; i++)
+	for(index = prev_size - 1; index >= i; index--)
 	{
 		path_ = gtk_tree_path_new();
-		gtk_tree_path_append_index(path_, i);
+		gtk_tree_path_append_index(path_, index);
 
 		gtk_tree_model_row_deleted(GTK_TREE_MODEL(store), path_);
+
+		gtk_tree_path_free(path_);
 	}
 }
 
@@ -630,7 +639,7 @@
 {
 	gint i = 0;
 	GtkTreePath *path_ = NULL;
-	GtkTreeIter *iter = NULL;
+	GtkTreeIter iter;
 	g_return_if_fail(store);
 
 	LXAEntry *entry = NULL;
@@ -647,46 +656,40 @@
 
 	}
 
-	if(!archive)
+	for(i = prev_size - 1; i >= 0; i--)
 	{
+		path_ = gtk_tree_path_new();
+		gtk_tree_path_append_index(path_, i);
 
-		for(i = 0; i < prev_size; i++)
-		{
-			path_ = gtk_tree_path_new();
-			gtk_tree_path_append_index(path_, i);
+		gtk_tree_model_row_deleted(GTK_TREE_MODEL(store), path_);
 
-			gtk_tree_model_row_deleted(GTK_TREE_MODEL(store), path_);
-		}
+		gtk_tree_path_free(path_);
+	}
 
+	if(!archive)
+	{
 		store->archive = NULL;
 		store->current_entry = NULL;
 		return;
 	}
+
 	store->archive = archive;
 	store->current_entry = g_slist_prepend(NULL, &archive->root_entry);
 
 	store->up_entry.filename = "..";
 
-	store->n_columns = archive->column_number + 1;
-
-	store->column_types = g_new(GType, store->n_columns);
-
-	store->column_types[0] = G_TYPE_STRING;
-
-	memcpy(store->column_types + 1, archive->column_types, archive->column_number);
-
 	for(i = 0; i < lxa_entry_children_length(&archive->root_entry); i++)
 	{
 		path_ = gtk_tree_path_new();
 		gtk_tree_path_append_index(path_, i);
 
-		iter = g_new(GtkTreeIter, 1);
+		iter.stamp = store->stamp;
+		iter.user_data = lxa_entry_children_nth_data(&archive->root_entry, i);
+		iter.user_data2 = &archive->root_entry;
+		iter.user_data3 = GINT_TO_POINTER(i);
 
-		iter->stamp = store->stamp;
-		iter->user_data = lxa_entry_children_nth_data(&archive->root_entry, i);
-		iter->user_data2 = &archive->root_entry;
-		iter->user_data3 = GINT_TO_POINTER(i);
+		gtk_tree_model_row_inserted(GTK_TREE_MODEL(store), path_, &iter);
 
-		gtk_tree_model_row_inserted(GTK_TREE_MODEL(store), path_, iter);
+		gtk_tree_path_free(path_);
 	}
 }

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.h	2006-10-05 21:28:56 UTC (rev 23294)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.h	2006-10-05 22:27:00 UTC (rev 23295)
@@ -44,8 +44,6 @@
 {
 	GObject parent;
 	gint stamp;
-	guint n_columns;
-	GType *column_types;
 	LXAArchive *archive;
 	GSList *current_entry;
 	LXAEntry up_entry;
@@ -68,5 +66,7 @@
 xa_archive_store_new(LXAArchive *archive, gboolean show_icons);
 void
 xa_archive_store_set_contents(XAArchiveStore *archive_store, LXAArchive *archive);
+void
+xa_archive_store_connect_treeview(XAArchiveStore *store, GtkTreeView *treeview);
 
 #endif /* __XARCHIVER_ARCHIVE_STORE_H__ */

Modified: xarchiver/branches/xarchiver-psybsd/src/main_window.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window.c	2006-10-05 21:28:56 UTC (rev 23294)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window.c	2006-10-05 22:27:00 UTC (rev 23295)
@@ -265,7 +265,7 @@
 
 	gtk_widget_show(window->scrollwindow);
 	gtk_widget_show(window->treeview);
-	g_signal_connect(G_OBJECT(window->treeview), "row-activated", G_CALLBACK(cb_xa_main_item_activated), window);
+//	g_signal_connect(G_OBJECT(window->treeview), "row-activated", G_CALLBACK(cb_xa_main_item_activated), window);
 /* Statusbar */
 
 	window->statusbar = gtk_statusbar_new();
@@ -729,7 +729,7 @@
 		}
 		column_types[0] = G_TYPE_STRING;
 		//liststore = gtk_list_store_newv(archive->column_number+1, column_types); 
-		liststore = xa_archive_store_new(NULL /*archive*/, TRUE);
+		liststore = xa_archive_store_new(archive, TRUE);
 
 		renderer = gtk_cell_renderer_pixbuf_new();
 		column = gtk_tree_view_column_new_with_attributes("", renderer, "icon-name", 0, NULL);
@@ -773,7 +773,7 @@
 	}
 	gtk_tree_view_set_model(GTK_TREE_VIEW(window->treeview), GTK_TREE_MODEL(liststore));
 	window->treemodel = GTK_TREE_MODEL(liststore);
-	xa_archive_store_set_contents(XA_ARCHIVE_STORE(liststore), archive);
+	xa_archive_store_connect_treeview(XA_ARCHIVE_STORE(liststore), GTK_TREE_VIEW(window->treeview));
 }
 
 void
@@ -788,7 +788,7 @@
 	gtk_tree_view_set_model(GTK_TREE_VIEW(main_window->treeview), NULL);
 
 	//gtk_list_store_clear(GTK_LIST_STORE(liststore));
-	xa_archive_store_set_contents(XA_ARCHIVE_STORE(liststore), NULL);
+	xa_archive_store_set_contents(XA_ARCHIVE_STORE(liststore), archive);
 
 /*
 	for(i=0;i<((LXAEntry *)main_window->working_node->data)->n_children; i++)



More information about the Xfce4-commits mailing list