Re: g_format_file_size_for_display()

2008-09-03 Thread Christian Neumair
Am Mittwoch, den 19.12.2007, 08:52 +0100 schrieb Sven Neumann:
 Hi,
 
 On Tue, 2007-12-18 at 17:14 -0600, Federico Mena Quintero wrote:
 
   char *g_format_file_size_for_display (goffset size);
   
   Ideally this one needs to take another parameter indicating
 whether you
   want 1kb = 1000 bytes or 1kb = 1024 bytes. 
  
  No, because then you'll have applications using either, and then
 someone
  will want to make them consistent and we'll get an option in the
 control
  center an an XSETTING, which is yet another thing we'll have to port
  over when moving from GConf to DConf, and it's just a big fat mess.

The issue seems to be a constant source of conflict, so why shouldn't we
add another preference? The dispute under

http://bugzilla.gnome.org/show_bug.cgi?id=550100 

proofs it. An environment variable would be enough, and if it was
outside the GLib name space it could even be used by console
applications (like ls).

 Yes, because this is a choice that the application developer needs to
 make, not the user. So this is never going to become am option in the
 control center or an XSETTING. We just need to make sure that the API
 docs give the application developer the information they need to make
 the right choice.

I'm not sure why application developers may want to enforce this
decision. Maybe you could give an example where it is important?

I tend to call it a cultural decision, i.e. something like a time format
or measurement units. Maybe it should be put into a LC_* environment
variable (cf. man locale)? That would at least make sense if it directly
depends on the country or origin of the user, rather than being “just” a
matter of taste.

best regards,
 Christian Neumair


-- 
Christian Neumair [EMAIL PROTECTED]

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2008-01-10 Thread Mathias Hasselmann

Am Dienstag, den 18.12.2007, 23:01 +0100 schrieb Sven Neumann:
 Hi,
 
 On Tue, 2007-12-18 at 16:45 -0500, David Zeuthen wrote:
  On Tue, 2007-12-18 at 14:50 -0600, Federico Mena Quintero wrote:
   Should this be called generically g_format_size_for_display()?  You
   could use it for more than file sizes (free RAM in gnome-system-monitor,
   etc.).
  
  It's here btw
  
  http://svn.gnome.org/viewvc/glib/trunk/glib/gfileutils.c?revision=6076view=markup
  
  char *g_format_file_size_for_display (goffset size);
  
  Ideally this one needs to take another parameter indicating whether you
  want 1kb = 1000 bytes or 1kb = 1024 bytes. 
 
 We should also decide then whether the displayed size should use MB or
 MiB, see http://en.wikipedia.org/wiki/Mebibyte and
 http://www.iec.ch/zone/si/si_bytes.htm

I am all for SI units, even it writing MiB could cause some users to
believe, we are too stupid to spell.

Seemingly random switching between 1000 and 1024 whouldn't really help -
I guess: Imagine some user wants to copy a 64 MiB file from some 1024 to
some 1000 scale media: WTF doesn't this 64 MB file (64 * 2^10 bytes) fit
on this 64 MB stick (64 * 10^6 bytes)?

Ciao,
Mathias
-- 
Mathias Hasselmann [EMAIL PROTECTED]
http://taschenorakel.de/


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-19 Thread Morten Welinder
The practical use of such a function is to give the user a general idea of
the size.  Hence a 2.4% (k), 4.9% (m), or 7.4% (g) difference will
not change the picture.

However, something people need the full story.  Therefore, the friendly
application using such a function should probably consider having a
tooltip telling the full story.  That would be a good time to show
things like read-only too.

Morten
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


g_format_file_size_for_display()

2007-12-18 Thread Federico Mena Quintero
Should this be called generically g_format_size_for_display()?  You
could use it for more than file sizes (free RAM in gnome-system-monitor,
etc.).

  Federico

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread David Zeuthen

