mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:25:52 +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 modelConnection: Connections { target: fileTableModel; onFolderChanged: d.update(); }
|
||||||
property var homeDestination: helper.home();
|
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() {
|
function update() {
|
||||||
var row = fileTableView.currentRow;
|
var row = fileTableView.currentRow;
|
||||||
|
|
||||||
|
@ -186,7 +194,7 @@ ModalWindow {
|
||||||
currentSelectionUrl = helper.pathToUrl(fileTableView.model.get(row).filePath);
|
currentSelectionUrl = helper.pathToUrl(fileTableView.model.get(row).filePath);
|
||||||
currentSelectionIsFolder = fileTableView.model.isFolder(row);
|
currentSelectionIsFolder = fileTableView.model.isFolder(row);
|
||||||
if (root.selectDirectory || !currentSelectionIsFolder) {
|
if (root.selectDirectory || !currentSelectionIsFolder) {
|
||||||
currentSelection.text = helper.urlToPath(currentSelectionUrl);
|
currentSelection.text = capitalizeDrive(helper.urlToPath(currentSelectionUrl));
|
||||||
} else {
|
} else {
|
||||||
currentSelection.text = "";
|
currentSelection.text = "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue