| 484 | } |
| 485 | |
| 486 | void MainWindow::setMostRecentlyUsedFile(const QString& path) |
| 487 | { |
| 488 | if (!path.isEmpty()) |
| 489 | { |
| 490 | Settings& settings = Settings::getInstance(); |
| 491 | |
| 492 | // Update least recently used directory |
| 493 | const QString open_directory = QFileInfo(path).canonicalPath(); |
| 494 | QSettings().setValue(QString::fromLatin1("openFileDirectory"), open_directory); |
| 495 | |
| 496 | // Update recent file lists |
| 497 | QStringList files = settings.getSettingCached(Settings::General_RecentFilesList).toStringList(); |
| 498 | files.removeAll(path); |
| 499 | files.prepend(path); |
| 500 | if (files.size() > max_recent_files) |
| 501 | files.erase(files.begin() + max_recent_files, files.end()); |
| 502 | settings.setSetting(Settings::General_RecentFilesList, files); |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | void MainWindow::setHasUnsavedChanges(bool value) |
| 507 | { |
nothing calls this directly
no test coverage detected