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

Method updateHistory

YACReaderLibrary/yacreader_history_controller.cpp:42–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void 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
64YACReaderLibrarySourceContainer YACReaderHistoryController::lastSourceContainer()
65{

Callers 4

selectedFolderMethod · 0.80
selectedListMethod · 0.80
selectSubfolderMethod · 0.80

Calls 1

isValidMethod · 0.45

Tested by

no test coverage detected