1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mageia-dev] What is Mageia's policy reagarding filesize display? (units/base 2 vs base 10)
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mageia-dev%40mageia.org?Subject=Re%3A%20%5BMageia-dev%5D%20What%20is%20Mageia%27s%20policy%20reagarding%20filesize%0A%20display%3F%20%28units/base%202%20vs%20base%2010%29&In-Reply-To=%3CCAOPHaVS2YixRiPxhck8wW7Ox6OO8WgCAKHfftCbDsPq6ZUAeiw%40mail.gmail.com%3E">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="016850.html">
<LINK REL="Next" HREF="016851.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mageia-dev] What is Mageia's policy reagarding filesize display? (units/base 2 vs base 10)</H1>
<B>Christian Lohmaier</B>
<A HREF="mailto:mageia-dev%40mageia.org?Subject=Re%3A%20%5BMageia-dev%5D%20What%20is%20Mageia%27s%20policy%20reagarding%20filesize%0A%20display%3F%20%28units/base%202%20vs%20base%2010%29&In-Reply-To=%3CCAOPHaVS2YixRiPxhck8wW7Ox6OO8WgCAKHfftCbDsPq6ZUAeiw%40mail.gmail.com%3E"
TITLE="[Mageia-dev] What is Mageia's policy reagarding filesize display? (units/base 2 vs base 10)">lohmaier+mageia at googlemail.com
</A><BR>
<I>Tue Jun 26 19:01:30 CEST 2012</I>
<P><UL>
<LI>Previous message: <A HREF="016850.html">[Mageia-dev] What is Mageia's policy reagarding filesize display? (units/base 2 vs base 10)
</A></li>
<LI>Next message: <A HREF="016851.html">[Mageia-dev] What is Mageia's policy reagarding filesize display? (units/base 2 vs base 10)
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#16854">[ date ]</a>
<a href="thread.html#16854">[ thread ]</a>
<a href="subject.html#16854">[ subject ]</a>
<a href="author.html#16854">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>On Tue, Jun 26, 2012 at 6:13 PM, Oliver Burger
<<A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">oliver.bgr at googlemail.com</A>> wrote:
><i> At the moment we have
</I>><i> the bash showing values in base 2 with the unit K,
</I>><i> dolphin showing them in base 2 with the unit KiB,
</I>><i> pcmanfm showing them in base 2 with the unit KB.
</I>><i>
</I>><i> So patching nautilus to use base 2 woul make for a more common behaviour of
</I>><i> the distro, but it will create work for our GNOME maintainer since he would
</I>><i> have to maintain that patch for every future version.
</I>
To get a better idea of the "effort" it would take: This is the patch
diff -ru nautilus-3.4.1_orig/libnautilus-private/nautilus-file.c
nautilus-3.4.1/libnautilus-private/nautilus-file.c
--- nautilus-3.4.1_orig/libnautilus-private/nautilus-file.c 2012-04-13
19:01:03.000000000 +0200
+++ nautilus-3.4.1/libnautilus-private/nautilus-file.c 2012-06-26
16:13:48.649538611 +0200
@@ -5847,7 +5847,7 @@
if (file->details->size == -1) {
return NULL;
}
- return g_format_size (file->details->size);
+ return g_format_size_full (file->details->size, G_FORMAT_SIZE_IEC_UNITS);
}
/**
@@ -5885,7 +5885,7 @@
return NULL;
}
- return g_format_size_full (file->details->size, G_FORMAT_SIZE_LONG_FORMAT);
+ return g_format_size_full (file->details->size,
G_FORMAT_SIZE_IEC_UNITS & G_FORMAT_SIZE_LONG_FORMAT);
}
@@ -5945,7 +5945,7 @@
* directly if desired.
*/
if (report_size) {
- return g_format_size (total_size);
+ return g_format_size_full (total_size, G_FORMAT_SIZE_IEC_UNITS);
}
return format_item_count_for_display (report_directory_count
@@ -6675,7 +6675,7 @@
res = NULL;
if (file->details->free_space != (guint64)-1) {
- res = g_format_size (file->details->free_space);
+ res = g_format_size_full (file->details->free_space,
G_FORMAT_SIZE_IEC_UNITS);
}
return res;
diff -ru nautilus-3.4.1_orig/src/nautilus-view.c
nautilus-3.4.1/src/nautilus-view.c
--- nautilus-3.4.1_orig/src/nautilus-view.c 2012-04-13 19:01:03.000000000 +0200
+++ nautilus-3.4.1/src/nautilus-view.c 2012-06-26 16:13:48.652538574 +0200
@@ -2826,7 +2826,7 @@
if (non_folder_size_known) {
char *size_string;
- size_string = g_format_size (non_folder_size);
+ size_string = g_format_size_full (non_folder_size, G_FORMAT_SIZE_IEC_UNITS);
/* This is marked for translation in case a localiser
* needs to use something other than parentheses. The
* first message gives the number of items selected;
><i> And it could break any other thing in GNOME since GNOME apps are quite
</I>><i> interweaved with one another and you never know, what app uses nautilus in
</I>><i> parts for what.
</I>
See above. It is not a massive change in the internals of nautilus.
This is nautilus-only.
And unless glib breaks its API the patch will continue to work. Both
g_format_size and g_format_size_full return a human-readable string,
just the default units differ. If you'd use
g_format_size(size); is the very same as
g_format_size_full(size, G_FORMAT_SIZE_DEFAULT)
So this is purely switching the base, nothing else. No custom "hacks",
no black magic.
ciao
Christian
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="016850.html">[Mageia-dev] What is Mageia's policy reagarding filesize display? (units/base 2 vs base 10)
</A></li>
<LI>Next message: <A HREF="016851.html">[Mageia-dev] What is Mageia's policy reagarding filesize display? (units/base 2 vs base 10)
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#16854">[ date ]</a>
<a href="thread.html#16854">[ thread ]</a>
<a href="subject.html#16854">[ subject ]</a>
<a href="author.html#16854">[ author ]</a>
</LI>
</UL>
<hr>
<a href="https://www.mageia.org/mailman/listinfo/mageia-dev">More information about the Mageia-dev
mailing list</a><br>
</body></html>
|