mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
Capitalize drive letter of chosen file
This commit is contained in:
parent
dac043a52d
commit
11aeaba114
1 changed files with 9 additions and 1 deletions
|
@ -176,6 +176,14 @@ ModalWindow {
|
|||
property var modelConnection: Connections { target: fileTableModel; onFolderChanged: d.update(); }
|
||||
property var homeDestination: helper.home();
|
||||
|
||||
function capitalizeDrive(path) {
|
||||
// Consistently capitalize drive letter for Windows.
|
||||
if (/[a-zA-Z]:/.test(path)) {
|
||||
return path.charAt(0).toUpperCase() + path.slice(1);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
function update() {
|
||||
var row = fileTableView.currentRow;
|
||||
|
||||
|
@ -186,7 +194,7 @@ ModalWindow {
|
|||
currentSelectionUrl = helper.pathToUrl(fileTableView.model.get(row).filePath);
|
||||
currentSelectionIsFolder = fileTableView.model.isFolder(row);
|
||||
if (root.selectDirectory || !currentSelectionIsFolder) {
|
||||
currentSelection.text = helper.urlToPath(currentSelectionUrl);
|
||||
currentSelection.text = capitalizeDrive(helper.urlToPath(currentSelectionUrl));
|
||||
} else {
|
||||
currentSelection.text = "";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue