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

Stephan Arts stephan at xfce.org
Thu Oct 12 22:04:51 UTC 2006


Author: stephan
Date: 2006-10-12 22:04:49 +0000 (Thu, 12 Oct 2006)
New Revision: 23379

Modified:
   xarchiver/branches/xarchiver-psybsd/Makefile.am
   xarchiver/branches/xarchiver-psybsd/configure.in.in
   xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h
   xarchiver/branches/xarchiver-psybsd/src/archive_store.c
   xarchiver/branches/xarchiver-psybsd/src/archive_store.h
   xarchiver/branches/xarchiver-psybsd/src/archive_tree_store.c
   xarchiver/branches/xarchiver-psybsd/src/main.c
   xarchiver/branches/xarchiver-psybsd/src/main_window.c
   xarchiver/branches/xarchiver-psybsd/src/tool_bar.c
Log:
Introduce libxamime (internal xdg-mime-spec library, to make thunar-vfs dependency optional)

Applied patch from Peter de Ridder <pc.ridder at zonnet.nl>
(Fixes the GUI-stuff i broke with last commit)



Modified: xarchiver/branches/xarchiver-psybsd/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/Makefile.am	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/Makefile.am	2006-10-12 22:04:49 UTC (rev 23379)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = libxarchiver src tests po
+SUBDIRS = libxamime libxarchiver src tests po
 
 pixmapsdir       = $(datadir)/pixmaps
 pixmaps_DATA     = pixmaps/xarchiver.png \

Modified: xarchiver/branches/xarchiver-psybsd/configure.in.in
===================================================================
--- xarchiver/branches/xarchiver-psybsd/configure.in.in	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/configure.in.in	2006-10-12 22:04:49 UTC (rev 23379)
@@ -68,6 +68,7 @@
 src/Makefile
 tests/Makefile
 libxarchiver/Makefile
+libxamime/Makefile
 ])
 
 echo "----------------------------------------"

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/Makefile.am	2006-10-12 22:04:49 UTC (rev 23379)
@@ -15,6 +15,5 @@
 	$(THUNAR_VFS_CFLAGS)
 libxarchiver_a_LIBADD =
 
-
 libxarchiver_includedir= \
 	$(includedir)/libxarchiver

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-10-12 22:04:49 UTC (rev 23379)
@@ -2,8 +2,7 @@
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -121,7 +120,7 @@
 	LXAArchive *archive = LXA_ARCHIVE(object);
 	if(archive->path)
 		g_free(archive->path);
-	lxa_archive_free_entry_no_free(archive, &archive->root_entry);
+	lxa_archive_free_entry(archive, archive->root_entry);
 	switch(archive->status)
 	{
 		case(LXA_ARCHIVESTATUS_IDLE):
@@ -215,9 +214,7 @@
 			tmp_entry->filename = g_strdup(path_items[i]);
 			lxa_archive_entry_add_child(archive, parent, tmp_entry);
 			if(path[strlen(path)-1] == '/')
-			{
 				tmp_entry->mime_type = "inode/directory";
-			}
 			else
 				tmp_entry->mime_type = "text/plain";
 		}

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/internals.c	2006-10-12 22:04:49 UTC (rev 23379)
@@ -23,6 +23,9 @@
 #include <glib-object.h>
 #ifdef HAVE_THUNAR_VFS
 #include <thunar-vfs/thunar-vfs.h>
+#else
+#include <libxamime/xa_mime.h>
+#include <gettext.h>
 #endif /* HAVE_THUNAR_VFS */
 
 #include "archive.h"

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.c	2006-10-12 22:04:49 UTC (rev 23379)
@@ -27,8 +27,11 @@
 #include <thunar-vfs/thunar-vfs.h>
 #else
 #include <gettext.h>
+#include <libxamime/xa_mime.h>
+typedef struct _GtkIconTheme GtkIconTheme;
 #endif
 
+
 #include "libxarchiver.h"
 #include "libxarchiver/archive-support-zip.h"
 #include "libxarchiver/archive-support-rar.h"
@@ -37,9 +40,6 @@
 
 #include "internals.h"
 
-
-struct GtkIconTheme;
-
 void
 lxa_init()
 {
@@ -122,9 +122,11 @@
 	const gchar *mime_type = g_value_get_string(value);
 #ifdef HAVE_THUNAR_VFS
 	ThunarVfsMimeInfo *mime_info = thunar_vfs_mime_database_get_info(lxa_mime_database, mime_type);
-	g_value_set_string(value, thunar_vfs_mime_info_lookup_icon_name(mime_info, icon_theme));
-#else
-	g_value_unset(value);
+	const gchar *icon_name = thunar_vfs_mime_info_lookup_icon_name(mime_info, icon_theme);
+	if(gtk_icon_theme_has_icon(icon_theme, icon_name))
+		g_value_set_string(value, icon_name);
+	else
 #endif
-	g_free((gchar *)mime_type);
+		g_value_set_string(value, NULL);
+	/* g_free((gchar *)mime_type); */
 }

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/libxarchiver.h	2006-10-12 22:04:49 UTC (rev 23379)
@@ -23,6 +23,7 @@
 #include <libxarchiver/archive.h>
 #include <libxarchiver/archive-support.h>
 
+
 G_BEGIN_DECLS
 
 /*

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-10-12 22:04:49 UTC (rev 23379)
@@ -303,7 +303,7 @@
 	if(!archive)
 		return 0;
 	
-	return archive->column_number + 1;
+	return archive->n_property + 2;
 }
 
 static GType
@@ -317,13 +317,14 @@
 	if(!archive)
 		return G_TYPE_INVALID;
 
-	if(index == 0)
+	index -= 2;
+
+	if(index < 0)
 		return G_TYPE_STRING;
-	index--;
 
-	g_return_val_if_fail(index < archive->column_number, G_TYPE_INVALID);
+	g_return_val_if_fail(index < archive->n_property, G_TYPE_INVALID);
 
-	return archive->column_types[index];
+	return archive->property_types[index];
 }
 
 static gboolean
@@ -349,7 +350,7 @@
 
 	gint index = indices[depth];
 
-	if(store->props._show_up_dir && &archive->root_entry != entry)
+	if(store->props._show_up_dir && archive->root_entry != entry)
 		index--;
 
 	if(index == -1)
@@ -389,7 +390,7 @@
 	LXAEntry *entry = (LXAEntry*)iter->user_data2;
 	gint pos = GPOINTER_TO_INT(iter->user_data3);
 
-	if(store->props._show_up_dir && &archive->root_entry != entry)
+	if(store->props._show_up_dir && archive->root_entry != entry)
 		pos++;
 
 	GtkTreePath *path = gtk_tree_path_new();
@@ -411,19 +412,16 @@
 
 	g_return_if_fail(archive);
 
-	column--;
+	column -= 2;
 
-	g_return_if_fail (column < (gint)archive->column_number);
+	g_return_if_fail (column < (gint)archive->n_property);
 
-	if(column >= 0)
-		g_value_init(value, archive->column_types[column]);
-
 	LXAEntry *entry = ((LXAEntry *)iter->user_data);
 	gpointer props_iter = entry->props;
-	gint i = 1;
+	gint i = 0;
 	const gchar *icon_name = NULL;
 
-	if(column == -1)
+	if(column == -2)
 	{
 		g_value_init(value, G_TYPE_STRING);
 
@@ -437,21 +435,27 @@
 			{
 				if(store->icon_theme)
 				{
+					g_value_set_string(value, entry->mime_type);
+					lxa_convert_mime_to_icon_name(store->icon_theme, value);
 				}
 			}
 		}
 	}
-	else if(column == 0)
+	else if(column == -1)
 	{
+		g_value_init(value, G_TYPE_STRING);
+
 		g_value_set_string(value, entry->filename);
 	}
 	else
 	{
+		g_value_init(value, archive->property_types[column]);
+
 		if(props_iter)
 		{
 			for(;i<column;i++)
 			{
-				switch(archive->column_types[i])
+				switch(archive->property_types[i])
 				{
 					case G_TYPE_STRING:
 						props_iter+=sizeof(gchar *);
@@ -464,7 +468,7 @@
 						break;
 				}
 			}
-			switch(archive->column_types[column])
+			switch(archive->property_types[column])
 			{
 				case G_TYPE_STRING:
 					g_value_set_string(value, *(gchar **)props_iter);
@@ -521,7 +525,7 @@
 	/* only support lists: parent is always NULL */
 	g_return_val_if_fail(parent == NULL, FALSE);
 
-	if(store->props._show_up_dir && &archive->root_entry != entry)
+	if(store->props._show_up_dir && archive->root_entry != entry)
 	{
 		entry = &xa_archive_store_up_entry;
 		iter->user_data3 = GINT_TO_POINTER(-1);
@@ -566,7 +570,7 @@
 	/* only support lists: iter is always NULL */
 	g_return_val_if_fail(iter == NULL, FALSE);
 
-	return lxa_entry_children_length(entry) + (&archive->root_entry == entry)?0:1;
+	return lxa_entry_children_length(entry) + (archive->root_entry == entry)?0:1;
 }
 
 static gboolean 
@@ -580,11 +584,17 @@
 
 	g_return_val_if_fail(archive, FALSE);
 	g_return_val_if_fail(entry, FALSE);
+	g_return_val_if_fail(iter, FALSE);
+	if(iter->stamp != store->stamp)
+	{
+		/* g_debug("stamp: %d pointer: %x", iter->stamp, iter->user_data); */
+		return FALSE;
+	}
 
 	/* only support lists: parent is always NULL */
 	g_return_val_if_fail(parent == NULL, FALSE);
 
-	if(store->props._show_up_dir && &archive->root_entry != entry)
+	if(store->props._show_up_dir && archive->root_entry != entry)
 		n--;
 
 	if(n == -1)
@@ -687,7 +697,7 @@
 	gpointer props_b = b->props;
 	gint i = 0;
 
-	column--;
+	column -= 2;
 
 	if(column < 0)
 		return;
@@ -701,15 +711,15 @@
 		return props_a?1:0;
 	}
 
-	if(column == 0)
+	if(column == -1)
 	{
 		props_a = &(a->filename);
 		props_b = &(b->filename);
 	}
 
-	for(i=1;i<column;i++)
+	for(i=0;i<column;i++)
 	{
-		switch(archive->column_types[i])
+		switch(archive->property_types[i])
 		{
 			case G_TYPE_STRING:
 				props_a+=sizeof(gchar *);
@@ -726,7 +736,7 @@
 		}
 	}
 