On Tue, 2007-12-18 at 14:50 -0600, Federico Mena Quintero wrote:
 Should this be called generically g_format_size_for_display()?  You
 could use it for more than file sizes (free RAM in gnome-system-monitor,
 etc.).

It's here btw

http://svn.gnome.org/viewvc/glib/trunk/glib/gfileutils.c?revision=6076view=markup

char *g_format_file_size_for_display (goffset size);

Ideally this one needs to take another parameter indicating whether you
want 1kb = 1000 bytes or 1kb = 1024 bytes. 

The reason is that we want to generate nice display names in the volume
monitor; for ordinary media you want 1000 (to match the label on the
media); for optical discs you normally want 1024. gnome-vfs has this
terrible bug where it uses 1024 so you get the label 61.2 MB media
even when the media itself says 64MB. This is kinda like punching the
user right in the face. It's not a mistake we should make for the new
shiny gvfs stuff.

  David


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Kevin Fox
Computer Makers Sued Over Hard Drive Size

http://yro.slashdot.org/article.pl?sid=03/09/18/2245200

;)

On Tue, 2007-12-18 at 16:45 -0500, David Zeuthen wrote:
 On Tue, 2007-12-18 at 14:50 -0600, Federico Mena Quintero wrote:
  Should this be called generically g_format_size_for_display()?  You
  could use it for more than file sizes (free RAM in gnome-system-monitor,
  etc.).
 
 It's here btw
 
 http://svn.gnome.org/viewvc/glib/trunk/glib/gfileutils.c?revision=6076view=markup
 
 char *g_format_file_size_for_display (goffset size);
 
 Ideally this one needs to take another parameter indicating whether you
 want 1kb = 1000 bytes or 1kb = 1024 bytes. 
 
 The reason is that we want to generate nice display names in the volume
 monitor; for ordinary media you want 1000 (to match the label on the
 media); for optical discs you normally want 1024. gnome-vfs has this
 terrible bug where it uses 1024 so you get the label 61.2 MB media
 even when the media itself says 64MB. This is kinda like punching the
 user right in the face. It's not a mistake we should make for the new
 shiny gvfs stuff.
 
   David
 
 
 ___
 gtk-devel-list mailing list
 gtk-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-devel-list
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Sven Neumann
Hi,

On Tue, 2007-12-18 at 16:45 -0500, David Zeuthen wrote:
 On Tue, 2007-12-18 at 14:50 -0600, Federico Mena Quintero wrote:
  Should this be called generically g_format_size_for_display()?  You
  could use it for more than file sizes (free RAM in gnome-system-monitor,
  etc.).
 
 It's here btw
 
 http://svn.gnome.org/viewvc/glib/trunk/glib/gfileutils.c?revision=6076view=markup
 
 char *g_format_file_size_for_display (goffset size);
 
 Ideally this one needs to take another parameter indicating whether you
 want 1kb = 1000 bytes or 1kb = 1024 bytes. 

We should also decide then whether the displayed size should use MB or
MiB, see http://en.wikipedia.org/wiki/Mebibyte and
http://www.iec.ch/zone/si/si_bytes.htm


Sven


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread David Zeuthen

On Tue, 2007-12-18 at 23:01 +0100, Sven Neumann wrote:
 We should also decide then whether the displayed size should use MB or
 MiB, see http://en.wikipedia.org/wiki/Mebibyte and
 http://www.iec.ch/zone/si/si_bytes.htm

I think MiB would just go into the geekspeak_US translations, no? :-)

 David


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Paul LeoNerd Evans
On Tue, 18 Dec 2007 23:01:22 +0100
Sven Neumann [EMAIL PROTECTED] wrote:

 We should also decide then whether the displayed size should use MB or
 MiB, see http://en.wikipedia.org/wiki/Mebibyte and
 http://www.iec.ch/zone/si/si_bytes.htm

