Révision 8801fb5e original.cpp
original.cpp | ||
---|---|---|
267 | 267 |
|
268 | 268 |
void original::on_btnSave_clicked() |
269 | 269 |
{ |
270 |
|
|
270 |
QByteArray data; |
|
271 |
data.append(QString("name|%1\n").arg(ui->leTitre->text().trimmed())); |
|
272 |
data.append(QString("author|%1\n").arg(ui->leAuthor->text().trimmed())); |
|
273 |
data.append(QString("description|%1\n").arg(ui->leDesc->text().trimmed())); |
|
274 |
data.append(QString("date|%1\n").arg(ui->dateEdit->text().trimmed())); |
|
275 |
if(ui->leLogin->text().trimmed() != "") { |
|
276 |
data.append(QString("restricted_user|%1\n").arg(ui->leLogin->text().trimmed())); |
|
277 |
data.append(QString("restricted_password|%1\n").arg(ui->lePasswd->text().trimmed())); |
|
278 |
} |
|
279 |
QFileInfo fi(ui->treeWidget->currentItem()->data(1,0).toString()+"/info.txt"); |
|
280 |
qDebug() << "Ecriture de " << fi.absoluteFilePath(); |
|
281 |
QFile file(fi.absoluteFilePath()); |
|
282 |
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) |
|
283 |
return; |
|
284 |
QTextStream out(&file); |
|
285 |
out.setCodec("UTF-8"); |
|
286 |
out << data; |
|
287 |
file.close(); |
|
271 | 288 |
} |
Formats disponibles : Unified diff