Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[settings-about] Cleanup internal & externalStorageModels. Contribute…
…s to JB#46110
  • Loading branch information
rainemak committed Aug 22, 2019
1 parent acae8e2 commit 021e8b2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
10 changes: 1 addition & 9 deletions src/aboutsettings.cpp
Expand Up @@ -153,11 +153,6 @@ QVariant AboutSettings::diskUsageModel() const
return m_internalStorage;
}

QVariant AboutSettings::externalStorageUsageModel() const
{
return m_externalStorage;
}

QString AboutSettings::wlanMacAddress() const
{
return m_netinfo->macAddress(QNetworkInfo::WlanMode, 0);
Expand Down Expand Up @@ -258,7 +253,6 @@ void AboutSettings::partitionCountChanged()
void AboutSettings::reloadStorageLists()
{
m_internalStorage.clear();
m_externalStorage.clear();

for (auto partition : m_partitionManager.partitions()) {
QVariantMap row;
Expand All @@ -283,9 +277,7 @@ void AboutSettings::reloadStorageLists()
}
}();

if (partition.storageType() == Partition::External) {
m_externalStorage << QVariant(row);
} else {
if (partition.storageType() != Partition::External) {
m_internalStorage << QVariant(row);
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/aboutsettings.h
Expand Up @@ -55,9 +55,6 @@ class SYSTEMSETTINGS_EXPORT AboutSettings: public QObject
Q_PROPERTY(QString vendorName READ vendorName CONSTANT)
Q_PROPERTY(QString vendorVersion READ vendorVersion CONSTANT)

Q_PROPERTY(QVariant internalStorageUsageModel READ diskUsageModel NOTIFY storageChanged)
Q_PROPERTY(QVariant externalStorageUsageModel READ externalStorageUsageModel NOTIFY storageChanged)

public:
explicit AboutSettings(QObject *parent = 0);
virtual ~AboutSettings();
Expand All @@ -75,7 +72,6 @@ class SYSTEMSETTINGS_EXPORT AboutSettings: public QObject
* - total: total bytes on the storage
**/
Q_INVOKABLE QVariant diskUsageModel() const;
QVariant externalStorageUsageModel() const;
Q_INVOKABLE void refreshStorageModels();

QString wlanMacAddress() const;
Expand All @@ -101,7 +97,6 @@ class SYSTEMSETTINGS_EXPORT AboutSettings: public QObject
QDeviceInfo *m_devinfo;

QVariantList m_internalStorage;
QVariantList m_externalStorage;
PartitionManager m_partitionManager;

mutable QMap<QString, QString> m_osRelease;
Expand Down
2 changes: 0 additions & 2 deletions src/plugin/plugins.qmltypes
Expand Up @@ -23,8 +23,6 @@ Module {
Property { name: "adaptationVersion"; type: "string"; isReadonly: true }
Property { name: "vendorName"; type: "string"; isReadonly: true }
Property { name: "vendorVersion"; type: "string"; isReadonly: true }
Property { name: "internalStorageUsageModel"; type: "QVariant"; isReadonly: true }
Property { name: "externalStorageUsageModel"; type: "QVariant"; isReadonly: true }
Signal { name: "storageChanged" }
Method { name: "totalDiskSpace"; type: "qlonglong" }
Method { name: "availableDiskSpace"; type: "qlonglong" }
Expand Down

0 comments on commit 021e8b2

Please sign in to comment.