|
@@ -0,0 +1,512 @@
|
|
|
+#include "qappctrl.h"
|
|
|
+#include "defines.h"
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+#define _countof(a) (sizeof(a) / sizeof(*a))
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+#define _OPT_STRING(s, o) (*s ? s : o)
|
|
|
+#define _NA_STRING(s) _OPT_STRING(s, "n/a")
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+#define _BYTE_SIZE_KIB (1ULL << 10) // Kibibyte
|
|
|
+#define _BYTE_SIZE_MIB (1ULL << 20) // Mebibyte
|
|
|
+#define _BYTE_SIZE_GIB (1ULL << 30) // Gibibyte
|
|
|
+#define _BYTE_SIZE_TIB (1ULL << 40) // Tebibyte
|
|
|
+#define _BYTE_SIZE_PIB (1ULL << 50) // Pebibyte
|
|
|
+#define _BYTE_SIZE_EIB (1ULL << 60) // Exbibyte
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+static const char *_FormatByteSize(unsigned long long nCb, char *pszBuf, size_t nCChBuf, bool bShortUnits = true, int nPrec = 1);
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+static const char *_FormatByteSize(unsigned long long nCb, char *pszBuf, size_t nCChBuf, bool bShortUnits, int nPrec)
|
|
|
+{
|
|
|
+ if(pszBuf && nCChBuf)
|
|
|
+ {
|
|
|
+ double val = nCb;
|
|
|
+
|
|
|
+ if(nCb < _BYTE_SIZE_KIB)
|
|
|
+ {
|
|
|
+ snprintf(pszBuf, nCChBuf, "%llu %s", nCb, bShortUnits ? "B" : "Byte"); // Byte
|
|
|
+ }
|
|
|
+ else if(nCb < _BYTE_SIZE_MIB)
|
|
|
+ {
|
|
|
+ val /= _BYTE_SIZE_KIB;
|
|
|
+ snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "K" : "KiB"); // KiB
|
|
|
+ }
|
|
|
+ else if(nCb < _BYTE_SIZE_GIB)
|
|
|
+ {
|
|
|
+ val /= _BYTE_SIZE_MIB;
|
|
|
+ snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "M" : "MiB"); // MiB
|
|
|
+ }
|
|
|
+ else if(nCb < _BYTE_SIZE_TIB)
|
|
|
+ {
|
|
|
+ val /= _BYTE_SIZE_GIB;
|
|
|
+ snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "G" : "GiB"); // GiB
|
|
|
+ }
|
|
|
+ else if(nCb < _BYTE_SIZE_PIB)
|
|
|
+ {
|
|
|
+ val /= _BYTE_SIZE_TIB;
|
|
|
+ snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "T" : "TiB"); // TiB
|
|
|
+ }
|
|
|
+ else if(nCb < _BYTE_SIZE_EIB)
|
|
|
+ {
|
|
|
+ val /= _BYTE_SIZE_PIB;
|
|
|
+ snprintf(pszBuf, nCChBuf, "%.*f %s", nPrec, val, bShortUnits ? "P" : "PiB"); // PiB
|
|
|
+ }
|
|
|
+
|
|
|
+ return pszBuf;
|
|
|
+ }
|
|
|
+
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+typedef enum
|
|
|
+{
|
|
|
+ SDR_DiskName = Qt::UserRole,
|
|
|
+ SDR_DiskDevNode,
|
|
|
+ SDR_DiskBusType,
|
|
|
+ SDR_DiskVendorName,
|
|
|
+ SDR_DiskVendorID,
|
|
|
+ SDR_DiskProductID,
|
|
|
+ SDR_PartFsLabel,
|
|
|
+ SDR_PartFsType,
|
|
|
+ SDR_PartFsVersion,
|
|
|
+ SDR_PartDevNode,
|
|
|
+ SDR_PartMountPoint,
|
|
|
+ SDR_PartSize,
|
|
|
+ SDR_PartFsSize,
|
|
|
+ SDR_PartFsFree,
|
|
|
+ SDR_PartFsUsed
|
|
|
+}StgDevRoles;
|
|
|
+
|
|
|
+typedef struct _STG_DEV_ROLES
|
|
|
+{
|
|
|
+ int nRole;
|
|
|
+ const char *pszRoleName;
|
|
|
+}STG_DEV_ROLES, *LPSTG_DEV_ROLES;
|
|
|
+typedef const STG_DEV_ROLES *LPCSTG_DEV_ROLES;
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+static const STG_DEV_ROLES g_roles[] =
|
|
|
+{
|
|
|
+ {SDR_DiskName, "DiskName"},
|
|
|
+ {SDR_DiskDevNode, "DiskDevNode"},
|
|
|
+ {SDR_DiskBusType, "DiskDevType"},
|
|
|
+ {SDR_DiskVendorName, "DiskVendorName"},
|
|
|
+ {SDR_DiskVendorID, "DiskVendorID"},
|
|
|
+ {SDR_DiskProductID, "DiskProductID"},
|
|
|
+ {SDR_PartFsLabel, "PartFsLabel"},
|
|
|
+ {SDR_PartFsType, "PartFsType"},
|
|
|
+ {SDR_PartFsVersion, "PartFsVersion"},
|
|
|
+ {SDR_PartDevNode, "PartDevNode"},
|
|
|
+ {SDR_PartMountPoint, "PartMountPoint"},
|
|
|
+ {SDR_PartSize, "PartSize"},
|
|
|
+ {SDR_PartFsSize, "PartFsSize"},
|
|
|
+ {SDR_PartFsFree, "PartFsFree"},
|
|
|
+ {SDR_PartFsUsed, "PartFsUsed"}
|
|
|
+};
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+QGfaStgDevList::QGfaStgDevList(QObject *pParent) : QAbstractTableModel(pParent)
|
|
|
+{
|
|
|
+ memset(&m_stgDevShadowCpy, 0, sizeof(m_stgDevShadowCpy));
|
|
|
+ setObjectName("QGfaStgDevList");
|
|
|
+}
|
|
|
+
|
|
|
+QGfaStgDevList::~QGfaStgDevList(void)
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+int QGfaStgDevList::rowCount(const QModelIndex &parent) const
|
|
|
+{
|
|
|
+ Q_UNUSED(parent);
|
|
|
+ return (int)m_partVec.size();
|
|
|
+}
|
|
|
+
|
|
|
+int QGfaStgDevList::columnCount(const QModelIndex &parent) const
|
|
|
+{
|
|
|
+ Q_UNUSED(parent);
|
|
|
+ return (int)_countof(g_roles);
|
|
|
+}
|
|
|
+
|
|
|
+QVariant QGfaStgDevList::data(const QModelIndex &index, int role) const
|
|
|
+{
|
|
|
+ if(!index.isValid())
|
|
|
+ return QVariant();
|
|
|
+
|
|
|
+ QVariant val;
|
|
|
+ char szBuf[64];
|
|
|
+ int nIndex = index.row();
|
|
|
+ const STG_DEV_DISK_PART &dp = m_partVec[nIndex];
|
|
|
+ const GFA_SYSINFO_DISK &disk = m_stgDevShadowCpy.disks[dp.nDiskIdx];
|
|
|
+ const GFA_SYSINFO_PARTITION &part = m_stgDevShadowCpy.parts[dp.nPartIdx];
|
|
|
+
|
|
|
+ if(disk.valid && part.valid)
|
|
|
+ {
|
|
|
+ switch(role)
|
|
|
+ {
|
|
|
+ case SDR_DiskName:
|
|
|
+ val = _NA_STRING(disk.szName);
|
|
|
+ break;
|
|
|
+ case SDR_DiskDevNode:
|
|
|
+ val = _NA_STRING(disk.szDevNode);
|
|
|
+ break;
|
|
|
+ case SDR_DiskBusType:
|
|
|
+ val = _OPT_STRING(disk.szBus, "mmc");
|
|
|
+ break;
|
|
|
+ case SDR_DiskVendorName:
|
|
|
+ val = _NA_STRING(disk.szVendor);
|
|
|
+ break;
|
|
|
+ case SDR_DiskVendorID:
|
|
|
+ val = (int)disk.nVendorID;
|
|
|
+ break;
|
|
|
+ case SDR_DiskProductID:
|
|
|
+ val = (int)disk.nProductID;
|
|
|
+ break;
|
|
|
+ case SDR_PartFsLabel:
|
|
|
+ val = _NA_STRING(part.szFsLabel);
|
|
|
+ break;
|
|
|
+ case SDR_PartFsType:
|
|
|
+ val = _NA_STRING(part.szFsType);
|
|
|
+ break;
|
|
|
+ case SDR_PartFsVersion:
|
|
|
+ val = _NA_STRING(part.szFsVersion);
|
|
|
+ break;
|
|
|
+ case SDR_PartDevNode:
|
|
|
+ val = _NA_STRING(part.szDevNode);
|
|
|
+ break;
|
|
|
+ case SDR_PartMountPoint:
|
|
|
+ val = _NA_STRING(part.szMntPoint);
|
|
|
+ break;
|
|
|
+ case SDR_PartSize:
|
|
|
+ val = _FormatByteSize(part.nKiBPartSize * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
|
|
|
+ break;
|
|
|
+ case SDR_PartFsSize:
|
|
|
+ val = _FormatByteSize(part.nKiBSize * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
|
|
|
+ break;
|
|
|
+ case SDR_PartFsFree:
|
|
|
+ val = _FormatByteSize(part.nKiBFree * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
|
|
|
+ break;
|
|
|
+ case SDR_PartFsUsed:
|
|
|
+ val = _FormatByteSize(part.nKiBUsed * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return val;
|
|
|
+}
|
|
|
+
|
|
|
+QHash<int, QByteArray> QGfaStgDevList::roleNames(void) const
|
|
|
+{
|
|
|
+ QHash<int, QByteArray> roles;
|
|
|
+
|
|
|
+ for(size_t i = 0; i < _countof(g_roles); ++i)
|
|
|
+ {
|
|
|
+ roles[g_roles[i].nRole] = g_roles[i].pszRoleName;
|
|
|
+ }
|
|
|
+
|
|
|
+ return roles;
|
|
|
+}
|
|
|
+
|
|
|
+int QGfaStgDevList::FindPartVecEntry(int nDiskIdx, int nPartIdx)
|
|
|
+{
|
|
|
+ for(auto it = m_partVec.begin(); it != m_partVec.end(); ++it)
|
|
|
+ {
|
|
|
+ const STG_DEV_DISK_PART &dp = *it;
|
|
|
+ if((dp.nDiskIdx == nDiskIdx) && (dp.nPartIdx == nPartIdx))
|
|
|
+ return it - m_partVec.begin();
|
|
|
+ }
|
|
|
+ return -1;
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::insertPartition(int nDiskIdx, int nPartIdx)
|
|
|
+{
|
|
|
+ QModelIndex parent = QModelIndex();
|
|
|
+ int nIndex = (int)m_partVec.size();
|
|
|
+ emit beginInsertRows(parent, nIndex, nIndex);
|
|
|
+ m_partVec.emplace_back(nDiskIdx, nPartIdx);
|
|
|
+ emit endInsertRows();
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::removePartition(int nDiskIdx, int nPartIdx)
|
|
|
+{
|
|
|
+ int nIndex;
|
|
|
+ if((nIndex = FindPartVecEntry(nDiskIdx, nPartIdx)) >= 0)
|
|
|
+ {
|
|
|
+ QModelIndex parent = QModelIndex();
|
|
|
+ emit beginRemoveRows(parent, nIndex, nIndex);
|
|
|
+ m_partVec.erase(m_partVec.begin() + nIndex);
|
|
|
+ emit endRemoveRows();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::diskAdded(int nIndex, const GFA_SYSINFO_DISK &disk)
|
|
|
+{
|
|
|
+ if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.disks)) && !disk.internal)
|
|
|
+ {
|
|
|
+ TRACE("Disk [ID=%d] added: %s [%s]\n", nIndex, disk.szDevNode, *disk.szName ? disk.szName : "Unnamed");
|
|
|
+ memcpy(&m_stgDevShadowCpy.disks[nIndex], &disk, sizeof(GFA_SYSINFO_DISK));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::diskRemoved(int nIndex, const GFA_SYSINFO_DISK &disk)
|
|
|
+{
|
|
|
+ if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.disks)) && !disk.internal)
|
|
|
+ {
|
|
|
+ TRACE("Disk [ID=%d] removed: %s [%s]\n", nIndex, disk.szDevNode, *disk.szName ? disk.szName : "Unnamed");
|
|
|
+ m_stgDevShadowCpy.disks[nIndex].valid = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::partitionAdded(int nIndex, const GFA_SYSINFO_PARTITION &part)
|
|
|
+{
|
|
|
+ if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.parts)) && !part.internal)
|
|
|
+ {
|
|
|
+ TRACE("Partition [ID=%d:%d] added: %s [%s]\n", part.nDiskIdx, nIndex, part.szDevNode, *part.szFsLabel ? part.szFsLabel : "Unnamed");
|
|
|
+ memcpy(&m_stgDevShadowCpy.parts[nIndex], &part, sizeof(GFA_SYSINFO_PARTITION));
|
|
|
+ insertPartition(part.nDiskIdx, nIndex);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::partitionRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part)
|
|
|
+{
|
|
|
+ if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.parts)) && !part.internal)
|
|
|
+ {
|
|
|
+ TRACE("Partition [ID=%d:%d] removed: %s [%s]\n", part.nDiskIdx, nIndex, part.szDevNode, *part.szFsLabel ? part.szFsLabel : "Unnamed");
|
|
|
+ m_stgDevShadowCpy.parts[nIndex].valid = false;
|
|
|
+ removePartition(part.nDiskIdx, nIndex);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::mountAdded(int nIndex, const GFA_SYSINFO_PARTITION &part)
|
|
|
+{
|
|
|
+ if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.parts)) && !part.internal)
|
|
|
+ {
|
|
|
+ TRACE("Partition [ID=%d:%d] mounted: %s -> %s\n", part.nDiskIdx, nIndex, part.szDevNode, part.szMntPoint);
|
|
|
+ GFA_SYSINFO_PARTITION &p = m_stgDevShadowCpy.parts[nIndex];
|
|
|
+ memcpy(&p.szMntPoint, &part.szMntPoint, sizeof(GFA_SYSINFO_PARTITION::szMntPoint));
|
|
|
+ if((nIndex = FindPartVecEntry(part.nDiskIdx, nIndex)) >= 0)
|
|
|
+ {
|
|
|
+ p.nKiBSize = part.nKiBSize;
|
|
|
+ p.nKiBFree = part.nKiBFree;
|
|
|
+ p.nKiBUsed = part.nKiBUsed;
|
|
|
+ QModelIndex i = createIndex(nIndex, 0);
|
|
|
+ emit dataChanged(i, i, {SDR_PartMountPoint, SDR_PartFsSize, SDR_PartFsFree, SDR_PartFsUsed});
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::mountRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part)
|
|
|
+{
|
|
|
+ if((nIndex >= 0) && (nIndex < (int)_countof(m_stgDevShadowCpy.parts)) && !part.internal)
|
|
|
+ {
|
|
|
+ TRACE("Partition [ID=%d:%d] unmounted: %s\n", part.nDiskIdx, nIndex, part.szDevNode);
|
|
|
+ GFA_SYSINFO_PARTITION &p = m_stgDevShadowCpy.parts[nIndex];
|
|
|
+ memset(&p.szMntPoint, 0, sizeof(GFA_SYSINFO_PARTITION::szMntPoint));
|
|
|
+ if((nIndex = FindPartVecEntry(part.nDiskIdx, nIndex)) >= 0)
|
|
|
+ {
|
|
|
+ p.nKiBSize = 0;
|
|
|
+ p.nKiBFree = 0;
|
|
|
+ p.nKiBUsed = 0;
|
|
|
+ QModelIndex i = createIndex(nIndex, 0);
|
|
|
+ emit dataChanged(i, i, {SDR_PartMountPoint, SDR_PartFsSize, SDR_PartFsFree, SDR_PartFsUsed});
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaStgDevList::clearAll(void)
|
|
|
+{
|
|
|
+ int nLast = m_partVec.size() - 1;
|
|
|
+ if(nLast >= 0)
|
|
|
+ {
|
|
|
+ QModelIndex parent = QModelIndex();
|
|
|
+ emit beginRemoveRows(parent, 0, nLast);
|
|
|
+ m_partVec.clear();
|
|
|
+ memset(&m_stgDevShadowCpy, 0, sizeof(m_stgDevShadowCpy));
|
|
|
+ emit endRemoveRows();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+QGfaSysInfo::QGfaSysInfo(QObject *pParent) : QObject(pParent),
|
|
|
+ m_bSysInfoRunning(false),
|
|
|
+ m_nMemTotal(0),
|
|
|
+ m_nMemUsed(0),
|
|
|
+ m_nMemFree(0),
|
|
|
+ m_nMemAvailable(0),
|
|
|
+ m_nMemBuffers(0),
|
|
|
+ m_nMemCached(0),
|
|
|
+ m_bootFromEmmc(false)
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+QGfaSysInfo::~QGfaSysInfo(void)
|
|
|
+{
|
|
|
+ setObjectName("QGfaSysInfo");
|
|
|
+}
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+void QGfaSysInfo::setSysInfoRunning(bool bRunning)
|
|
|
+{
|
|
|
+ if(m_bSysInfoRunning != bRunning)
|
|
|
+ {
|
|
|
+ if(!(m_bSysInfoRunning = bRunning))
|
|
|
+ {
|
|
|
+ setSysMemInfo(NULL);
|
|
|
+ m_stgDevList.clearAll();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaSysInfo::setSysMemInfo(LPCGFA_APPCTRL_SYSMEM psm, bool bDoHeavyLoadUpdate)
|
|
|
+{
|
|
|
+ if(psm && m_bSysInfoRunning)
|
|
|
+ {
|
|
|
+ if(bDoHeavyLoadUpdate)
|
|
|
+ {
|
|
|
+ if(m_nMemTotal != psm->nMemTotal)
|
|
|
+ {
|
|
|
+ m_nMemTotal = psm->nMemTotal;
|
|
|
+ emit memTotalChanged(m_nMemTotal);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemUsed != psm->nMemUsed)
|
|
|
+ {
|
|
|
+ m_nMemUsed = psm->nMemUsed;
|
|
|
+ emit memUsedChanged(m_nMemUsed);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemFree != psm->nMemFree)
|
|
|
+ {
|
|
|
+ m_nMemFree = psm->nMemFree;
|
|
|
+ emit memFreeChanged(m_nMemFree);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemAvailable != psm->nMemAvailable)
|
|
|
+ {
|
|
|
+ m_nMemAvailable = psm->nMemAvailable;
|
|
|
+ emit memAvailableChanged(m_nMemAvailable);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemBuffers != psm->nMemBuffers)
|
|
|
+ {
|
|
|
+ m_nMemBuffers = psm->nMemBuffers;
|
|
|
+ emit memBuffersChanged(m_nMemBuffers);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemCached != psm->nMemCached)
|
|
|
+ {
|
|
|
+ m_nMemCached = psm->nMemCached;
|
|
|
+ emit memCachedChanged(m_nMemCached);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(m_nMemTotal != 0)
|
|
|
+ {
|
|
|
+ m_nMemTotal = 0;
|
|
|
+ emit memTotalChanged(m_nMemTotal);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemUsed != 0)
|
|
|
+ {
|
|
|
+ m_nMemUsed = 0;
|
|
|
+ emit memUsedChanged(m_nMemUsed);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemFree != 0)
|
|
|
+ {
|
|
|
+ m_nMemFree = 0;
|
|
|
+ emit memFreeChanged(m_nMemFree);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemAvailable != 0)
|
|
|
+ {
|
|
|
+ m_nMemAvailable = 0;
|
|
|
+ emit memAvailableChanged(m_nMemAvailable);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemBuffers != 0)
|
|
|
+ {
|
|
|
+ m_nMemBuffers = 0;
|
|
|
+ emit memBuffersChanged(m_nMemBuffers);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_nMemCached != 0)
|
|
|
+ {
|
|
|
+ m_nMemCached = 0;
|
|
|
+ emit memCachedChanged(m_nMemCached);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+quint64 QGfaSysInfo::memTotal(void) const
|
|
|
+{
|
|
|
+ return m_nMemTotal;
|
|
|
+}
|
|
|
+
|
|
|
+quint64 QGfaSysInfo::memUsed(void) const
|
|
|
+{
|
|
|
+ return m_nMemUsed;
|
|
|
+}
|
|
|
+
|
|
|
+quint64 QGfaSysInfo::memFree(void) const
|
|
|
+{
|
|
|
+ return m_nMemFree;
|
|
|
+}
|
|
|
+
|
|
|
+quint64 QGfaSysInfo::memAvailable(void) const
|
|
|
+{
|
|
|
+ return m_nMemAvailable;
|
|
|
+}
|
|
|
+
|
|
|
+quint64 QGfaSysInfo::memBuffers(void) const
|
|
|
+{
|
|
|
+ return m_nMemBuffers;
|
|
|
+}
|
|
|
+
|
|
|
+quint64 QGfaSysInfo::memCached(void) const
|
|
|
+{
|
|
|
+ return m_nMemCached;
|
|
|
+}
|
|
|
+
|
|
|
+QGfaStgDevList* QGfaSysInfo::stgDev(void)
|
|
|
+{
|
|
|
+ return &m_stgDevList;
|
|
|
+}
|
|
|
+
|
|
|
+bool QGfaSysInfo::bootFromEmmc(void) const
|
|
|
+{
|
|
|
+ return m_bootFromEmmc;
|
|
|
+}
|
|
|
+
|
|
|
+void QGfaSysInfo::setBootFromEmmc(bool bootFromEmmc)
|
|
|
+{
|
|
|
+ if(m_bootFromEmmc != bootFromEmmc)
|
|
|
+ {
|
|
|
+ m_bootFromEmmc = bootFromEmmc;
|
|
|
+ emit bootFromEmmcChanged(m_bootFromEmmc);
|
|
|
+ }
|
|
|
+}
|