Merge lp:~laney/ubuntu-system-settings/measure-size-critical-fix into lp:ubuntu-system-settings

Proposed by Iain Lane
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 377
Merged at revision: 423
Proposed branch: lp:~laney/ubuntu-system-settings/measure-size-critical-fix
Merge into: lp:ubuntu-system-settings
Prerequisite: lp:~laney/ubuntu-system-settings/measure-real-directory-size
Diff against target: 32 lines (+9/-6)
1 file modified
plugins/about/storageabout.cpp (+9/-6)
To merge this branch: bzr merge lp:~laney/ubuntu-system-settings/measure-size-critical-fix
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+188020@code.launchpad.net

Commit message

Check the passed mount point when measuring directory size, to avoid a GLib critical message

Description of the change

I noticed a critical when running the new measure code

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

right

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/about/storageabout.cpp'
2--- plugins/about/storageabout.cpp 2013-09-27 11:09:42 +0000
3+++ plugins/about/storageabout.cpp 2013-09-27 11:09:42 +0000
4@@ -277,20 +277,23 @@
5 }
6
7 QString StorageAbout::getDevicePath(const QString mount_point)
8-{
9- GUnixMountEntry * g_mount_point =
10- g_unix_mount_at(mount_point.toLocal8Bit(), NULL);
11-
12+{
13 QString s_mount_point;
14
15+ GUnixMountEntry * g_mount_point = NULL;
16+
17+ if (!mount_point.isNull() && !mount_point.isEmpty()) {
18+ g_mount_point = g_unix_mount_at(mount_point.toLocal8Bit(), NULL);
19+ }
20+
21 if (g_mount_point) {
22 const gchar * device_path =
23 g_unix_mount_get_device_path(g_mount_point);
24 s_mount_point = QString::fromLocal8Bit(device_path);
25+
26+ g_unix_mount_free (g_mount_point);
27 }
28
29- g_unix_mount_free (g_mount_point);
30-
31 return s_mount_point;
32 }
33

Subscribers

People subscribed via source and target branches