Better progress bar calculation

This commit is contained in:
Jakob Borg
2014-01-06 06:38:01 +01:00
parent ab8482a424
commit 271d7eedc4
3 changed files with 21 additions and 2 deletions

View File

@@ -132,6 +132,19 @@ func (m *Model) LocalSize() (files, deleted, bytes int) {
return
}
func (m *Model) InSyncSize() (files, bytes int) {
m.RLock()
defer m.RUnlock()
for n, f := range m.local {
if gf, ok := m.global[n]; ok && f.Modified == gf.Modified {
files++
bytes += f.Size()
}
}
return
}
type FileInfo struct {
Name string
Size int