I for one would like to vote in favour of the kiB/MiB/etc.. scheme for
powers-of-2, reserving kB/MB/etc.. strictly for powers-of-10. Trying to
cuddle users by protecting them from the confusing MiB unit will only
lead to even more confusion about 1000 vs 1024. Better to be consistent
eveywhere, even if it means sometimes people have to learn what ki means.

-- 
Paul LeoNerd Evans

[EMAIL PROTECTED]
ICQ# 4135350   |  Registered Linux# 179460
http://www.leonerd.org.uk/


signature.asc
Description: PGP signature
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Paul LeoNerd Evans
On Tue, 18 Dec 2007 22:13:56 +
Paul LeoNerd Evans [EMAIL PROTECTED] wrote:

 I for one would like to vote in favour of the kiB/MiB/etc.. scheme for

Oops. Apparently it's KiB (capital 'K') to mean 2^10. How's that for
consistency? :)

-- 
Paul LeoNerd Evans

[EMAIL PROTECTED]
ICQ# 4135350   |  Registered Linux# 179460
http://www.leonerd.org.uk/


signature.asc
Description: PGP signature
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Mathias Hasselmann
Am Dienstag, den 18.12.2007, 23:01 +0100 schrieb Sven Neumann:
 Hi,
 
 On Tue, 2007-12-18 at 16:45 -0500, David Zeuthen wrote:
  On Tue, 2007-12-18 at 14:50 -0600, Federico Mena Quintero wrote:
   Should this be called generically g_format_size_for_display()?  You
   could use it for more than file sizes (free RAM in gnome-system-monitor,
   etc.).
  
  It's here btw
  
  http://svn.gnome.org/viewvc/glib/trunk/glib/gfileutils.c?revision=6076view=markup
  
  char *g_format_file_size_for_display (goffset size);
  
  Ideally this one needs to take another parameter indicating whether you
  want 1kb = 1000 bytes or 1kb = 1024 bytes. 
 
 We should also decide then whether the displayed size should use MB or
 MiB, see http://en.wikipedia.org/wiki/Mebibyte and
 http://www.iec.ch/zone/si/si_bytes.htm

I am all for SI units, even it writing MiB could cause some users to
believe, we are too stupid to spell.

Seemingly random switching between 1000 and 1024 whouldn't really help -
I guess: Imagine some user wants to copy a 64 MiB file from some 1024 to
some 1000 scale media: WTF doesn't this 64 MB file (64 * 2^10 bytes) fit
on this 64 MB stick (64 * 10^6 bytes)?

Ciao,
Mathias
-- 
Mathias Hasselmann [EMAIL PROTECTED]
Openismus GmbH: http://www.openismus.com/
Personal Site: http://taschenorakel.de/


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Dave Benson
On Tue, Dec 18, 2007 at 05:14:31PM -0600, Federico Mena Quintero wrote:
 Big deal :)  When you see 61.2 MB you think, oh, file system overhead!
 ripples in the time-space continuum.  Nobody cares about that.
 
 Back to my original question:  should this function be called
 g_format_size_for_display()?  It's not for files only.

I have no idea whether to use SI or computer units,
but the fact that there's debate suggests holding
off til there's more experience.

Once a few cut-n-pasted versions exist,
then you can decide if they are all the same...

- dave
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Federico Mena Quintero
On Tue, 2007-12-18 at 16:45 -0500, David Zeuthen wrote:

 char *g_format_file_size_for_display (goffset size);
 
 Ideally this one needs to take another parameter indicating whether you
 want 1kb = 1000 bytes or 1kb = 1024 bytes. 

No, because then you'll have applications using either, and then someone
will want to make them consistent and we'll get an option in the control
center an an XSETTING, which is yet another thing we'll have to port
over when moving from GConf to DConf, and it's just a big fat mess.

 The reason is that we want to generate nice display names in the
 volume
 monitor; for ordinary media you want 1000 (to match the label on the
 media); for optical discs you normally want 1024. gnome-vfs has this
 terrible bug where it uses 1024 so you get the label 61.2 MB media
 even when the media itself says 64MB. This is kinda like punching the
 user right in the face. It's not a mistake we should make for the new
 shiny gvfs stuff.

