| 1871 | } |
| 1872 | |
| 1873 | bool MainWindow::checkFileForModification(ScintillaNext *editor) |
| 1874 | { |
| 1875 | qInfo(Q_FUNC_INFO); |
| 1876 | |
| 1877 | auto state = editor->checkFileForStateChange(); |
| 1878 | |
| 1879 | if (state == ScintillaNext::NoChange) { |
| 1880 | return false; |
| 1881 | } |
| 1882 | else if (state == ScintillaNext::Modified) { |
| 1883 | qInfo("ScintillaNext::Modified"); |
| 1884 | const QString filePath = editor->getFilePath(); |
| 1885 | auto reply = QMessageBox::question(this, tr("Reload File"), tr("<b>%1</b> has been modified by another program. Do you want to reload it?").arg(filePath)); |
| 1886 | |
| 1887 | if (reply == QMessageBox::Yes) { |
| 1888 | editor->reload(); |
| 1889 | } |
| 1890 | else { |
| 1891 | editor->omitModifications(); |
| 1892 | } |
| 1893 | } |
| 1894 | else if (state == ScintillaNext::Deleted) { |
| 1895 | qInfo("ScintillaNext::Deleted"); |
| 1896 | } |
| 1897 | else if (state == ScintillaNext::Restored) { |
| 1898 | qInfo("ScintillaNext::Restored"); |
| 1899 | } |
| 1900 | |
| 1901 | return true; |
| 1902 | } |
| 1903 | |
| 1904 | void MainWindow::showSaveErrorMessage(ScintillaNext *editor, QFileDevice::FileError error) |
| 1905 | { |
nothing calls this directly
no test coverage detected