Ubuntu Pastebin

Paste from Mirv at Fri, 13 Feb 2015 13:09:52 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
=== modified file 'debian/changelog'
--- debian/changelog	2015-02-11 17:34:13 +0000
+++ debian/changelog	2015-02-13 12:14:50 +0000
@@ -1,3 +1,12 @@
+ubuntu-system-settings (0.3+15.04.20150211.1-0ubuntu2) UNRELEASED; urgency=medium
+
+  * Disable StorageInfo use temporarily while a fix for the upstream class 
+    removal is being done.
+  * Adapt WIP lp:~laney/ubuntu-system-settings/storageinfo-5.4 to keep the 
+    entry and free space info visible while disabling the clickablity.
+
+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com>  Fri, 13 Feb 2015 12:12:45 +0200
+
 ubuntu-system-settings (0.3+15.04.20150211.1-0ubuntu1) vivid; urgency=medium
 
   [ jonas-drange ]

=== modified file 'plugins/about/PageComponent.qml'
--- plugins/about/PageComponent.qml	2015-01-14 00:00:41 +0000
+++ plugins/about/PageComponent.qml	2015-02-13 12:13:38 +0000
@@ -38,11 +38,11 @@
     UbuntuStorageAboutPanel {
         id: backendInfos
     }
-
+/*
     StorageInfo {
         id: storageInfo
     }
-
+*/
     DeviceInfo {
         id: deviceInfos
     }
@@ -169,9 +169,9 @@
                 objectName: "storageItem"
                 text: i18n.tr("Storage")
                 /* TRANSLATORS: that's the free disk space, indicated in the most appropriate storage unit */
-                value: i18n.tr("%1 free").arg(Utilities.formatSize(storageInfo.availableDiskSpace("/home")))
+                value: i18n.tr("%1 free").arg(Utilities.formatSize(backendInfos.getFreeSpace("/home")))
                 progression: true
-                onClicked: pageStack.push(Qt.resolvedUrl("Storage.qml"))
+                /*onClicked: pageStack.push(Qt.resolvedUrl("Storage.qml"))*/
             }
 
             SettingsItemTitle {

=== modified file 'plugins/about/storageabout.cpp'
--- plugins/about/storageabout.cpp	2015-02-13 10:17:32 +0000
+++ plugins/about/storageabout.cpp	2015-02-13 11:46:58 +0000
@@ -32,6 +32,7 @@
 #include <QJsonArray>
 #include <QJsonDocument>
 #include <QJsonObject>
+#include <QtCore/QStorageInfo>
 #include <QtCore/QSharedPointer>
 #include <QProcess>
 #include <QVariant>
@@ -345,6 +346,15 @@
     return s_mount_point;
 }
 
+qint64 StorageAbout::getFreeSpace(const QString mount_point)
+{
+    QStorageInfo si(mount_point);
+    if (si.isValid())
+        return si.bytesFree();
+
+    return -1;
+}
+
 StorageAbout::~StorageAbout() {
     if (m_cancellable) {
         g_cancellable_cancel(m_cancellable);

=== modified file 'plugins/about/storageabout.h'
--- plugins/about/storageabout.h	2014-10-24 20:04:30 +0000
+++ plugins/about/storageabout.h	2015-02-13 11:10:47 +0000
@@ -111,6 +111,7 @@
     quint64 getHomeSize();
     Q_INVOKABLE void populateSizes();
     Q_INVOKABLE QString getDevicePath (const QString mount_point);
+    Q_INVOKABLE qint64 getFreeSpace (const QString mount_point);
     bool getDeveloperMode();
     void setDeveloperMode(bool newMode);
 
Download as text