Merge lp:~seb128/ubuntu-system-settings/storage-tweak-computation into lp:ubuntu-system-settings

Proposed by Sebastien Bacher
Status: Merged
Approved by: Ken VanDine
Approved revision: 1080
Merged at revision: 1088
Proposed branch: lp:~seb128/ubuntu-system-settings/storage-tweak-computation
Merge into: lp:ubuntu-system-settings
Diff against target: 32 lines (+6/-8)
1 file modified
plugins/about/Storage.qml (+6/-8)
To merge this branch: bzr merge lp:~seb128/ubuntu-system-settings/storage-tweak-computation
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+236081@code.launchpad.net

Commit message

[storage] tweaks to the disk informations, limit the free space to the
user available one (excluding the system partitions), don't list the
external mounts, that's described in the design and is going to require
work on the categories computation to give correct values

Description of the change

[storage] tweaks to the disk informations, limit the free space to the
user available one (excluding the system partitions), don't list the
external mounts, that's described in the design and is going to require
work on the categories computation to give correct values

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good!

Looks accurate on my krillin, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/about/Storage.qml'
2--- plugins/about/Storage.qml 2014-09-24 15:26:20 +0000
3+++ plugins/about/Storage.qml 2014-09-26 08:43:08 +0000
4@@ -41,9 +41,10 @@
5 var drive = systemDrives[i]
6 var type = storageInfo.driveType(drive)
7 var path = backendInfo.getDevicePath(drive)
8- if ((type === StorageInfo.InternalDrive ||
9- type === StorageInfo.RemovableDrive ||
10- type === StorageInfo.UnknownDrive) &&
11+ /* only deal with the device's storage for now, external mounts
12+ handling would require being smarter on the categories
13+ computation as well and is not in the current design */
14+ if ((type === StorageInfo.InternalDrive) &&
15 paths.indexOf(path) == -1 && // Haven't seen this device before
16 path.charAt(0) === "/") { // Has a real mount point
17 drives.push(drive)
18@@ -59,12 +60,9 @@
19 }
20 return space
21 }
22+ /* Limit the free space to the user available one (see bug #1374134) */
23 property real freediskSpace: {
24- var space = 0
25- for (var i = 0; i < allDrives.length; i++) {
26- space += storageInfo.availableDiskSpace(allDrives[i])
27- }
28- return space
29+ return storageInfo.availableDiskSpace("/home")
30 }
31 property real usedByUbuntu: diskSpace -
32 freediskSpace -

Subscribers

People subscribed via source and target branches