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

Stephan Arts stephan at xfce.org
Mon Nov 13 16:38:01 CET 2006


Author: stephan
Date: 2006-11-13 15:37:58 +0000 (Mon, 13 Nov 2006)
New Revision: 23853

Modified:
   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/notebook.c
   xarchiver/branches/xarchiver-psybsd/src/path_bar.c
   xarchiver/branches/xarchiver-psybsd/src/path_bar.h
Log:
Applied patch of Peter de Ridder <pc.ridder at zonnet.nl> (Fixes Pathbar)

Fixed Critical error (is a hack, should really be fixed in the archive-store)



Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-11-13 13:53:56 UTC (rev 23852)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive.c	2006-11-13 15:37:58 UTC (rev 23853)
@@ -1275,5 +1275,6 @@
 const gchar *
 lxa_archive_get_filename(LXAArchive *archive)
 {
+	g_return_val_if_fail(LXA_IS_ARCHIVE(archive), "<unknown>");
 	return g_basename(archive->path);
 }

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-11-13 13:53:56 UTC (rev 23852)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-11-13 15:37:58 UTC (rev 23853)
@@ -93,6 +93,9 @@
 xa_archive_store_refresh(XAArchiveStore *store, gint prev_size);
 
 static void
+xa_archive_store_file_activated(XAArchiveStore *store, GtkTreePath *path);
+
+static void
 cb_xa_archive_store_row_activated(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data);
 
 /* tree sortable */
@@ -425,7 +428,6 @@
 			entry = store->sort_list[index];
 		else
 			entry = lxa_archive_iter_nth_child(archive, entry, index);
-
 		g_return_val_if_fail(entry, FALSE);
 
 	}
@@ -962,12 +964,14 @@
 static void
 cb_xa_archive_store_row_activated(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
 {
-	g_return_if_fail(XA_IS_ARCHIVE_STORE(user_data));	
-	XAArchiveStore *store = XA_ARCHIVE_STORE(user_data);
+	xa_archive_store_file_activated(XA_ARCHIVE_STORE(user_data), path);
+}
 
+static void
+xa_archive_store_file_activated(XAArchiveStore *store, GtkTreePath *path)
+{
 	g_return_if_fail(store->navigation.present->data);
 
-
 	LXAArchive *archive = store->archive;
 	LXAArchiveIter *entry = ((GSList*)store->navigation.present->data)->data;
 
@@ -1207,6 +1211,8 @@
 xa_archive_store_get_pwd_list(XAArchiveStore *store)
 {
 	g_return_val_if_fail(store, NULL);
+	if(!store->navigation.present)
+		return NULL;
 
 	GValue *basename = g_new0(GValue, 1);
 	GSList *iter = store->navigation.present->data;

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.h	2006-11-13 13:53:56 UTC (rev 23852)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.h	2006-11-13 15:37:58 UTC (rev 23853)
@@ -74,6 +74,7 @@
 GType xa_archive_store_get_type();
 GtkTreeModel * xa_archive_store_new(LXAArchive *archive, gboolean show_icons, gboolean show_up_dir, GtkIconTheme *icon_theme);
 void xa_archive_store_connect_treeview(XAArchiveStore *store, GtkTreeView *treeview);
+void xa_archive_store_connect_iconview(XAArchiveStore *store, GtkIconView *iconview);
 void xa_archive_store_go_up(XAArchiveStore *store);
 gchar * xa_archive_store_get_pwd(XAArchiveStore *store);
 GSList * xa_archive_store_get_pwd_list(XAArchiveStore *store);

Modified: xarchiver/branches/xarchiver-psybsd/src/notebook.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/notebook.c	2006-11-13 13:53:56 UTC (rev 23852)
+++ xarchiver/branches/xarchiver-psybsd/src/notebook.c	2006-11-13 15:37:58 UTC (rev 23853)
@@ -239,7 +239,7 @@
 	GtkWidget *tree_view = gtk_tree_view_new();
 	gtk_tree_view_set_enable_search(GTK_TREE_VIEW(tree_view), TRUE);
 
-	GtkTreeModel *tree_model = xa_archive_store_new(archive, notebook->props._show_icons, notebook->props._up_dir, notebook->icon_theme);
+	GtkTreeModel *tree_model = xa_archive_store_new(NULL, notebook->props._show_icons, notebook->props._up_dir, notebook->icon_theme);
 
 	gtk_box_pack_start(GTK_BOX(lbl_hbox), archive_image, FALSE, FALSE, 3);
 	gtk_box_pack_start(GTK_BOX(lbl_hbox), label, FALSE, FALSE, 0);
@@ -421,7 +421,7 @@
 		GtkWidget *treeview = gtk_bin_get_child(GTK_BIN(scrolledwindow));
 		GtkTreeModel *store = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
 
-		xa_archive_store_set_archive(XA_ARCHIVE_STORE(store), archive);
+		//xa_archive_store_set_archive(XA_ARCHIVE_STORE(store), archive);
 		xa_archive_store_set_support(XA_ARCHIVE_STORE(store), support);
 
 		g_signal_connect(G_OBJECT(archive), "lxa_status_changed", G_CALLBACK(cb_notebook_archive_status_changed), notebook);

Modified: xarchiver/branches/xarchiver-psybsd/src/path_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/path_bar.c	2006-11-13 13:53:56 UTC (rev 23852)
+++ xarchiver/branches/xarchiver-psybsd/src/path_bar.c	2006-11-13 15:37:58 UTC (rev 23853)
@@ -196,6 +196,7 @@
 	path_bar->scroll_timeout = 0;
 	path_bar->scroll_dir = XA_SCROLL_NONE;
 	path_bar->scroll_click = TRUE;
+	path_bar->updating = FALSE;
 
 	gtk_widget_ref(GTK_WIDGET(path_bar));
 }
@@ -476,6 +477,8 @@
 	XAPathBar *path_bar = XA_PATH_BAR(bar);
 	GSList *buttons = path_bar->path_button->next;
 
+	XA_PATH_BAR(bar)->updating = TRUE;
+
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(path_bar->path_button->data), TRUE);
 
 	while(buttons)
@@ -487,7 +490,9 @@
 	g_slist_free(path_bar->path_button->next);
 	path_bar->path_button->next = NULL;
 
-	gtk_widget_set_sensitive(GTK_WIDGET(path_bar->home_button), store->archive?TRUE:FALSE);
+	gtk_widget_set_sensitive(GTK_WIDGET(path_bar->home_button), (store&&store->archive));
+
+	XA_PATH_BAR(bar)->updating = FALSE;
 }
 
 static void
