MCPcopy Create free account
hub / github.com/YACReader/yacreader / refreshRecentFilesActionList

Method refreshRecentFilesActionList

YACReader/main_window_viewer.cpp:856–874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856void 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
876void MainWindowViewer::clearRecentFiles()
877{

Callers

nothing calls this directly

Calls 4

openRecentListMethod · 0.80
getOpenRecentSizeMethod · 0.80
setTextMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected