| 40 | } |
| 41 | |
| 42 | void YACReaderHistoryController::updateHistory(const YACReaderLibrarySourceContainer &source) |
| 43 | { |
| 44 | // remove history from current index |
| 45 | if (!source.sourceModelIndex.isValid() && history.count() == 1) |
| 46 | return; |
| 47 | |
| 48 | int numElementsToRemove = history.count() - (currentFolderNavigation + 1); |
| 49 | while (numElementsToRemove > 0) { |
| 50 | numElementsToRemove--; |
| 51 | history.removeLast(); |
| 52 | } |
| 53 | |
| 54 | if (source != history.at(currentFolderNavigation)) { |
| 55 | history.append(source); |
| 56 | |
| 57 | emit enabledBackward(true); |
| 58 | currentFolderNavigation++; |
| 59 | } |
| 60 | |
| 61 | emit enabledForward(false); |
| 62 | } |
| 63 | |
| 64 | YACReaderLibrarySourceContainer YACReaderHistoryController::lastSourceContainer() |
| 65 | { |
no test coverage detected