[Scummvm-git-logs] scummvm master -> cc29c8efc7cd33a8afa9b7221625789befeae96e
criezy
noreply at scummvm.org
Sun Jun 5 17:57:33 UTC 2022
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:
cc29c8efc7 GUI: When dropping file, use parent directory for detection
Commit: cc29c8efc7cd33a8afa9b7221625789befeae96e
https://github.com/scummvm/scummvm/commit/cc29c8efc7cd33a8afa9b7221625789befeae96e
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2022-06-05T18:57:20+01:00
Commit Message:
GUI: When dropping file, use parent directory for detection
The detection was done on the dropped path, so it worked when
dropping a directory, but not a file. Now we can drop a file
and it will run the detection on the parent directory.
Changed paths:
gui/launcher.cpp
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 1dcdfa626d5..c16eed5957e 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -544,7 +544,12 @@ void LauncherDialog::handleKeyUp(Common::KeyState state) {
void LauncherDialog::handleOtherEvent(const Common::Event &evt) {
Dialog::handleOtherEvent(evt);
if (evt.type == Common::EVENT_DROP_FILE) {
- doGameDetection(evt.path);
+ // If the path is a file, take the parent directory for the detection
+ Common::String path = evt.path;
+ Common::FSNode node(path);
+ if (!node.isDirectory())
+ path = node.getParent().getPath();
+ doGameDetection(path);
}
}
More information about the Scummvm-git-logs
mailing list