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.
This commit is contained in:
parent
ad32b8b23e
commit
cc29c8efc7
1 changed files with 6 additions and 1 deletions
|
@ -544,7 +544,12 @@ void LauncherDialog::handleKeyUp(Common::KeyState state) {
|
||||||
void LauncherDialog::handleOtherEvent(const Common::Event &evt) {
|
void LauncherDialog::handleOtherEvent(const Common::Event &evt) {
|
||||||
Dialog::handleOtherEvent(evt);
|
Dialog::handleOtherEvent(evt);
|
||||||
if (evt.type == Common::EVENT_DROP_FILE) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue