Makes sure extension is used when saving with FileDialog
This commit is contained in:
committed by
GitHub
parent
85f7497c83
commit
1be6fbd1b7
@@ -75,6 +75,13 @@ class FileDialog {
|
||||
|
||||
var path:String = cast result;
|
||||
|
||||
// Makes sure the filename ends with extension
|
||||
if (type == SAVE && filter != null && !StringTools.endsWith (path, "." + filter) ) {
|
||||
|
||||
path += "." + filter;
|
||||
|
||||
}
|
||||
|
||||
if (path != null) {
|
||||
|
||||
onSelect.dispatch (path);
|
||||
@@ -205,4 +212,4 @@ class FileDialog {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user