Mercurial > pidgin
comparison src/util.c @ 5826:bd0d0e89cac3
[gaim-migrate @ 6256]
You can once again set your buddy icon. Of course, you* haven't been using
CVS, so you've always been able to set your buddy icon.
* Gaim developers not applicable
committer: Tailor Script <tailor@pidgin.im>
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Tue, 10 Jun 2003 01:09:26 +0000 |
| parents | dae79aefac8d |
| children | 059d95c67cda |
comparison
equal
deleted
inserted
replaced
| 5825:729e688fd2e7 | 5826:bd0d0e89cac3 |
|---|---|
| 1203 ret = g_strjoinv(replacement, split); | 1203 ret = g_strjoinv(replacement, split); |
| 1204 g_strfreev(split); | 1204 g_strfreev(split); |
| 1205 | 1205 |
| 1206 return ret; | 1206 return ret; |
| 1207 } | 1207 } |
| 1208 | |
| 1209 char *gaim_get_size_string(size_t size) | |
| 1210 { | |
| 1211 static const char *size_str[4] = { "bytes", "KB", "MB", "GB" }; | |
| 1212 float size_mag; | |
| 1213 int size_index = 0; | |
| 1214 | |
| 1215 if (size == -1) { | |
| 1216 return g_strdup(_("Calculating...")); | |
| 1217 } | |
| 1218 else if (size == 0) { | |
| 1219 return g_strdup(_("Unknown.")); | |
| 1220 } | |
| 1221 else { | |
| 1222 size_mag = (float)size; | |
| 1223 | |
| 1224 while ((size_index < 4) && (size_mag > 1024)) { | |
| 1225 size_mag /= 1024; | |
| 1226 size_index++; | |
| 1227 } | |
| 1228 | |
| 1229 return g_strdup_printf("%.2f %s", size_mag, size_str[size_index]); | |
| 1230 } | |
| 1231 } |
