Author: colossus
Date: 2008-07-09 10:04:28 +0000 (Wed, 09 Jul 2008)
New Revision: 27244
Modified:
xarchiver/trunk/src/archive.c
Log:
The archive directories entries are now inserted at the top of the liststore.
Thanks to Enrico Troeger for providing the code.
Modified: xarchiver/trunk/src/archive.c
===================================================================
--- xarchiver/trunk/src/archive.c 2008-07-09 09:58:56 UTC (rev 27243)
+++ xarchiver/trunk/src/archive.c 2008-07-09 10:04:28 UTC (rev 27244)
@@ -528,6 +528,7 @@
{
GdkPixbuf *pixbuf = NULL;
GtkTreeIter iter;
+ GtkTreeIter *last_dir_iter = NULL;
unsigned short int i;
gpointer current_column;
@@ -564,7 +565,21 @@
while (entry)
{
current_column = entry->columns;
- gtk_list_store_append (archive->liststore, &iter);
+ //gtk_list_store_append (archive->liststore, &iter);
+ if (entry->is_dir)
+ {
+ if (last_dir_iter == NULL)
+ gtk_list_store_prepend(archive->liststore,
&iter);
+ else
+ {
+ gtk_list_store_insert_after(archive->liststore,
&iter, last_dir_iter);
+ gtk_tree_iter_free(last_dir_iter);
+ }
+ last_dir_iter = gtk_tree_iter_copy(&iter);
+ }
+ else
+ gtk_list_store_append(archive->liststore, &iter);
+
if(!g_utf8_validate(entry->filename, -1, NULL) )
{
gchar *dummy = g_convert(entry->filename, -1, "UTF-8",
"WINDOWS-1252", NULL, NULL, NULL);
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits