gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUnet-developers] human size patch


From: Christian Grothoff
Subject: Re: [GNUnet-developers] human size patch
Date: Wed, 3 May 2006 12:23:09 -0700
User-agent: KMail/1.9.1

On Wednesday 03 May 2006 03:02, Milan wrote:
> That's done too. I now use asprintf from glibc, and I put the
> getHumanSize function in string.c in gnunet-util lib. If you think
> there's a better file to put it in, please feel free to do it.

string.c is fine.

> In order to sort files by real size, I need to pass a callback function
> to free an integer (tricky issues from GTK+). I used the free() function
> instead of the FREE() macro because it wasn't working with the macro. Is
> this a problem ? Is there a workaround. Indeed, this is really
> insignificant, because I free 3 int so 6 bytes when  the GtkTreeView are
> closed, and they would have been freed automatically when gnunet-gtk
> stops. But let's be clean...

Eh, that's not quite the right way to do it.  You don't need to define a sort 
function.  All that needed changing was 

1228c1251
<                                             "text", NAMESPACE_SIZE,
---
>                                             "text", NAMESPACE_HSIZE,

to change the display to the human-readable version.  If you then do NOT 
change

1235c1265
<   gtk_tree_view_column_set_sort_column_id(column, NAMESPACE_SIZE);
---
>   gtk_tree_view_column_set_sort_column_id(column, NAMESPACE_HSIZE);

the sorting of the now human-readable column is done using the actual sizes -- 
no need to define a sort function for those.

> I saw that gnunet-gtk has been improved recently (libnotify, resizing
> columns and ordering, downloading from URI, showing the extracted
> keywords before insertion...). This is just great !

Except that I've never seen libnotify work on my system ;-).  And showing 
extracted keywords before insertion already worked in 0.7.0 (at least for 
me).

Christian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]