Commit 143a62dd authored by blam's avatar blam

[systemsettings] Add DiskUsage result property. Contributes to JB#36290

parent 473bd43e
......@@ -217,5 +217,14 @@ void DiskUsage::finished(QVariantMap usage, QJSValue *callback)
delete callback;
// the result has been set, so emit resultChanged() even if result was not valid
m_result = usage;
emit resultChanged();
QVariantMap DiskUsage::result() const
return m_result;
......@@ -48,9 +48,9 @@ class SYSTEMSETTINGS_EXPORT DiskUsage : public QObject
// True while calculation takes place
Q_PROPERTY(bool working
READ working
NOTIFY workingChanged)
Q_PROPERTY(bool working READ working NOTIFY workingChanged)
Q_PROPERTY(QVariantMap result READ result NOTIFY resultChanged)
explicit DiskUsage(QObject *parent=0);
......@@ -60,8 +60,11 @@ public:
// callback with a QVariantMap (mapping paths to usages in bytes)
Q_INVOKABLE void calculate(const QStringList &paths, QJSValue callback);
QVariantMap result() const;
void workingChanged();
void resultChanged();
void submit(QStringList paths, QJSValue *callback);
......@@ -81,6 +84,7 @@ private:
QScopedPointer<DiskUsagePrivate> const d_ptr;
QVariantMap m_result;
bool m_working;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment