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
=== modified file 'plugins/about/Storage.qml'
--- plugins/about/Storage.qml 2014-09-24 15:26:20 +0000
+++ plugins/about/Storage.qml 2014-09-26 08:43:08 +0000
@@ -41,9 +41,10 @@
41 var drive = systemDrives[i]41 var drive = systemDrives[i]
42 var type = storageInfo.driveType(drive)42 var type = storageInfo.driveType(drive)
43 var path = backendInfo.getDevicePath(drive)43 var path = backendInfo.getDevicePath(drive)
44 if ((type === StorageInfo.InternalDrive ||44 /* only deal with the device's storage for now, external mounts
45 type === StorageInfo.RemovableDrive ||45 handling would require being smarter on the categories
46 type === StorageInfo.UnknownDrive) &&46 computation as well and is not in the current design */
47 if ((type === StorageInfo.InternalDrive) &&
47 paths.indexOf(path) == -1 && // Haven't seen this device before48 paths.indexOf(path) == -1 && // Haven't seen this device before
48 path.charAt(0) === "/") { // Has a real mount point49 path.charAt(0) === "/") { // Has a real mount point
49 drives.push(drive)50 drives.push(drive)
@@ -59,12 +60,9 @@
59 }60 }
60 return space61 return space
61 }62 }
63 /* Limit the free space to the user available one (see bug #1374134) */
62 property real freediskSpace: {64 property real freediskSpace: {
63 var space = 065 return storageInfo.availableDiskSpace("/home")
64 for (var i = 0; i < allDrives.length; i++) {
65 space += storageInfo.availableDiskSpace(allDrives[i])
66 }
67 return space
68 }66 }
69 property real usedByUbuntu: diskSpace -67 property real usedByUbuntu: diskSpace -
70 freediskSpace -68 freediskSpace -

Subscribers

People subscribed via source and target branches