| 93 | } |
| 94 | |
| 95 | void RecentFilesMenu::add(const String& filename) |
| 96 | { |
| 97 | // find out absolute path |
| 98 | String tmp = File::absolutePath(filename); |
| 99 | |
| 100 | // remove the new file if already in the recent list and prepend it |
| 101 | recent_files_.removeAll(tmp.toQString()); |
| 102 | recent_files_.prepend(tmp.toQString()); |
| 103 | |
| 104 | // remove those files exceeding the defined number |
| 105 | while (recent_files_.size() > max_entries_) |
| 106 | { |
| 107 | recent_files_.removeLast(); |
| 108 | } |
| 109 | sync_(); |
| 110 | } |
| 111 | |
| 112 | void RecentFilesMenu::itemClicked_() |
| 113 | { |