Ticket #95: bug95.diff

File bug95.diff, 1.6 KB (added by hub__, 3 years ago)

Proposed patch

  • qt/lc_qpropertiesdialog.cpp

    commit d4a8e623065b513e6ef7a8ab5f8986cffdaf4339
    Author: Hubert Figuière <hub@figuiere.net>
    Date:   Wed Dec 4 14:20:57 2013 -0500
    
        Bug 95 - Fix bug with non ASCII in file properties: use UTF-8 both ways.
    
    diff --git a/qt/lc_qpropertiesdialog.cpp b/qt/lc_qpropertiesdialog.cpp
    index 2da2cc7..33f1539 100644
    a b lcQPropertiesDialog::lcQPropertiesDialog(QWidget *parent, void *data) : 
    2525
    2626        setWindowTitle(QString(tr("%1 Properties")).arg(options->Title));
    2727
    28         ui->descriptionEdit->setText(options->Description);
    29         ui->authorEdit->setText(options->Author);
    30         ui->commentsEdit->setText(options->Comments);
     28        ui->descriptionEdit->setText(QString::fromUtf8(options->Description));
     29        ui->authorEdit->setText(QString::fromUtf8(options->Author));
     30        ui->commentsEdit->setText(QString::fromUtf8(options->Comments));
    3131
    3232        if (options->BackgroundType == 2)
    3333                ui->imageRadio->setChecked(true);
    lcQPropertiesDialog::~lcQPropertiesDialog() 
    123123
    124124void lcQPropertiesDialog::accept()
    125125{
    126         strcpy(options->Description, ui->descriptionEdit->text().toLocal8Bit().data());
    127         strcpy(options->Author, ui->authorEdit->text().toLocal8Bit().data());
    128         strcpy(options->Comments, ui->commentsEdit->toPlainText().toLocal8Bit().data());
     126        strcpy(options->Description, ui->descriptionEdit->text().toUtf8().data());
     127        strcpy(options->Author, ui->authorEdit->text().toUtf8().data());
     128        strcpy(options->Comments, ui->commentsEdit->toPlainText().toUtf8().data());
    129129
    130130        if (ui->imageRadio->isChecked())
    131131                 options->BackgroundType = 2;