Author: colossus
Date: 2007-08-10 20:14:11 +0000 (Fri, 10 Aug 2007)
New Revision: 25962

Modified:
   xarchiver/trunk/src/interface.c
   xarchiver/trunk/src/pref_dialog.c
   xarchiver/trunk/src/rar.c
   xarchiver/trunk/src/support.c
Log:
Fixed rar archive navigation.
The treeview uses rubber-banding now.
Modified code in src/support.c so to fix a memory leak.
Modified string in src/pref_dialog.c.


Modified: xarchiver/trunk/src/interface.c
===================================================================
--- xarchiver/trunk/src/interface.c     2007-08-09 21:38:30 UTC (rev 25961)
+++ xarchiver/trunk/src/interface.c     2007-08-10 20:14:11 UTC (rev 25962)
@@ -594,6 +594,7 @@
        gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW 
(archive->treeview),(GtkTreeViewSearchEqualFunc) treeview_select_search, NULL, 
NULL);
        GtkTreeSelection *sel = gtk_tree_view_get_selection( GTK_TREE_VIEW 
(archive->treeview) );
        gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
+       gtk_tree_view_set_rubber_banding(GTK_TREE_VIEW(archive->treeview),TRUE);
 
        gtk_drag_source_set (archive->treeview, GDK_BUTTON1_MASK, drag_targets, 
1, GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK);
        g_signal_connect ((gpointer) sel,                               
"changed",              G_CALLBACK (xa_activate_delete_and_view), NULL);

Modified: xarchiver/trunk/src/pref_dialog.c
===================================================================
--- xarchiver/trunk/src/pref_dialog.c   2007-08-09 21:38:30 UTC (rev 25961)
+++ xarchiver/trunk/src/pref_dialog.c   2007-08-10 20:14:11 UTC (rev 25962)
@@ -51,6 +51,7 @@
        
        prefs_data->prefs_liststore = gtk_list_store_new ( 3, GDK_TYPE_PIXBUF, 
G_TYPE_STRING, G_TYPE_UINT);
        gtk_list_store_append (prefs_data->prefs_liststore, &iter);
+       //TODO: fix the absolute path
        icon_pixbuf = gdk_pixbuf_new_from_file 
("./pixmaps/xarchiver-behaviour.svg", NULL);
        gtk_list_store_set (prefs_data->prefs_liststore, &iter, 0, icon_pixbuf, 
1, _("Behaviour"),2,0,-1);
        g_object_unref (icon_pixbuf);
@@ -245,7 +246,7 @@
        gtk_table_attach (GTK_TABLE (table2), 
prefs_data->combo_prefered_temp_dir, 1, 2, 2, 3,
                      (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_SHRINK), 0, 0);
-       prefs_data->check_save_geometry = gtk_check_button_new_with_mnemonic 
(_("Save window geometry on exit"));
+       prefs_data->check_save_geometry = gtk_check_button_new_with_mnemonic 
(_("Save window geometry"));
        gtk_table_attach (GTK_TABLE (table2), prefs_data->check_save_geometry, 
0, 2, 3, 4,
                      (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_SHRINK), 0, 0);
@@ -344,7 +345,7 @@
 void xa_prefs_load_options(Prefs_dialog_data *prefs_data)
 {
        gint *coords = NULL;
-       guint coords_len;
+       guint coords_len = 0;
        gchar *config_dir = NULL;
        gchar *xarchiver_config_dir = NULL;
        GKeyFile *xa_key_file = g_key_file_new();

Modified: xarchiver/trunk/src/rar.c
===================================================================
--- xarchiver/trunk/src/rar.c   2007-08-09 21:38:30 UTC (rev 25961)
+++ xarchiver/trunk/src/rar.c   2007-08-10 20:14:11 UTC (rev 25962)
@@ -99,13 +99,15 @@
                        last_line = TRUE;
                        return;
                }
-               line[linesize - 1] = '\0';
-               filename = g_strdup(line+1);
+               line++;
+               line[linesize - 2] = '\0';
+               filename = g_strdup(line);
                read_filename = TRUE;
        }
        else
        {
-               /* size */
+               linesize = strlen(line);
+               /* Size */
                for(n=0; n < linesize && line[n] == ' '; n++);
                a = n;
                for(; n < linesize && line[n] != ' '; n++);
@@ -114,7 +116,7 @@
                i++;
                n++;
                
-               /* Packed */
+               /* Compressed */
                for(; n < linesize && line[n] == ' '; n++);
                a = n;
                for(; n < linesize && line[n] != ' '; n++);
@@ -150,11 +152,13 @@
                i++;
                n++;
 
-               /* Attr */
+               /* Permissions */
                for(; n < linesize && line[n] == ' '; n++);
                a = n;
                for(; n < linesize && line[n] != ' '; n++);
                line[n] = '\0';
+               if ((line+a)[0] == 'd')
+                       dir = TRUE;
                item[i] = line + a;
                i++;
                n++;
@@ -183,9 +187,13 @@
                for(; n < linesize && line[n] != ' ' && line[n] != '\n'; n++);
                line[n] = '\0';
                item[i] = line + a;
-               i++;
-               n++;
 
+               if (dir)
+               {
+                       gchar *filename_with_slash = g_strconcat 
(filename,"/",NULL);
+                       g_free (filename);
+                       filename = filename_with_slash;
+               }
                entry = xa_set_archive_entries_for_each_row 
(archive,filename,encrypted,item);
                g_free(filename);
                read_filename = FALSE;

Modified: xarchiver/trunk/src/support.c
===================================================================
--- xarchiver/trunk/src/support.c       2007-08-09 21:38:30 UTC (rev 25961)
+++ xarchiver/trunk/src/support.c       2007-08-10 20:14:11 UTC (rev 25962)
@@ -27,30 +27,21 @@
 
 GtkWidget *xa_main_window_find_image(gchar *filename, GtkIconSize size)
 {
-       GError *error = NULL;
     GtkWidget *file_image;
        gchar *path;
        GdkPixbuf *file_pixbuf = NULL;
        path = g_strconcat(DATADIR, "/pixmaps/xarchiver/", filename, NULL);
-       file_pixbuf = gdk_pixbuf_new_from_file (path, &error);
+       file_pixbuf = gdk_pixbuf_new_from_file (path, NULL);
        g_free (path);
-       if ( file_pixbuf == NULL )
-       {
-               /* perhaps xarchiver has not been installed and is being 
executed from source dir */
-               g_free (error);
-               error = NULL;
-               path = g_strconcat("./pixmaps/", filename, NULL);
-               file_pixbuf = gdk_pixbuf_new_from_file (path, &error);
-               g_free(path);
-    }
-    if (file_pixbuf)
-               file_image = gtk_image_new_from_pixbuf (file_pixbuf);
+
+       if (file_pixbuf == NULL)
+               file_image = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, 
size);
     else
        {
-               g_free(error);
-               file_image = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, 
size);
-    }
-    g_object_unref (file_pixbuf);
+               file_image = gtk_image_new_from_pixbuf (file_pixbuf);
+           g_object_unref (file_pixbuf);
+       }
+
     return file_image;
 }
 

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

Reply via email to