diff options
author | Alessio Treglia <alessio@debian.org> | 2013-02-10 10:18:21 +0000 |
---|---|---|
committer | Alessio Treglia <alessio@debian.org> | 2013-02-10 10:18:21 +0000 |
commit | 038de1a143b9775f37d4848f52c59af7cee66e36 (patch) | |
tree | 8d10a35c194be220b6cb2d1b2982546dbcef9480 /src/favorites.cpp | |
parent | 69d32924ffbfe2bb05d881a23af13b6070b9a9bd (diff) |
Imported Upstream version 0.8.3
Diffstat (limited to 'src/favorites.cpp')
-rw-r--r-- | src/favorites.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/favorites.cpp b/src/favorites.cpp index 7c344f5..e3b30d2 100644 --- a/src/favorites.cpp +++ b/src/favorites.cpp @@ -174,9 +174,25 @@ int Favorites::findFile(QString filename) { return -1; } +bool Favorites::anyItemAvailable() { + if (f_list.isEmpty()) return false; + + bool item_available = false; + for (int n = 0; n < f_list.count(); n++) { + if (!f_list[n].isSubentry()) { + item_available = true; + break; + } + } + + return item_available; +} + void Favorites::next() { qDebug("Favorites::next"); + if (!anyItemAvailable()) return; + int current = findFile(current_file); int i = current; @@ -197,6 +213,8 @@ void Favorites::next() { void Favorites::previous() { qDebug("Favorites::previous"); + if (!anyItemAvailable()) return; + int current = findFile(current_file); int i = current; |