src/documentmanager.cpp

changeset 334
083b0d8e220a
parent 333
07e65a4c6611
child 335
c5830bce1c23
equal deleted inserted replaced
333:07e65a4c6611 334:083b0d8e220a
193 if (info != nullptr) 193 if (info != nullptr)
194 { 194 {
195 QSaveFile file{info->path}; 195 QSaveFile file{info->path};
196 file.setDirectWriteFallback(true); 196 file.setDirectWriteFallback(true);
197 if (file.open(QSaveFile::WriteOnly)) { 197 if (file.open(QSaveFile::WriteOnly)) {
198 file.write(info->model->toPlainText().toUtf8()); 198 file.write(info->model->toPlainText().replace("\n", "\r\n").toUtf8());
199 const bool commitSucceeded = file.commit(); 199 const bool commitSucceeded = file.commit();
200 if (not commitSucceeded) { 200 if (not commitSucceeded) {
201 errors << QObject::tr("Could not save: %1").arg(file.errorString()); 201 errors << QObject::tr("Could not save: %1").arg(file.errorString());
202 return false; 202 return false;
203 } 203 }

mercurial