Author: colossus
Date: 2006-07-11 13:00:56 +0000 (Tue, 11 Jul 2006)
New Revision: 22403
Modified:
xarchiver/trunk/TODO
xarchiver/trunk/src/callbacks.c
xarchiver/trunk/src/extract_dialog.c
xarchiver/trunk/src/iso.c
Log:
Fixed bug #2005.
The extract dialog is closed before the ISO extraction is performed.
Have the progress bar pulse when extracting from an ISO.
Updated TODO file.
Modified: xarchiver/trunk/TODO
===================================================================
--- xarchiver/trunk/TODO 2006-07-11 11:27:07 UTC (rev 22402)
+++ xarchiver/trunk/TODO 2006-07-11 13:00:56 UTC (rev 22403)
@@ -1,6 +1,7 @@
+ iso
- add display of ID's inside the ISO plus image type [PARTIALLY DONE].
- fix the extraction of single files with full path.
-- fix bugs #1736, #1937, #2005.
+- fix bugs #1736, #1937.
- switching by right clicking on the toolbar to icons with text/ no text/
small icons.
-- ?? create a routine for handling the sensitiveness of the buttons, window
title
+- create a routine for handling the sensitiveness of the buttons, window title
[MAYBE ??]
+
Modified: xarchiver/trunk/src/callbacks.c
===================================================================
--- xarchiver/trunk/src/callbacks.c 2006-07-11 11:27:07 UTC (rev 22402)
+++ xarchiver/trunk/src/callbacks.c 2006-07-11 13:00:56 UTC (rev 22403)
@@ -550,7 +550,8 @@
if (extract_path != NULL)
gtk_entry_set_text
(GTK_ENTRY(extract_window->destination_path_entry),extract_path);
command = xa_parse_extract_dialog_options ( archive , extract_window,
selection );
- gtk_widget_destroy ( extract_window->dialog1 );
+ if (extract_window->dialog1 != NULL)
+ gtk_widget_destroy ( extract_window->dialog1 );
if (command != NULL)
{
ExtractAddDelete (command);
Modified: xarchiver/trunk/src/extract_dialog.c
===================================================================
--- xarchiver/trunk/src/extract_dialog.c 2006-07-11 11:27:07 UTC (rev
22402)
+++ xarchiver/trunk/src/extract_dialog.c 2006-07-11 13:00:56 UTC (rev
22403)
@@ -494,7 +494,11 @@
break;
case XARCHIVETYPE_ISO:
- end = gtk_tree_model_get_iter_first
(model,&iter);
+ end = gtk_tree_model_get_iter_first
(model , &iter);
+ gtk_widget_show ( viewport2 );
+ g_timeout_add (200,
xa_progressbar_pulse, NULL );
+ gtk_widget_destroy
(dialog_data->dialog1);
+ dialog_data->dialog1 = NULL;
while (end)
{
gtk_tree_model_get (model,
&iter,
Modified: xarchiver/trunk/src/iso.c
===================================================================
--- xarchiver/trunk/src/iso.c 2006-07-11 11:27:07 UTC (rev 22402)
+++ xarchiver/trunk/src/iso.c 2006-07-11 13:00:56 UTC (rev 22403)
@@ -378,114 +378,98 @@
void parse_dir (gchar *dir_name , int extent, int len, XArchive *archive)
{
- char testname[256];
- struct todo *td;
- int i;
- struct iso_directory_record *idr;
+ char testname[256];
+ struct todo *td;
+ int i;
+ struct iso_directory_record *idr;
- while(len > 0 )
- {
- lseek(fileno(iso_stream), (extent - sector_offset) << 11, 0);
- read(fileno(iso_stream), buffer, sizeof(buffer));
- len -= sizeof(buffer);
- extent++;
- i = 0;
- while( 1==1 )
- {
- idr = (struct iso_directory_record *) &buffer[i];
- if (idr->length[0] == 0)
- break;
- memset(&fstat_buf, 0, sizeof(fstat_buf));
- name_buf[0] = xname[0] = 0;
- fstat_buf.st_size = iso_733((unsigned char
*)idr->size);
- if( idr->flags[0] & 2)
- fstat_buf.st_mode |= S_IFDIR;
- else
- fstat_buf.st_mode |= S_IFREG;
- if(idr->name_len[0] == 1 && idr->name[0] == 0)
- strcpy(name_buf, ".");
- else if(idr->name_len[0] == 1 && idr->name[0] == 1)
- strcpy(name_buf, "..");
- else
- {
- switch (ucs_level)
- {
- case 3:
- /*
- * Unicode name. Convert as best we
can.
- */
- {
- int i;
- for(i=0; i < idr->name_len[0]
/ 2; i++)
- {
- name_buf[i] =
idr->name[i*2+1];
- }
- name_buf[idr->name_len[0]/2] =
'\0';
- }
- break;
- case 0:
- /*
- * Normal non-Unicode name.
- */
- strncpy(name_buf, idr->name,
idr->name_len[0]);
- name_buf[idr->name_len[0]] = 0;
- break;
+ while (len > 0 )
+ {
+ lseek(fileno(iso_stream), (extent - sector_offset) << 11, 0);
+ read(fileno(iso_stream), buffer, sizeof(buffer));
+ len -= sizeof(buffer);
+ extent++;
+ i = 0;
+ while( 1 == 1 )
+ {
+ idr = (struct iso_directory_record *) &buffer[i];
+ if (idr->length[0] == 0)
+ break;
+ memset(&fstat_buf, 0, sizeof(fstat_buf));
+ name_buf[0] = xname[0] = 0;
+ fstat_buf.st_size = iso_733((unsigned char *)idr->size);
+ if( idr->flags[0] & 2)
+ fstat_buf.st_mode |= S_IFDIR;
+ else
+ fstat_buf.st_mode |= S_IFREG;
+ if(idr->name_len[0] == 1 && idr->name[0] == 0)
+ strcpy(name_buf, ".");
+ else if(idr->name_len[0] == 1 && idr->name[0] == 1)
+ strcpy(name_buf, "..");
+ else
+ {
+ switch (ucs_level)
+ {
+ case 3:
+ /* Unicode name. Convert as best we
can. */
+ {
+ int i;
+ for(i=0; i < idr->name_len[0] /
2; i++)
+ name_buf[i] =
idr->name[i*2+1];
+ name_buf[idr->name_len[0]/2] =
'\0';
+ }
+ break;
+
+ case 0:
+ /* Normal non-Unicode name. */
+ strncpy(name_buf, idr->name,
idr->name_len[0]);
+ name_buf[idr->name_len[0]] = 0;
+ break;
- /*
- * Don't know how to do these yet.
Maybe they are the same
- * as one of the above.
- */
- }
- };
- memcpy(date_buf, idr->date, 9);
- if (use_rock)
- dump_rr(idr);
- if( (idr->flags[0] & 2) != 0
- && (idr->name_len[0] != 1
- || (idr->name[0] != 0 && idr->name[0] != 1)))
- {
- /*
- * Add this directory to the todo list.
- */
- td = todo_idr;
- if( td != NULL )
- {
- while(td->next != NULL)
- td = td->next;
- td->next = (struct todo *) malloc(sizeof(*td));
- td = td->next;
- }
- else
- {
- todo_idr = td = (struct todo *)
malloc(sizeof(*td));
- }
- td->next = NULL;
- td->extent = iso_733((unsigned char *)idr->extent);
- td->length = iso_733((unsigned char *)idr->size);
- td->name = (char *) malloc(strlen(rootname)
- + strlen(name_buf) + 2);
- strcpy(td->name, rootname);
- strcat(td->name, name_buf);
- strcat(td->name, "/");
- }
- else
- {
- strcpy(testname, rootname);
- strcat(testname, name_buf);
- }
- if( do_find
- && (idr->name_len[0] != 1
- || (idr->name[0] != 0 && idr->name[0] != 1)))
- {
- strcpy(testname, rootname);
- strcat(testname, name_buf);
- }
- dump_stat(dir_name , iso_733((unsigned char *)idr->extent),
archive);
- i += buffer[i];
- if (i > 2048 - sizeof(struct iso_directory_record))
- break;
- }
- }
+ /* Don't know how to do these yet.Maybe they are the same
as one of the above. */
+ }
+ };
+ memcpy(date_buf, idr->date, 9);
+ if (use_rock)
+ dump_rr(idr);
+ if( (idr->flags[0] & 2) != 0 && (idr->name_len[0] !=
1 || (idr->name[0] != 0 && idr->name[0] != 1)))
+ {
+ /* Add this directory to the todo list. */
+ td = todo_idr;
+ if( td != NULL )
+ {
+ while(td->next != NULL)
+ td = td->next;
+ td->next = (struct todo *)
malloc(sizeof(*td));
+ td = td->next;
+ }
+ else
+ todo_idr = td = (struct todo *)
malloc(sizeof(*td));
+
+ td->next = NULL;
+ td->extent = iso_733((unsigned char
*)idr->extent);
+ td->length = iso_733((unsigned char
*)idr->size);
+ td->name = (char *) malloc(strlen(rootname) +
strlen(name_buf) + 2);
+ strcpy(td->name, rootname);
+ strcat(td->name, name_buf);
+ strcat(td->name, "/");
+ }
+ else
+ {
+ strcpy(testname, rootname);
+ strcat(testname, name_buf);
+ }
+ if( do_find && (idr->name_len[0] != 1 || (idr->name[0]
!= 0 && idr->name[0] != 1)))
+ {
+ strcpy(testname, rootname);
+ strcat(testname, name_buf);
+ }
+ dump_stat(dir_name , iso_733((unsigned char
*)idr->extent), archive);
+ i += buffer[i];
+ if (i > 2048 - sizeof(struct iso_directory_record))
+ break;
+ }
+ }
}
gboolean xa_extract_iso_file (XArchive *archive, gchar *permission, gchar
*destination_path, gchar *_filename , unsigned long long int file_size,
unsigned long long file_offset )
@@ -496,6 +480,8 @@
unsigned long long int tlen;
char buf[2048];
+ while (gtk_events_pending() )
+ gtk_main_iteration();
if (archive->full_path == 0)
{
if (strstr (permission , "d") )
@@ -558,7 +544,7 @@
void OpenISO ( XArchive *archive )
{
int c;
- struct todo * td;
+ struct todo *td;
int extent;
int block;
int toc_offset = 0;
@@ -654,22 +640,26 @@
}
parse_dir ("/" , iso_733((unsigned char *)idr->extent),
iso_733((unsigned char *)idr->size), archive);
xa_append_rows ( archive , 5 );
+
td = todo_idr;
while(td)
{
- rootname = td->name;
- parse_dir( rootname , td->extent, td->length, archive);
+ //rootname = td->name;
+ parse_dir( td->name , td->extent, td->length, archive);
xa_append_rows ( archive , 5 );
- free (td->name);
+ g_free (td->name);
td = td->next;
}
fclose(iso_stream);
+
use_rock = FALSE;
use_joilet = FALSE;
- free (td);
+ g_free (td);
+ g_free (todo_idr);
td = NULL;
+ todo_idr = NULL;
xa_set_button_state (1,1,0,1,1);
OffTooltipPadlock();
@@ -678,6 +668,7 @@
g_object_unref (model);
gtk_widget_set_sensitive ( iso_info , TRUE );
gtk_widget_set_sensitive ( view_shell_output1 , FALSE );
+ gtk_window_set_title (GTK_WINDOW(MainWindow),archive->path);
Update_StatusBar ( _("Operation completed.") );
}
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits