Ejemplo n.º 1
0
Archivo: filegui.c Proyecto: CTU-OSP/mc
void
file_progress_show_source (file_op_context_t * ctx, const vfs_path_t * s_vpath)
{
    file_op_context_ui_t *ui;

    if (ctx == NULL || ctx->ui == NULL)
        return;

    ui = ctx->ui;

    if (s_vpath != NULL)
    {
        char *s;

        s = vfs_path_tokens_get (s_vpath, -1, 1);
        label_set_text (ui->src_file_label, _("Source"));
        label_set_text (ui->src_file, truncFileString (ui->op_dlg, s));
        g_free (s);
    }
    else
    {
        label_set_text (ui->src_file_label, "");
        label_set_text (ui->src_file, "");
    }
}
Ejemplo n.º 2
0
void
file_progress_show_source (FileOpContext * ctx, const vfs_path_t * s_vpath)
{
    FileOpContextUI *ui;

    g_return_if_fail (ctx != NULL);
    g_return_if_fail (ctx->ui != NULL);

    ui = ctx->ui;

    if (s_vpath != NULL)
    {
        char *s;

        s = vfs_path_tokens_get (s_vpath, -1, 1);
        label_set_text (ui->file_label[0], _("Source"));
        label_set_text (ui->file_string[0], truncFileString (ui, s));
        g_free (s);
    }
    else
    {
        label_set_text (ui->file_label[0], "");
        label_set_text (ui->file_string[0], "");
    }
}
Ejemplo n.º 3
0
/* *INDENT-OFF* */
START_PARAMETRIZED_TEST (test_vfs_path_tokens_get, test_vfs_path_tokens_get_ds)
/* *INDENT-ON* */
{
    /* given */
    vfs_path_t *vpath;
    char *actual_path;

    vpath = vfs_path_from_str_flags (data->input_path, VPF_NO_CANON);

    /* when */
    actual_path = vfs_path_tokens_get (vpath, data->input_start_position, data->input_length);

    /* then */
    mctest_assert_str_eq (actual_path, data->expected_path);

    g_free (actual_path);
    vfs_path_free (vpath);
}