| 854 | } |
| 855 | |
| 856 | void MainWindowViewer::refreshRecentFilesActionList() |
| 857 | { |
| 858 | QStringList recentFilePaths = Configuration::getConfiguration().openRecentList(); |
| 859 | |
| 860 | // TODO: Replace limit with something configurable |
| 861 | int iteration = (recentFilePaths.size() < Configuration::getConfiguration().getOpenRecentSize()) |
| 862 | ? recentFilePaths.size() |
| 863 | : Configuration::getConfiguration().getOpenRecentSize(); |
| 864 | for (int i = 0; i < iteration; i++) { |
| 865 | QString strippedName = QFileInfo(recentFilePaths.at(i)).fileName(); |
| 866 | recentFilesActionList.at(i)->setText(strippedName); |
| 867 | recentFilesActionList.at(i)->setData(recentFilePaths.at(i)); |
| 868 | recentFilesActionList.at(i)->setVisible(true); |
| 869 | } |
| 870 | |
| 871 | for (int i = iteration; i < Configuration::getConfiguration().getOpenRecentSize(); i++) { |
| 872 | recentFilesActionList.at(i)->setVisible(false); |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | void MainWindowViewer::clearRecentFiles() |
| 877 | { |
nothing calls this directly
no test coverage detected