Author: colossus
Date: 2007-07-30 13:18:46 +0000 (Mon, 30 Jul 2007)
New Revision: 25938
Modified:
xarchiver/trunk/src/archive.c
xarchiver/trunk/src/interface.c
xarchiver/trunk/src/window.c
xarchiver/trunk/src/zip.c
Log:
Fixed up button.
Fixed sensitiveness of home button.
Fixed bug in archive navigation preventing the children of the last dir to be
shown.
Modified: xarchiver/trunk/src/archive.c
===================================================================
--- xarchiver/trunk/src/archive.c 2007-07-28 13:10:25 UTC (rev 25937)
+++ xarchiver/trunk/src/archive.c 2007-07-30 13:18:46 UTC (rev 25938)
@@ -339,16 +339,13 @@
child_entry =
xa_find_archive_entry(last_entry,full_path_name);
if (child_entry == NULL)
{
- //g_print ("child_entry รจ null per
%s\n",full_path_name);
child_entry = xa_alloc_memory_for_each_row
(archive->nc,archive->column_types);
child_entry->filename = full_path_name;
- //g_print ("** %s\n",full_path_name);
child_entry->columns =
xa_fill_archive_entry_columns_for_each_row(archive,child_entry,items);
child_entry->next = last_entry->child;
last_entry->child = child_entry;
- //questa entry last_entry->child contiene tutte
le dir
- //g_message (child_entry->filename);
+ //thid entry, last_entry->child, contains all
the dirs
}
last_entry = child_entry;
p++;
@@ -359,12 +356,10 @@
filename_only = g_strndup(++p,strlen(p));
child_entry = xa_alloc_memory_for_each_row
(archive->nc,archive->column_types);
child_entry->filename = filename_only;
- //g_print ("%s\n",filename_only);
+
child_entry->columns =
xa_fill_archive_entry_columns_for_each_row(archive,child_entry,items);
-
child_entry->next = last_entry->child;
last_entry->child = child_entry;
- last_entry = child_entry;
}
}
else
@@ -410,7 +405,8 @@
void xa_update_window_with_archive_entries (XArchive *archive,gchar *path)
{
GSList *s = NULL;
- XEntry *entry = NULL;
+ XEntry *entry = NULL;
+ XEntry *entry2 = NULL;
GtkTreeIter iter;
unsigned short int i;
gpointer current_column;
@@ -425,7 +421,7 @@
current_column = entry->columns;
gtk_list_store_append (archive->liststore, &iter);
- //TODO: free the char in g_convert and also at line 445
+ //TODO: free the char in g_convert and also at line 445
if(!g_utf8_validate(entry->filename, -1, NULL) )
gtk_list_store_set
(archive->liststore,&iter,0,GTK_STOCK_DIRECTORY,1,g_convert(entry->filename,
-1, "UTF-8", "WINDOWS-1252", NULL, NULL, NULL),-1);
else
@@ -448,18 +444,28 @@
break;
}
}
+ entry = entry->next;
}
gtk_widget_set_sensitive(up_button,FALSE);
+ gtk_widget_set_sensitive(home_button,FALSE);
gtk_entry_set_text(GTK_ENTRY(location_entry),"");
return;
}
else
{
- entry = xa_find_archive_entry(s->data,path);
+ for (; s; s = s->next)
+ {
+ entry = xa_find_archive_entry(s->data,path);
+ if (entry == NULL || entry->child == NULL)
+ continue;
+ else
+ break;
+ }
if (entry == NULL || entry->child == NULL)
return;
gtk_widget_set_sensitive(up_button,TRUE);
+ gtk_widget_set_sensitive(home_button,TRUE);
if (archive->location_entry_path == NULL)
archive->location_entry_path = g_strconcat
(gtk_entry_get_text(GTK_ENTRY(location_entry)), entry->filename, "/", NULL);
@@ -468,7 +474,6 @@
archive->location_entry_path = NULL;
entry = entry->child;
- //g_print ("entry->child = %s\n",entry->filename);
}
gtk_list_store_clear(archive->liststore);
@@ -510,8 +515,6 @@
}
}
entry = entry->next;
- /*if (entry != NULL)
- g_print ("entry->next = %s\n",entry->filename);*/
}
}
Modified: xarchiver/trunk/src/interface.c
===================================================================
--- xarchiver/trunk/src/interface.c 2007-07-28 13:10:25 UTC (rev 25937)
+++ xarchiver/trunk/src/interface.c 2007-07-30 13:18:46 UTC (rev 25938)
@@ -934,14 +934,19 @@
strlen(gtk_entry_get_text(GTK_ENTRY(location_entry)))-1);
up = xa_get_parent_dir (path);
_path = remove_level_from_path(path);
+ g_free (path);
if (_path == NULL || *up == '/')
+ {
+ g_free (up);
archive[idx]->location_entry_path = NULL;
+
xa_update_window_with_archive_entries(archive[idx],NULL);
+ return;
+ }
else
archive[idx]->location_entry_path = g_strconcat
(_path,"/",NULL);
g_free (_path);
- g_free (path);
xa_update_window_with_archive_entries(archive[idx],up);
g_free (up);
break;
Modified: xarchiver/trunk/src/window.c
===================================================================
--- xarchiver/trunk/src/window.c 2007-07-28 13:10:25 UTC (rev 25937)
+++ xarchiver/trunk/src/window.c 2007-07-30 13:18:46 UTC (rev 25938)
@@ -2210,4 +2210,5 @@
gtk_tree_model_get (GTK_TREE_MODEL (archive[idx]->liststore),&iter,1,
&name,-1);
xa_update_window_with_archive_entries(archive[idx],name);
+ g_free(name);
}
Modified: xarchiver/trunk/src/zip.c
===================================================================
--- xarchiver/trunk/src/zip.c 2007-07-28 13:10:25 UTC (rev 25937)
+++ xarchiver/trunk/src/zip.c 2007-07-30 13:18:46 UTC (rev 25938)
@@ -55,6 +55,7 @@
void xa_get_zip_line_content (gchar *line, gpointer data)
{
XArchive *archive = data;
+ XEntry *entry = NULL;
gchar *filename;
gpointer item[8];
unsigned short int i = 0;
@@ -165,8 +166,8 @@
filename = line + n;
//item[0] = GTK_STOCK_DIRECTORY;//xa_get_mime_icon (line+a);
- archive->entry = xa_set_archive_entries_for_each_row
(archive,filename,item);
- if (archive->entry != NULL)
+ entry = xa_set_archive_entries_for_each_row (archive,filename,item);
+ /*if (archive->entry != NULL)
{
archive->entry->is_dir = is_dir;
archive->entry->is_encrypted = encrypted;
@@ -175,5 +176,5 @@
{
//TODO: found a way to stop calling this function over and over
again; i.e. kill (archive->child_pid,SIGABRT) ??
g_message ("*** Can't allocate memory for the archive data!");
- }
+ }*/
}
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits