Author: colossus
Date: 2006-08-02 10:57:39 +0000 (Wed, 02 Aug 2006)
New Revision: 22627

Modified:
   xarchiver/trunk/TODO
   xarchiver/trunk/src/bzip2.c
   xarchiver/trunk/src/callbacks.c
Log:
Fixed inability to quit Xarchiver when trying to drop something after opening 
an ISO image. Thanks as usual to baze :)
Fixed indentation in bzip2.c.
Updated TODO file.


Modified: xarchiver/trunk/TODO
===================================================================
--- xarchiver/trunk/TODO        2006-08-02 08:35:54 UTC (rev 22626)
+++ xarchiver/trunk/TODO        2006-08-02 10:57:39 UTC (rev 22627)
@@ -1,7 +1,7 @@
-+ iso
-  - add display of ID's inside the ISO plus image type [PARTIALLY DONE].
-
+- add display of ID's inside the ISO plus image type [PARTIALLY DONE].
 - fix bug #1736.
 - 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 
[MAYBE ??]
+- [MAYBE] create a routine for handling the sensitiveness of the buttons, 
window title
 - add a small progress window when using Xarchiver cmd-line switches.
+- redesign the new dialog.
+- better handling of supported archive types.

Modified: xarchiver/trunk/src/bzip2.c
===================================================================
--- xarchiver/trunk/src/bzip2.c 2006-08-02 08:35:54 UTC (rev 22626)
+++ xarchiver/trunk/src/bzip2.c 2006-08-02 10:57:39 UTC (rev 22627)
@@ -178,34 +178,34 @@
        FILE *stream = data;
        gchar buffer[65536];
        gsize bytes_read;
-  GIOStatus status;
+       GIOStatus status;
        GError *error = NULL;
 
        if (cond & (G_IO_IN | G_IO_PRI) )
        {
-    do
-    {
-                 status = g_io_channel_read_chars (ioc, buffer, 
sizeof(buffer), &bytes_read, &error);
-      if (bytes_read > 0)
-      {
-                   //Write the content of the bzip/gzip extracted file to the 
file pointed by the file stream
-                   fwrite (buffer, 1, bytes_read, stream);
-      }
-      else if (error != NULL)
-      {
-        response = ShowGtkMessageDialog (GTK_WINDOW 
(MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK, _("An error 
occurred:"),error->message);
-        g_error_free (error);
-        return FALSE;
-      }
-    }
-    while (status == G_IO_STATUS_NORMAL);
+               do
+           {
+                       status = g_io_channel_read_chars (ioc, buffer, 
sizeof(buffer), &bytes_read, &error);
+                       if (bytes_read > 0)
+                       {
+                               //Write the content of the bzip/gzip extracted 
file to the file pointed by the file stream
+                               fwrite (buffer, 1, bytes_read, stream);
+                       }
+                       else if (error != NULL)
+                       {
+                       response = ShowGtkMessageDialog (GTK_WINDOW 
(MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK, _("An error 
occurred:"),error->message);
+                       g_error_free (error);
+                       return FALSE;
+                       }
+               }
+               while (status == G_IO_STATUS_NORMAL);
 
-    if (status == G_IO_STATUS_ERROR || status == G_IO_STATUS_EOF)
-      goto done;
+               if (status == G_IO_STATUS_ERROR || status == G_IO_STATUS_EOF)
+               goto done;
        }
        else if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL) )
        {
-done:
+               done:
                fclose ( stream );
                g_io_channel_shutdown ( ioc,TRUE,NULL );
                g_io_channel_unref (ioc);
@@ -387,15 +387,15 @@
 
 void Bzip2Add ( gchar *filename , XArchive *archive , gboolean flag )
 {
-    stream = fopen ( archive->path , "w" );
+       stream = fopen ( archive->path , "w" );
        if ( stream == NULL )
        {
                response = ShowGtkMessageDialog (GTK_WINDOW 
(MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't 
decompress the archive:"),g_strerror(errno));
-        done = FALSE;
-        return;                                        
+               done = FALSE;
+               return;                                 
        }
-    gtk_widget_show ( viewport2 );
-    gchar *command = g_strconcat ( flag ? "gzip -c " : "bzip2 -c " , filename 
, NULL );
+       gtk_widget_show ( viewport2 );
+       gchar *command = g_strconcat ( flag ? "gzip -c " : "bzip2 -c " , 
filename , NULL );
        archive->parse_output = 0;
        SpawnAsyncProcess ( archive , command , 0, 0);
        g_free ( command );
@@ -403,9 +403,9 @@
                return;
 
        GIOChannel *ioc = g_io_channel_unix_new ( output_fd );
-    g_io_channel_set_encoding (ioc, NULL , NULL);
+       g_io_channel_set_encoding (ioc, NULL , NULL);
        g_io_channel_set_flags ( ioc , G_IO_FLAG_NONBLOCK , NULL );
-    g_io_add_watch (ioc, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL, 
ExtractToDifferentLocation, stream );
+       g_io_add_watch (ioc, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL, 
ExtractToDifferentLocation, stream );
        g_child_watch_add ( archive->child_pid, 
(GChildWatchFunc)xa_watch_child, archive);
 }
 

Modified: xarchiver/trunk/src/callbacks.c
===================================================================
--- xarchiver/trunk/src/callbacks.c     2006-08-02 08:35:54 UTC (rev 22626)
+++ xarchiver/trunk/src/callbacks.c     2006-08-02 10:57:39 UTC (rev 22627)
@@ -193,7 +193,8 @@
                        }
                }
        }
-       if (archive->status != XA_ARCHIVESTATUS_EXTRACT || cli == FALSE)
+
+       if ( archive->status != XA_ARCHIVESTATUS_EXTRACT && archive->type != 
XARCHIVETYPE_BZIP2 && archive->type != XARCHIVETYPE_GZIP)
        {
                gtk_tree_view_set_model (GTK_TREE_VIEW(treeview1), model);
                g_object_unref (model);
@@ -1888,6 +1889,7 @@
        g_strfreev ( array );
        archive->full_path = full_path;
        archive->add_recurse = add_recurse;
+       archive->status = XA_ARCHIVESTATUS_IDLE;
 }
 
 gboolean key_press_function (GtkWidget *widget, GdkEventKey *event, gpointer 
data)

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to