-	switch(archive->column_types[column])
+	switch(archive->property_types[column])
 	{
 		case G_TYPE_STRING:
 			switch(/* string compare type */1)
@@ -869,7 +879,7 @@
 	GtkTreePath *path_ = NULL;
 	GtkTreeIter iter;
 
-	if(store->props._show_up_dir && &archive->root_entry != entry) { 
+	if(store->props._show_up_dir && archive->root_entry != entry) { 
 		path_ = gtk_tree_path_new();
 		gtk_tree_path_append_index(path_, 0);
 
@@ -896,7 +906,7 @@
 		if(store->sort_list)
 			iter.user_data = store->sort_list[i];
 		else
-			iter.user_data = lxa_entry_children_nth_data(archive, &archive->root_entry, i);
+			iter.user_data = lxa_entry_children_nth_data(archive, archive->root_entry, i);
 		iter.user_data2 = entry;
 		iter.user_data3 = GINT_TO_POINTER(index);
 
@@ -942,7 +952,7 @@
 	gint prev_size = lxa_entry_children_length(entry);
 	gint index = indices[depth];
 
-	if(store->props._show_up_dir && &archive->root_entry != entry)
+	if(store->props._show_up_dir && archive->root_entry != entry)
 	{
 		prev_size++;
 		index--;
@@ -986,7 +996,7 @@
 
 	gint prev_size = lxa_entry_children_length(entry);
 
-	if(store->props._show_up_dir && &archive->root_entry != entry)
+	if(store->props._show_up_dir && archive->root_entry != entry)
 	{
 		prev_size++;
 	}
@@ -1022,7 +1032,7 @@
 		prev_size = lxa_entry_children_length(entry);
 		
 
-		if(store->props._show_up_dir && &store->archive->root_entry != entry)
+		if(store->props._show_up_dir && store->archive->root_entry != entry)
 			prev_size++;
 		
 		g_slist_free(store->current_entry);
@@ -1038,6 +1048,9 @@
 		gtk_tree_path_free(path_);
 	}
 
+	if(store->archive)
+		g_object_unref(store->archive);
+
 	if(!archive)
 	{
 		store->archive = NULL;
@@ -1045,12 +1058,13 @@
 		return;
 	}
 
+	g_object_ref(archive);
 	store->archive = archive;
-	store->current_entry = g_slist_prepend(NULL, &archive->root_entry);
+	store->current_entry = g_slist_prepend(NULL, archive->root_entry);
 
 	xa_archive_store_sort(store);
 
-	for(i = 0; i < lxa_entry_children_length(&archive->root_entry); i++)
+	for(i = 0; i < lxa_entry_children_length(archive->root_entry); i++)
 	{
 		path_ = gtk_tree_path_new();
 		gtk_tree_path_append_index(path_, i);
@@ -1059,8 +1073,8 @@
 		if(store->sort_list)
 			iter.user_data = store->sort_list[i];
 		else
-			iter.user_data = lxa_entry_children_nth_data(archive, &archive->root_entry, i);
-		iter.user_data2 = &archive->root_entry;
+			iter.user_data = lxa_entry_children_nth_data(archive, 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);
@@ -1145,7 +1159,7 @@
 }
 
 gboolean
-xa_archive_store_set_pwd(XAArchiveStore *store, gchar *path)
+xa_archive_store_set_pwd(XAArchiveStore *store, const gchar *path)
 {
 	gint result = xa_archive_store_set_pwd_silent(store, path);
 
@@ -1154,7 +1168,7 @@
 }
 
 gboolean
-xa_archive_store_set_pwd_silent(XAArchiveStore *store, gchar *path)
+xa_archive_store_set_pwd_silent(XAArchiveStore *store, const gchar *path)
 {
 	g_return_val_if_fail(store, -1);
 
@@ -1163,11 +1177,11 @@
 
 	gchar **buf = g_strsplit_set(path, "/\n", -1);
 	gchar **iter = buf;
-	LXAEntry *entry = &store->archive->root_entry;
+	LXAEntry *entry = store->archive->root_entry;
 	GSList *stack = g_slist_prepend(NULL, entry);
 	gint prev_size = lxa_entry_children_length(((LXAEntry*)store->current_entry->data));
 
-	if(store->props._show_up_dir && &store->archive->root_entry != store->current_entry->data)
+	if(store->props._show_up_dir && store->archive->root_entry != store->current_entry->data)
 		prev_size++;
 
 	while(*iter)

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.h	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.h	2006-10-12 22:04:49 UTC (rev 23379)
@@ -81,9 +81,9 @@
 gchar *
 xa_archive_store_get_basename(XAArchiveStore *store);
 gboolean
-xa_archive_store_set_pwd(XAArchiveStore *store, gchar *path);
+xa_archive_store_set_pwd(XAArchiveStore *store, const gchar *path);
 gboolean
-xa_archive_store_set_pwd_silent(XAArchiveStore *store, gchar *path);
+xa_archive_store_set_pwd_silent(XAArchiveStore *store, const gchar *path);
 void
 xa_archive_store_set_icon_theme(XAArchiveStore *store, GtkIconTheme *icon_theme);
 

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_tree_store.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_tree_store.c	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_tree_store.c	2006-10-12 22:04:49 UTC (rev 23379)
@@ -290,7 +290,7 @@
 	if(!archive)
 		return 0;
 	
-	return (store->props._show_only_filename?1:archive->column_number) + (store->props._show_icons?1:0);
+	return (store->props._show_only_filename?0:archive->n_property) + (store->props._show_icons?2:1);
 }
 
 static GType
@@ -304,16 +304,14 @@
 	if(!archive)
 		return G_TYPE_INVALID;
 
-	if(store->props._show_icons)
-	{
-		if(index == 0)
-			return G_TYPE_STRING;
-		index--;
-	}
+	index -= 2;
 
-	g_return_val_if_fail(index < archive->column_number, G_TYPE_INVALID);
+	if(index < 0)
+		return G_TYPE_STRING;
 
-	return archive->column_types[index];
+	g_return_val_if_fail(index < archive->n_property, G_TYPE_INVALID);
+
+	return archive->property_types[index];
 }
 
 static gboolean
@@ -329,7 +327,7 @@
 	gint *indices = gtk_tree_path_get_indices(path);
 	gint depth = gtk_tree_path_get_depth(path);
 	gint i = 0;
-	LXAEntry *entry = &archive->root_entry;
+	LXAEntry *entry = archive->root_entry;
 	LXAEntry *pentry = NULL;
 	XAParentTree *tree = NULL;
 	XAParentTree *ptree = NULL;
@@ -399,10 +397,10 @@
 	if(store->props._show_icons)
 		column--;
 
-	g_return_if_fail (column < (gint)archive->column_number);
+	g_return_if_fail (column < (gint)archive->n_property);
 
 	if(column >= 0)
-		g_value_init(value, archive->column_types[column]);
+		g_value_init(value, archive->property_types[column]);
 
 	LXAEntry *entry = ((LXAEntry *)iter->user_data);
 	gpointer props_iter = entry->props;
@@ -427,7 +425,7 @@
 		{
 			for(i=1;i<column;i++)
 			{
-				switch(archive->column_types[i])
+				switch(archive->property_types[i])
 				{
 					case G_TYPE_STRING:
 						props_iter+=sizeof(gchar *);
@@ -440,7 +438,7 @@
 						break;
 				}
 			}
-			switch(archive->column_types[column])
+			switch(archive->property_types[column])
 			{
 				case G_TYPE_STRING:
 					g_value_set_string(value, *(gchar **)props_iter);
@@ -502,7 +500,7 @@
 
 	g_return_val_if_fail(archive, 0);
 
-	LXAEntry *entry = &archive->root_entry;
+	LXAEntry *entry = archive->root_entry;
 
 	if(iter)
 	{
@@ -526,7 +524,7 @@
 
 	g_return_val_if_fail(archive, FALSE);
 
-	LXAEntry *pentry = &archive->root_entry;
+	LXAEntry *pentry = archive->root_entry;
 
 	if(parent)
 	{
@@ -672,7 +670,7 @@
 
 	for(i=1;i<column;i++)
 	{
-		switch(archive->column_types[i])
+		switch(archive->property_types[i])
 		{
 			case G_TYPE_STRING:
 				props_a+=sizeof(gchar *);
@@ -689,7 +687,7 @@
 		}
 	}
 
-	switch(archive->column_types[column])
+	switch(archive->property_types[column])
 	{
 		case G_TYPE_STRING:
 			switch(/* string compare type */1)
@@ -895,7 +893,7 @@
 
 	XAArchiveTreeStore *store = XA_ARCHIVE_TREE_STORE(user_data);
 	LXAArchive *archive = store->archive;
-	LXAEntry *entry = &archive->root_entry;
+	LXAEntry *entry = archive->root_entry;
 	LXAEntry *pentry = NULL;
 
 	g_return_if_fail(archive);
@@ -962,7 +960,7 @@
 
 	if(store->archive)
 	{
-		entry = &store->archive->root_entry;
+		entry = store->archive->root_entry;
 		prev_size = lxa_entry_children_length(entry);
 	}
 
@@ -985,7 +983,7 @@
 	store->archive = archive;
 
 	XAParentTree *tree = g_new(XAParentTree, 1);
-	tree->entry = &archive->root_entry;
+	tree->entry = archive->root_entry;
 	tree->pos = 0;
 	tree->parent = NULL;
 

Modified: xarchiver/branches/xarchiver-psybsd/src/main.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main.c	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/src/main.c	2006-10-12 22:04:49 UTC (rev 23379)
@@ -18,8 +18,8 @@
 #include <config.h>
 #include <glib.h>
 #include <glib-object.h>
+#include <gtk/gtk.h>
 #include <libxarchiver/libxarchiver.h>
-#include <gtk/gtk.h>
 
 #include <gettext.h>
 

Modified: xarchiver/branches/xarchiver-psybsd/src/main_window.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window.c	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window.c	2006-10-12 22:04:49 UTC (rev 23379)
@@ -401,6 +401,7 @@
 		new_archive_path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
 		if(window->lp_xa_archive)
 		{
+			xa_archive_store_set_contents(XA_ARCHIVE_STORE(window->treemodel), NULL);
 			g_object_unref(window->lp_xa_archive);
 			window->lp_xa_archive = NULL;
 		}
@@ -573,6 +574,7 @@
 	g_list_free(columns);
 
 	if(archive == window->lp_xa_archive)
+		xa_archive_store_set_contents(XA_ARCHIVE_STORE(window->treemodel), NULL);
 		window->lp_xa_archive = NULL;
 	
 	gtk_widget_set_sensitive(GTK_WIDGET(window->menubar.menu_item_close), FALSE);
@@ -724,19 +726,19 @@
 
 	gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
 	gtk_tree_view_column_set_sort_column_id(column, 1);
-	gtk_tree_view_column_set_title(column, archive->column_names[0]);
+	gtk_tree_view_column_set_title(column, "Filename");
 	gtk_tree_view_append_column(GTK_TREE_VIEW(window->treeview), column);
 
 	if(!show_only_filenames)
 	{
-		for(x = 1; x < archive->column_number; x++)
+		for(x = 0; x < archive->n_property; x++)
 		{
-			switch(archive->column_types[x])
+			switch(archive->property_types[x])
 			{
 				case(G_TYPE_STRING):
 				case(G_TYPE_UINT64):
 					renderer = gtk_cell_renderer_text_new();
-					column = gtk_tree_view_column_new_with_attributes(archive->column_names[x], renderer, "text", x+1, NULL);
+					column = gtk_tree_view_column_new_with_attributes(archive->property_names[x], renderer, "text", x+2, NULL);
 					break;
 			}
 			gtk_tree_view_column_set_resizable(column, TRUE);
@@ -797,11 +799,11 @@
 	{
 		props_iter = props;
 
-		for(i=1; i < main_window->lp_xa_archive->column_number; i++)
+		for(i=0; i < main_window->lp_xa_archive->n_property; i++)
 		{
 			tmp_value = g_new0(GValue, 1);
-			tmp_value = g_value_init(tmp_value, main_window->lp_xa_archive->column_types[i]);
-			switch(main_window->lp_xa_archive->column_types[i])
+			tmp_value = g_value_init(tmp_value, main_window->lp_xa_archive->property_types[i]);
+			switch(main_window->lp_xa_archive->property_types[i])
 			{
 				case(G_TYPE_UINT):
 					g_value_set_uint(tmp_value, *(guint *)props_iter);

Modified: xarchiver/branches/xarchiver-psybsd/src/tool_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/tool_bar.c	2006-10-12 21:34:58 UTC (rev 23378)
+++ xarchiver/branches/xarchiver-psybsd/src/tool_bar.c	2006-10-12 22:04:49 UTC (rev 23379)
@@ -212,6 +212,6 @@
 static void
 cb_xa_tool_bar_path_field_activated(GtkWidget *entry, XAToolBar *tool_bar)
 {
-	gchar *path = gtk_entry_get_text(GTK_ENTRY(entry));
+	const gchar *path = gtk_entry_get_text(GTK_ENTRY(entry));
 	xa_archive_store_set_pwd(XA_ARCHIVE_STORE(XA_NAVIGATION_BAR(tool_bar)->store), path);
 }



More information about the Xfce4-commits mailing list