Big deal :)  When you see 61.2 MB you think, oh, file system overhead!
ripples in the time-space continuum.  Nobody cares about that.

Back to my original question:  should this function be called
g_format_size_for_display()?  It's not for files only.

[Who's the nitpicker: the one who asks for file sizes versus general
sizes or the one who asks about SI units vs. computer units...]

  Federico


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread JP Rosevear

On Tue, 2007-12-18 at 15:31 -0800, Dave Benson wrote:
 On Tue, Dec 18, 2007 at 05:14:31PM -0600, Federico Mena Quintero wrote:
  Big deal :)  When you see 61.2 MB you think, oh, file system overhead!
  ripples in the time-space continuum.  Nobody cares about that.
  
  Back to my original question:  should this function be called
  g_format_size_for_display()?  It's not for files only.
 
 I have no idea whether to use SI or computer units,
 but the fact that there's debate suggests holding
 off til there's more experience.

Actually, I see it as an argument for centralizing the call and
abstracting the decision away from apps.  Then whenever its tweaked you
fix it in one spot and it instantly propagates everywhere. 

 Once a few cut-n-pasted versions exist,
 then you can decide if they are all the same...

They are already a few like gnome-system-monitor, gnome-main-menu,
presumably nautilus.

-JP
-- 
JP Rosevear [EMAIL PROTECTED]
Novell, Inc.

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Brian J. Tarricone
David Zeuthen wrote:

 Ideally this one needs to take another parameter indicating whether you
 want 1kb = 1000 bytes or 1kb = 1024 bytes. 
 
 The reason is that we want to generate nice display names in the volume
 monitor; for ordinary media you want 1000 (to match the label on the
 media); for optical discs you normally want 1024. gnome-vfs has this
 terrible bug where it uses 1024 so you get the label 61.2 MB media
 even when the media itself says 64MB. This is kinda like punching the
 user right in the face. It's not a mistake we should make for the new
 shiny gvfs stuff.

Mistake?  That's correct behavior.  It's not our fault the storage 
companies lie and use base-10 kB/MB/GB when everyone else uses base-2, 
and in fact they've been successfully sued in the US for doing this. 
Reporting the *actual* size of the media in base-2 units is the right 
way to go everywhere.

Whether to use traditional kB/MB/GB or the (IMO somewhat ridiculous) SI 
KiB(which breaks the normal lowercase k = kilo convention for no 
reason)/MiB/GiB is another discussion.  (I'd vote no in that discussion, 
at any rate.)

-brian
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Matthias Clasen
We can make it _(kB), and then people can use
LANG=en_US.crazy-si-units if they really want that. Sounds like a case
for LC_MEASUREMENT, acutally.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: g_format_file_size_for_display()

2007-12-18 Thread Sven Neumann
Hi,

On Tue, 2007-12-18 at 17:14 -0600, Federico Mena Quintero wrote:

  char *g_format_file_size_for_display (goffset size);
  
  Ideally this one needs to take another parameter indicating whether you
  want 1kb = 1000 bytes or 1kb = 1024 bytes. 
 
 No, because then you'll have applications using either, and then someone
 will want to make them consistent and we'll get an option in the control
 center an an XSETTING, which is yet another thing we'll have to port
 over when moving from GConf to DConf, and it's just a big fat mess.

Yes, because this is a choice that the application developer needs to
make, not the user. So this is never going to become am option in the
control center or an XSETTING. We just need to make sure that the API
docs give the application developer the information they need to make
the right choice.

 Back to my original question:  should this function be called
 g_format_size_for_display()?  It's not for files only.

Yes, we all seem to agree that this function is useful for other things
than file sizes. But we should try to get it right. Otherwise it is
simply not going to be used and we force application developers to
invent their own function.


Sven


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list