comparison src/search.c @ 606:408f36d536a5

search_status_update(): slightly reduce code redundancy.
author zas_
date Thu, 08 May 2008 20:21:03 +0000
parents 905688aa2317
children 6c331d0ba9b6
comparison
equal deleted inserted replaced
605:651ae2be1031 606:408f36d536a5
264 gint t; 264 gint t;
265 gint s; 265 gint s;
266 gint64 t_bytes; 266 gint64 t_bytes;
267 gint64 s_bytes; 267 gint64 s_bytes;
268 gchar *tt; 268 gchar *tt;
269 gchar *ts;
270 269
271 t = search_result_count(sd, &t_bytes); 270 t = search_result_count(sd, &t_bytes);
272 s = search_result_selection_count(sd, &s_bytes); 271 s = search_result_selection_count(sd, &s_bytes);
272
273 tt = text_from_size_abrev(t_bytes);
273 274
274 if (s > 0) 275 if (s > 0)
275 { 276 {
276 tt = text_from_size_abrev(t_bytes); 277 gchar *ts = text_from_size_abrev(s_bytes);
277 ts = text_from_size_abrev(s_bytes);
278 buf = g_strdup_printf(_("%s, %d files (%s, %d)"), tt, t, ts, s); 278 buf = g_strdup_printf(_("%s, %d files (%s, %d)"), tt, t, ts, s);
279 g_free(tt);
280 g_free(ts); 279 g_free(ts);
281 } 280 }
282 else 281 else
283 { 282 {
284 tt = text_from_size_abrev(t_bytes);
285 buf = g_strdup_printf(_("%s, %d files"), tt, t); 283 buf = g_strdup_printf(_("%s, %d files"), tt, t);
286 g_free(tt); 284 }
287 } 285
286 g_free(tt);
288 287
289 gtk_label_set_text(GTK_LABEL(sd->label_status), buf); 288 gtk_label_set_text(GTK_LABEL(sd->label_status), buf);
290 g_free(buf); 289 g_free(buf);
291 } 290 }
292 291