| 251 | } |
| 252 | |
| 253 | ScintillaNext* SessionManager::loadFileDetails(QSettings &settings) |
| 254 | { |
| 255 | qInfo(Q_FUNC_INFO); |
| 256 | |
| 257 | const QString filePath = settings.value("FilePath").toString(); |
| 258 | |
| 259 | qDebug("Session file: \"%s\"", qUtf8Printable(filePath)); |
| 260 | |
| 261 | ScintillaNext *editor = app->getEditorManager()->getEditorByFilePath(filePath); |
| 262 | if (editor != Q_NULLPTR) { |
| 263 | qDebug(" file is already open, ignoring"); |
| 264 | return Q_NULLPTR; |
| 265 | } |
| 266 | |
| 267 | if (QFileInfo::exists(filePath)) { |
| 268 | editor = ScintillaNext::fromFile(filePath); |
| 269 | |
| 270 | app->getEditorManager()->manageEditor(editor); |
| 271 | |
| 272 | loadEditorViewDetails(editor, settings); |
| 273 | |
| 274 | return editor; |
| 275 | } |
| 276 | else { |
| 277 | qDebug(" no longer exists on disk, ignoring"); |
| 278 | return Q_NULLPTR; |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | void SessionManager::storeUnsavedFileDetails(ScintillaNext *editor, QSettings &settings) |
| 283 | { |
nothing calls this directly
no test coverage detected