@@ -499,10 +504,10 @@
 	GSList *buttons = path_bar->path_button->next;
 	GSList *lastbutton = path_bar->path_button;
 	GtkRadioButton *button = GTK_RADIO_BUTTON(path_bar->home_button);
-	const gchar *label = xa_archive_store_get_pwd(store);
+	const gchar *label;
 	gint cmp = 0;
 
-	g_free((gchar*)label);
+	path_bar->updating = TRUE;
 
 	while(iter && buttons)
 	{
@@ -559,11 +564,15 @@
 	g_slist_free(path);
 
 	path_bar->first_button = g_slist_last(path_bar->path_button);
+
+	path_bar->updating = FALSE;
 }
 
 static void
 cb_xa_path_bar_path_button_clicked(GtkRadioButton *button, XAPathBar *path_bar)
 {
+	if(path_bar->updating)
+		return;
 	gchar *path = g_strdup("");
 	gchar *prev = NULL;
 	const gchar *folder = NULL;
@@ -581,6 +590,8 @@
 		g_free(prev);
 	}
 
+	xa_archive_store_set_pwd(XA_NAVIGATION_BAR(path_bar)->store, path);
+
 	g_free(path);
 }
 

Modified: xarchiver/branches/xarchiver-psybsd/src/path_bar.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/path_bar.h	2006-11-13 13:53:56 UTC (rev 23852)
+++ xarchiver/branches/xarchiver-psybsd/src/path_bar.h	2006-11-13 15:37:58 UTC (rev 23853)
@@ -53,6 +53,7 @@
 	guint scroll_timeout;
 	guint scroll_dir;
 	gboolean scroll_click;
+	gboolean updating;
 };
 
 typedef struct _XAPathBarClass XAPathBarClass;



More information about the Xfce4-commits mailing list