| 1334 | } |
| 1335 | |
| 1336 | bool MainWindow::saveFile(ScintillaNext *editor) |
| 1337 | { |
| 1338 | if (editor->isSavedToDisk()) |
| 1339 | return true; |
| 1340 | |
| 1341 | if (!editor->isFile()) { |
| 1342 | // Switch to the editor and show the saveas dialog |
| 1343 | dockedEditor->switchToEditor(editor); |
| 1344 | return saveCurrentFileAsDialog(); |
| 1345 | } |
| 1346 | else { |
| 1347 | QFileDevice::FileError error = editor->save(); |
| 1348 | if (error == QFileDevice::NoError) { |
| 1349 | return true; |
| 1350 | } |
| 1351 | else { |
| 1352 | showSaveErrorMessage(editor, error); |
| 1353 | return false; |
| 1354 | } |
| 1355 | } |
| 1356 | } |
| 1357 | |
| 1358 | bool MainWindow::saveCurrentFileAsDialog() |
| 1359 | { |
nothing calls this directly
no test coverage detected