[Scummvm-git-logs] scummvm master -> fff10291a5a51b76e289168c6536699632b629d3
lephilousophe
noreply at scummvm.org
Fri Dec 6 07:46:38 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:
fff10291a5 COMPOSER: Cleanup book group computation
Commit: fff10291a5a51b76e289168c6536699632b629d3
https://github.com/scummvm/scummvm/commit/fff10291a5a51b76e289168c6536699632b629d3
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-12-06T08:46:07+01:00
Commit Message:
COMPOSER: Cleanup book group computation
Changed paths:
engines/composer/composer.cpp
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 754e02ebea4..4942c34e35d 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -404,22 +404,11 @@ void ComposerEngine::loadLibrary(uint id) {
path = mangleFilename(filename);
// bookGroup is the basename of the path.
- // TODO: tidy this up.
_bookGroup.clear();
- filename = path.toString('/');
- for (uint i = 0; i < filename.size(); i++) {
- if (filename[i] == '~' || filename[i] == '/' || filename[i] == ':')
- continue;
- for (uint j = 0; j < filename.size(); j++) {
- if (filename[j] == '/') {
- _bookGroup.clear();
- continue;
- }
- if (filename[j] == '.')
- break;
- _bookGroup += filename[j];
- }
- break;
+ _bookGroup = path.baseName();
+ uint i = _bookGroup.findFirstOf('.');
+ if (i != Common::String::npos) {
+ _bookGroup.erase(i);
}
} else {
if (!id)
More information about the Scummvm-git-logs
mailing list