[Scummvm-git-logs] scummvm master -> 4af395ebb9ccf9f73a362663016a5d26078d4a20
digitall
noreply at scummvm.org
Sat Mar 30 17:27:09 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4af395ebb9 GUI: Jamnitorial Cleanup of Code Formatting
Commit: 4af395ebb9ccf9f73a362663016a5d26078d4a20
https://github.com/scummvm/scummvm/commit/4af395ebb9ccf9f73a362663016a5d26078d4a20
Author: D G Turner (digitall at scummvm.org)
Date: 2024-03-30T17:26:24Z
Commit Message:
GUI: Jamnitorial Cleanup of Code Formatting
No functional change.
Changed paths:
gui/launcher.cpp
gui/widgets/grid.cpp
gui/widgets/grid.h
gui/widgets/groupedlist.cpp
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index efe356b6343..7bd95f9d0de 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -449,13 +449,13 @@ void LauncherDialog::removeGame(int item) {
MessageDialog alert(_("Do you really want to remove this game configuration?"), _("Yes"), _("No"));
if (alert.runModal() == GUI::kMessageOK) {
- int nextPos = -1;
- if (_groupBy != kGroupByNone && getType() == kLauncherDisplayList) {
- // Find the position of the next item in the sorted list.
- nextPos = getNextPos(item);
- } else if (_groupBy != kGroupByNone && getType() == kLauncherDisplayGrid) {
- // Find the position of the next item in the sorted grid.
- nextPos = getNextPos(item);
+ int nextPos = -1;
+ if (_groupBy != kGroupByNone && getType() == kLauncherDisplayList) {
+ // Find the position of the next item in the sorted list.
+ nextPos = getNextPos(item);
+ } else if (_groupBy != kGroupByNone && getType() == kLauncherDisplayGrid) {
+ // Find the position of the next item in the sorted grid.
+ nextPos = getNextPos(item);
}
// Remove the currently selected game from the list
@@ -1616,7 +1616,7 @@ void LauncherGrid::updateListing(int selPos) {
}
int LauncherGrid::getNextPos(int oldSel) {
- return _grid->getNextPos(oldSel);
+ return _grid->getNextPos(oldSel);
}
void LauncherGrid::updateButtons() {
diff --git a/gui/widgets/grid.cpp b/gui/widgets/grid.cpp
index 3389fa8a952..085f5eb03bd 100644
--- a/gui/widgets/grid.cpp
+++ b/gui/widgets/grid.cpp
@@ -861,39 +861,39 @@ void GridWidget::assignEntriesToItems() {
}
int GridWidget::getNextPos(int oldSel) {
- int pos = 0;
-
- // Find the next item in the grid
- for (uint i = 0; i < _sortedEntryList.size(); i++) {
- if (_sortedEntryList[i]->entryID == oldSel) {
- return pos;
- } else if (!_sortedEntryList[i]->isHeader) {
- pos++;
- }
- }
-
- return -1;
+ int pos = 0;
+
+ // Find the next item in the grid
+ for (uint i = 0; i < _sortedEntryList.size(); i++) {
+ if (_sortedEntryList[i]->entryID == oldSel) {
+ return pos;
+ } else if (!_sortedEntryList[i]->isHeader) {
+ pos++;
+ }
+ }
+
+ return -1;
}
int GridWidget::getNewSel(int index) {
- if (_sortedEntryList.size() == 0) {
- return -1;
- }
-
- // Find the index-th item in the grid
- for (uint i = 0; i < _sortedEntryList.size(); i++) {
- if (index == 0 && _sortedEntryList[i]->isHeader == 0) {
- return _sortedEntryList[i]->entryID;
- } else if (_sortedEntryList[i]->isHeader == 0) {
- index--;
- }
- }
-
- if (index == 0) {
- return _sortedEntryList[_sortedEntryList.size() - 1]->entryID;
- } else {
- return -1;
- }
+ if (_sortedEntryList.size() == 0) {
+ return -1;
+ }
+
+ // Find the index-th item in the grid
+ for (uint i = 0; i < _sortedEntryList.size(); i++) {
+ if (index == 0 && _sortedEntryList[i]->isHeader == 0) {
+ return _sortedEntryList[i]->entryID;
+ } else if (_sortedEntryList[i]->isHeader == 0) {
+ index--;
+ }
+ }
+
+ if (index == 0) {
+ return _sortedEntryList[_sortedEntryList.size() - 1]->entryID;
+ } else {
+ return -1;
+ }
}
void GridWidget::handleMouseWheel(int x, int y, int direction) {
diff --git a/gui/widgets/grid.h b/gui/widgets/grid.h
index 121555db748..e745cf0a700 100644
--- a/gui/widgets/grid.h
+++ b/gui/widgets/grid.h
@@ -207,7 +207,7 @@ public:
void assignEntriesToItems();
int getNextPos(int oldSel);
- int getNewSel(int index);
+ int getNewSel(int index);
int getScrollPos() const { return _scrollPos; }
int getSelected() const { return ((_selectedEntry == nullptr) ? -1 : _selectedEntry->entryID); }
int getThumbnailHeight() const { return _thumbnailHeight; }
diff --git a/gui/widgets/groupedlist.cpp b/gui/widgets/groupedlist.cpp
index 928335e3583..ec027e30368 100644
--- a/gui/widgets/groupedlist.cpp
+++ b/gui/widgets/groupedlist.cpp
@@ -295,41 +295,41 @@ void GroupedListWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32
}
int GroupedListWidget::getNextPos(int oldSel) {
- int pos = 0;
-
- // Find the position of the new selection in the list.
- for (uint i = 0; i < _listIndex.size(); i++) {
- if (_listIndex[i] == oldSel) {
- return pos;
- } else if (_listIndex[i] > 0) {
- pos++;
- }
- }
-
- return -1;
+ int pos = 0;
+
+ // Find the position of the new selection in the list.
+ for (uint i = 0; i < _listIndex.size(); i++) {
+ if (_listIndex[i] == oldSel) {
+ return pos;
+ } else if (_listIndex[i] > 0) {
+ pos++;
+ }
+ }
+
+ return -1;
}
int GroupedListWidget::getNewSel(int index) {
- // If the list is empty, return -1
- if (_listIndex.size() == 1){
- return -1;
- }
-
- // Find the index-th item in the list
- for (uint i = 0; i < _listIndex.size(); i++) {
- if (index == 0 && _listIndex[i] >= 0) {
- return _listIndex[i];
- } else if (_listIndex[i] >= 0) {
- index--;
- }
- }
-
- // If we are at the end of the list, return the last item.
- if (index == 0) {
- return _listIndex[_listIndex.size() - 1];
- } else {
- return -1;
- }
+ // If the list is empty, return -1
+ if (_listIndex.size() == 1){
+ return -1;
+ }
+
+ // Find the index-th item in the list
+ for (uint i = 0; i < _listIndex.size(); i++) {
+ if (index == 0 && _listIndex[i] >= 0) {
+ return _listIndex[i];
+ } else if (_listIndex[i] >= 0) {
+ index--;
+ }
+ }
+
+ // If we are at the end of the list, return the last item.
+ if (index == 0) {
+ return _listIndex[_listIndex.size() - 1];
+ } else {
+ return -1;
+ }
}
void GroupedListWidget::toggleGroup(int groupID) {
More information about the Scummvm-git-logs
mailing list