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 } |