| 26 | static std::vector<IRCode *> recent_ircodes; |
| 27 | |
| 28 | void addToRecentCodes(IRCode *ircode) { |
| 29 | // copy ircode -> recent_ircodes |
| 30 | // if code exist in recent codes do not save it |
| 31 | for (auto recent_ircode : recent_ircodes) { |
| 32 | if (recent_ircode->filepath == ircode->filepath) { return; } |
| 33 | } |
| 34 | |
| 35 | IRCode *ircode_copy = new IRCode(ircode); |
| 36 | recent_ircodes.insert(recent_ircodes.begin(), ircode_copy); |
| 37 | |
| 38 | if (recent_ircodes.size() > 16) { // cycle |
| 39 | delete recent_ircodes.back(); |
| 40 | recent_ircodes.pop_back(); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | void selectRecentIrMenu() { |
| 45 | // show menu with filenames |
no test coverage detected