mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
gui, lib/db: Correct space accounting of symlinks, for "out of sync" status
This commit is contained in:
parent
a7f7058636
commit
a9b03de99a
@ -654,7 +654,7 @@ angular.module('syncthing.core')
|
|||||||
if (state === 'error') {
|
if (state === 'error') {
|
||||||
return 'stopped'; // legacy, the state is called "stopped" in the GUI
|
return 'stopped'; // legacy, the state is called "stopped" in the GUI
|
||||||
}
|
}
|
||||||
if (state === 'idle' && $scope.model[folderCfg.id].needFiles + $scope.model[folderCfg.id].needDeletes > 0) {
|
if (state === 'idle' && $scope.neededItems(folderCfg.id) > 0) {
|
||||||
return 'outofsync';
|
return 'outofsync';
|
||||||
}
|
}
|
||||||
if (state === 'scanning') {
|
if (state === 'scanning') {
|
||||||
|
@ -73,7 +73,7 @@ func (s *sizeTracker) addFile(f FileIntf) {
|
|||||||
switch {
|
switch {
|
||||||
case f.IsDeleted():
|
case f.IsDeleted():
|
||||||
s.Deleted++
|
s.Deleted++
|
||||||
case f.IsDirectory():
|
case f.IsDirectory() && !f.IsSymlink():
|
||||||
s.Directories++
|
s.Directories++
|
||||||
case f.IsSymlink():
|
case f.IsSymlink():
|
||||||
s.Symlinks++
|
s.Symlinks++
|
||||||
@ -93,7 +93,7 @@ func (s *sizeTracker) removeFile(f FileIntf) {
|
|||||||
switch {
|
switch {
|
||||||
case f.IsDeleted():
|
case f.IsDeleted():
|
||||||
s.Deleted--
|
s.Deleted--
|
||||||
case f.IsDirectory():
|
case f.IsDirectory() && !f.IsSymlink():
|
||||||
s.Directories--
|
s.Directories--
|
||||||
case f.IsSymlink():
|
case f.IsSymlink():
|
||||||
s.Symlinks--
|
s.Symlinks--
|
||||||
|
@ -50,7 +50,7 @@ func (f FileInfoTruncated) FileSize() int64 {
|
|||||||
if f.Deleted {
|
if f.Deleted {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
if f.IsDirectory() {
|
if f.IsDirectory() || f.IsSymlink() {
|
||||||
return protocol.SyntheticDirectorySize
|
return protocol.SyntheticDirectorySize
|
||||||
}
|
}
|
||||||
return f.Size
|
return f.Size
|
||||||
|
@ -63,7 +63,7 @@ func (f FileInfo) FileSize() int64 {
|
|||||||
if f.Deleted {
|
if f.Deleted {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
if f.IsDirectory() {
|
if f.IsDirectory() || f.IsSymlink() {
|
||||||
return SyntheticDirectorySize
|
return SyntheticDirectorySize
|
||||||
}
|
}
|
||||||
return f.Size
|
return f.Size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user