1
1

* gdialogs.c: Use g_snprintf() instead of snprintf().

* gnome-file-property-dialog.c: Likewise.
* gprefs.c: Likewise.
Этот коммит содержится в:
Pavel Roskin 2001-07-11 15:14:45 +00:00
родитель 72a33a6190
Коммит 8432d4dd4a
4 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -1,3 +1,9 @@
2001-07-11 Pavel Roskin <proski@gnu.org>
* gdialogs.c: Use g_snprintf() instead of snprintf().
* gnome-file-property-dialog.c: Likewise.
* gprefs.c: Likewise.
2001-07-10 Pavel Roskin <proski@gnu.org> 2001-07-10 Pavel Roskin <proski@gnu.org>
* gscreen.c (panel_icon_list_select_icon): This function doesn't * gscreen.c (panel_icon_list_select_icon): This function doesn't

Просмотреть файл

@ -244,7 +244,7 @@ file_progress_show (FileOpContext *ctx, long done, long total)
if (total > 0) { if (total > 0) {
perc = (double) done / (double) total; perc = (double) done / (double) total;
snprintf (count, 9, "%3d%% ", (gint) (100.0 * perc)); g_snprintf (count, 9, "%3d%% ", (gint) (100.0 * perc));
gtk_label_set_text (GTK_LABEL (ui->file_label), count); gtk_label_set_text (GTK_LABEL (ui->file_label), count);
} }
while (gtk_events_pending ()) while (gtk_events_pending ())
@ -269,7 +269,7 @@ file_progress_show_count (FileOpContext *ctx, long done, long total)
if (ui->aborting) if (ui->aborting)
return FILE_ABORT; return FILE_ABORT;
snprintf (count, 100, "%ld/%ld ", done, total); g_snprintf (count, 100, "%ld/%ld ", done, total);
gtk_label_set_text (GTK_LABEL (ui->count_label), count); gtk_label_set_text (GTK_LABEL (ui->count_label), count);
while (gtk_events_pending ()) while (gtk_events_pending ())
gtk_main_iteration (); gtk_main_iteration ();
@ -484,7 +484,7 @@ file_progress_real_query_replace (FileOpContext *ctx, enum OperationMode mode, c
GNOME_STOCK_BUTTON_CANCEL, NULL); GNOME_STOCK_BUTTON_CANCEL, NULL);
gtk_window_set_position (GTK_WINDOW (qr_dlg), GTK_WIN_POS_MOUSE); gtk_window_set_position (GTK_WINDOW (qr_dlg), GTK_WIN_POS_MOUSE);
snprintf (msg, sizeof (msg)-1, _("The target file already exists: %s"), destname); g_snprintf (msg, sizeof (msg)-1, _("The target file already exists: %s"), destname);
label = gtk_label_new (msg); label = gtk_label_new (msg);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);

Просмотреть файл

@ -244,17 +244,17 @@ create_general_properties (GnomeFilePropertyDialog *fp_dlg)
|| S_ISREG (fp_dlg->st.st_mode) || S_ISREG (fp_dlg->st.st_mode)
|| S_ISLNK (fp_dlg->st.st_mode)) { || S_ISLNK (fp_dlg->st.st_mode)) {
if ((gint)fp_dlg->st.st_size < 1024) { if ((gint)fp_dlg->st.st_size < 1024) {
snprintf (buf, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); g_snprintf (buf, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size);
gen_string = g_strconcat (_("File Size: "), buf, _(" bytes"), NULL); gen_string = g_strconcat (_("File Size: "), buf, _(" bytes"), NULL);
} else if ((gint)fp_dlg->st.st_size < 1024 * 1024) { } else if ((gint)fp_dlg->st.st_size < 1024 * 1024) {
snprintf (buf, MC_MAXPATHLEN, "%.1f", (gfloat) fp_dlg->st.st_size / 1024.0); g_snprintf (buf, MC_MAXPATHLEN, "%.1f", (gfloat) fp_dlg->st.st_size / 1024.0);
snprintf (buf2, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); g_snprintf (buf2, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size);
gen_string = g_strconcat (_("File Size: "), buf, _(" KBytes ("), gen_string = g_strconcat (_("File Size: "), buf, _(" KBytes ("),
buf2, _(" bytes)"), NULL); buf2, _(" bytes)"), NULL);
} else { } else {
snprintf (buf, MC_MAXPATHLEN, "%.1f", g_snprintf (buf, MC_MAXPATHLEN, "%.1f",
(gfloat) fp_dlg->st.st_size / (1024.0 * 1024.0)); (gfloat) fp_dlg->st.st_size / (1024.0 * 1024.0));
snprintf (buf2, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); g_snprintf (buf2, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size);
gen_string = g_strconcat (_("File Size: "), buf, _(" MBytes ("), gen_string = g_strconcat (_("File Size: "), buf, _(" MBytes ("),
buf2, _(" bytes)"), NULL); buf2, _(" bytes)"), NULL);
} }

Просмотреть файл

@ -378,7 +378,7 @@ create_prop_int (PrefsDlg *dlg, Property *prop)
entry = gnome_entry_new (_(prop->label)); entry = gnome_entry_new (_(prop->label));
snprintf (buffer, 9, "%d", *( (int*) prop->property_variable)); g_snprintf (buffer, 9, "%d", *( (int*) prop->property_variable));
gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))), gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))),
buffer); buffer);