This removes the tilde expansion we had in the GUI. I'm not sure why we had it, but there are valid reasons to have a folder path with tilde in it in the config, and it was previously impossible to enter one of those.
This commit is contained in:
parent
b99dee3ac3
commit
a4a1231e92
|
@ -740,20 +740,12 @@ angular.module('syncthing.core')
|
||||||
}
|
}
|
||||||
|
|
||||||
function pathJoin(base, name) {
|
function pathJoin(base, name) {
|
||||||
base = expandTilde(base);
|
|
||||||
if (base[base.length - 1] !== $scope.system.pathSeparator) {
|
if (base[base.length - 1] !== $scope.system.pathSeparator) {
|
||||||
return base + $scope.system.pathSeparator + name;
|
return base + $scope.system.pathSeparator + name;
|
||||||
}
|
}
|
||||||
return base + name;
|
return base + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
function expandTilde(path) {
|
|
||||||
if (path && path.trim().charAt(0) === '~') {
|
|
||||||
return $scope.system.tilde + path.trim().substring(1);
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
function shouldSetDefaultFolderPath() {
|
function shouldSetDefaultFolderPath() {
|
||||||
return $scope.config.defaults.folder.path && $scope.folderEditor.folderPath.$pristine && $scope.editingFolderNew();
|
return $scope.config.defaults.folder.path && $scope.folderEditor.folderPath.$pristine && $scope.editingFolderNew();
|
||||||
}
|
}
|
||||||
|
@ -1988,7 +1980,7 @@ angular.module('syncthing.core')
|
||||||
if (!newvalue) {
|
if (!newvalue) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$scope.currentFolder.path = expandTilde(newvalue);
|
$scope.currentFolder.path = newvalue;
|
||||||
$http.get(urlbase + '/system/browse', {
|
$http.get(urlbase + '/system/browse', {
|
||||||
params: { current: newvalue }
|
params: { current: newvalue }
|
||||||
}).success(function (data) {
|
}).success(function (data) {
|
||||||
|
|
Loading…
Reference in New Issue