mirror of
https://github.com/MidnightCommander/mc
synced 2025-02-09 03:44:20 +03:00
src/filemanager/filegui.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
6fb25ed8ce
commit
04e26ca78b
@ -107,7 +107,9 @@
|
||||
static int
|
||||
statfs (char const *filename, struct fs_info *buf)
|
||||
{
|
||||
dev_t device = dev_for_path (filename);
|
||||
dev_t device;
|
||||
|
||||
device = dev_for_path (filename);
|
||||
|
||||
if (device < 0)
|
||||
{
|
||||
@ -332,6 +334,7 @@ static void
|
||||
file_frmt_time (char *buffer, double eta_secs)
|
||||
{
|
||||
int eta_hours, eta_mins, eta_s;
|
||||
|
||||
eta_hours = (int) (eta_secs / (60 * 60));
|
||||
eta_mins = (int) ((eta_secs - (eta_hours * 60 * 60)) / 60);
|
||||
eta_s = (int) (eta_secs - (eta_hours * 60 * 60 + eta_mins * 60));
|
||||
@ -344,11 +347,13 @@ static void
|
||||
file_eta_prepare_for_show (char *buffer, double eta_secs, gboolean always_show)
|
||||
{
|
||||
char _fmt_buff[BUF_TINY];
|
||||
|
||||
if (eta_secs <= 0.5 && !always_show)
|
||||
{
|
||||
*buffer = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
if (eta_secs <= 0.5)
|
||||
eta_secs = 1;
|
||||
file_frmt_time (_fmt_buff, eta_secs);
|
||||
@ -361,17 +366,11 @@ static void
|
||||
file_bps_prepare_for_show (char *buffer, long bps)
|
||||
{
|
||||
if (bps > 1024 * 1024)
|
||||
{
|
||||
g_snprintf (buffer, BUF_TINY, _("%.2f MB/s"), bps / (1024 * 1024.0));
|
||||
}
|
||||
else if (bps > 1024)
|
||||
{
|
||||
g_snprintf (buffer, BUF_TINY, _("%.2f KB/s"), bps / 1024.0);
|
||||
}
|
||||
else if (bps > 1)
|
||||
{
|
||||
g_snprintf (buffer, BUF_TINY, _("%ld B/s"), bps);
|
||||
}
|
||||
else
|
||||
*buffer = '\0';
|
||||
}
|
||||
@ -411,7 +410,7 @@ overwrite_query_dialog (file_op_context_t * ctx, enum OperationMode mode)
|
||||
int value; /* 0 for labels */
|
||||
} rd_widgets[] =
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
/* *INDENT-OFF* */
|
||||
/* 0 */
|
||||
{ N_("Target file already exists!"), 3, 4, WPOS_KEEP_TOP | WPOS_CENTER_HORZ, 0 },
|
||||
/* 1 */
|
||||
@ -442,7 +441,7 @@ overwrite_query_dialog (file_op_context_t * ctx, enum OperationMode mode)
|
||||
{ N_("If &size differs"), 12, 28, WPOS_KEEP_DEFAULT, REPLACE_SIZE },
|
||||
/* 14 */
|
||||
{ N_("&Abort"), 14, 25, WPOS_KEEP_TOP | WPOS_CENTER_HORZ, REPLACE_ABORT }
|
||||
/* *INDENT-ON* */
|
||||
/* *INDENT-ON* */
|
||||
};
|
||||
|
||||
const size_t num = G_N_ELEMENTS (rd_widgets);
|
||||
@ -601,7 +600,8 @@ static gboolean
|
||||
is_wildcarded (const char *p)
|
||||
{
|
||||
gboolean escaped = FALSE;
|
||||
for (; *p; p++)
|
||||
|
||||
for (; *p != '\0'; p++)
|
||||
{
|
||||
if (*p == '\\')
|
||||
{
|
||||
@ -908,9 +908,7 @@ file_progress_show (file_op_context_t * ctx, off_t done, off_t total,
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_snprintf (buffer, sizeof (buffer), "%s", stalled_msg);
|
||||
}
|
||||
|
||||
label_set_text (ui->progress_file_label, buffer);
|
||||
}
|
||||
@ -927,6 +925,7 @@ file_progress_show_count (file_op_context_t * ctx, size_t done, size_t total)
|
||||
return;
|
||||
|
||||
ui = ctx->ui;
|
||||
|
||||
if (ui->total_files_processed_label == NULL)
|
||||
return;
|
||||
|
||||
@ -983,7 +982,6 @@ file_progress_show_total (file_op_total_context_t * tctx, file_op_context_t * ct
|
||||
g_snprintf (buffer, sizeof (buffer), _("Time: %s %s"), buffer2, buffer3);
|
||||
else
|
||||
{
|
||||
|
||||
file_bps_prepare_for_show (buffer4, (long) tctx->bps);
|
||||
g_snprintf (buffer, sizeof (buffer), _("Time: %s %s (%s)"), buffer2, buffer3,
|
||||
buffer4);
|
||||
@ -1006,6 +1004,7 @@ file_progress_show_total (file_op_total_context_t * tctx, file_op_context_t * ct
|
||||
if (ui->total_bytes_label != NULL)
|
||||
{
|
||||
size_trunc_len (buffer2, 5, tctx->copied_bytes, 0, panels_options.kilobyte_si);
|
||||
|
||||
if (!ctx->progress_totals_computed)
|
||||
g_snprintf (buffer, sizeof (buffer), _(" Total: %s "), buffer2);
|
||||
else
|
||||
@ -1266,10 +1265,7 @@ file_mask_dialog (file_op_context_t * ctx, FileOperation operation,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ctx->follow_links)
|
||||
ctx->stat_func = mc_stat;
|
||||
else
|
||||
ctx->stat_func = mc_lstat;
|
||||
ctx->stat_func = ctx->follow_links ? mc_stat : mc_lstat;
|
||||
|
||||
if (ctx->op_preserve)
|
||||
{
|
||||
@ -1324,7 +1320,9 @@ file_mask_dialog (file_op_context_t * ctx, FileOperation operation,
|
||||
ctx->dest_mask = dest_dir;
|
||||
else
|
||||
ctx->dest_mask++;
|
||||
|
||||
orig_mask = ctx->dest_mask;
|
||||
|
||||
if (*ctx->dest_mask == '\0'
|
||||
|| (!ctx->dive_into_subdirs && !is_wildcarded (ctx->dest_mask)
|
||||
&& (!only_one
|
||||
@ -1338,12 +1336,15 @@ file_mask_dialog (file_op_context_t * ctx, FileOperation operation,
|
||||
ctx->dest_mask = g_strdup (ctx->dest_mask);
|
||||
*orig_mask = '\0';
|
||||
}
|
||||
|
||||
if (*dest_dir == '\0')
|
||||
{
|
||||
g_free (dest_dir);
|
||||
dest_dir = g_strdup ("./");
|
||||
}
|
||||
|
||||
vfs_path_free (vpath);
|
||||
|
||||
if (val == B_USER)
|
||||
*do_bg = TRUE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user