MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / setMostRecentlyUsedFile

Method setMostRecentlyUsedFile

src/gui/main_window.cpp:486–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484}
485
486void 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
506void MainWindow::setHasUnsavedChanges(bool value)
507{

Callers

nothing calls this directly

Calls 10

setValueMethod · 0.80
getSettingCachedMethod · 0.80
eraseMethod · 0.80
QFileInfoClass · 0.50
QSettingsClass · 0.50
isEmptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setSettingMethod · 0.45

Tested by

no test coverage detected