diff options
Diffstat (limited to 'tabbrowsinghistory.cpp')
| -rw-r--r-- | tabbrowsinghistory.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tabbrowsinghistory.cpp b/tabbrowsinghistory.cpp index 289d529..435bca7 100644 --- a/tabbrowsinghistory.cpp +++ b/tabbrowsinghistory.cpp @@ -41,6 +41,24 @@ QUrl TabBrowsingHistory::get(const QModelIndex &index) const return history.at(index.row()); } +QModelIndex TabBrowsingHistory::oneForward(QModelIndex index) const +{ + if(not index.isValid()) + return QModelIndex{}; + if(index.row() >= history.size() - 1) + return QModelIndex{}; + return createIndex(index.row() + 1, index.column()); +} + +QModelIndex TabBrowsingHistory::oneBackward(QModelIndex index) const +{ + if(not index.isValid()) + return QModelIndex{}; + if(index.row() == 0) + return QModelIndex{}; + return createIndex(index.row() - 1, index.column()); +} + int TabBrowsingHistory::rowCount(const QModelIndex &parent) const { return history.size(); |
