Ver Fonte

Funktion zum Updaten der Storage-Device-Infos im SysInfo-Prozess.

Rind há 2 anos atrás
pai
commit
bd1064b08
8 ficheiros alterados com 282 adições e 81 exclusões
  1. 4 1
      README.md
  2. 10 4
      gfaqt.pro
  3. 18 1
      src/qappctrl.cpp
  4. 44 2
      src/qappctrl.h
  5. 68 0
      src/qgfalocale.cpp
  6. 43 0
      src/qgfalocale.h
  7. 6 3
      src/qnetworkinfo.cpp
  8. 89 70
      src/qsysinfo.cpp

+ 4 - 1
README.md

@@ -5,7 +5,7 @@ Allgemeine Bibliothek für QML-Objekte und Objekte mit QT-Bindung, mit Ausnahme
 ---
 
 ***Version:***  
-libgfaqt.so.1.5.0  
+libgfaqt.so.1.6.0  
 
 ***SO-Name:***  
 libgfaqt.so.1
@@ -55,3 +55,6 @@ libgfaqt.so (-lgfaqt)
 
 * **1.5.0**
 	* Interne Storage-Devices werden nicht mehr ausgeblendet.
+
+* **1.6.0**
+	* Funktion zum Update der Storage-Device-Infos im Sysinfo-Prozess hinzugefügt.

+ 10 - 4
gfaqt.pro

@@ -1,5 +1,5 @@
 TEMPLATE = lib
-VERSION = 1.5
+VERSION = 1.6
 QT += qml quick core
 CONFIG -= app_bundle
 CONFIG += c++11 shared thread
@@ -12,11 +12,13 @@ SOURCES += \
     src/qappinfo.cpp \
     src/qmysqlinfo.cpp \
     src/qnetworkinfo.cpp \
-    src/qsysinfo.cpp
+    src/qsysinfo.cpp \
+    src/qgfalocale.cpp
 
 HEADERS += \
     src/helpers.h \
-    src/qappctrl.h
+    src/qappctrl.h \
+    src/qgfalocale.h
 
 ####################################################################################
 
@@ -47,7 +49,9 @@ INSTALLS += target
 linux-g++ {
 	includes.path = $$GFA_INC_PATH
 	includes.extra += -$(INSTALL_FILE) $$PWD/src/qappctrl.h $(INSTALL_ROOT)$$includes.path
+	includes.extra += $$escape_expand(\\n\\t)-$(INSTALL_FILE) $$PWD/src/qgfalocale.h $(INSTALL_ROOT)$$includes.path
 	includes.uninstall += -$(DEL_FILE) $(INSTALL_ROOT)$$includes.path/qappctrl.h
+	includes.uninstall += $$escape_expand(\\n\\t)-$(DEL_FILE) $(INSTALL_ROOT)$$includes.path/qgfalocale.h
 	INSTALLS += includes
 }
 
@@ -68,7 +72,9 @@ linux-buildroot-g++ {
 
 		includes.path = $$[QT_SYSROOT]$$GFA_INC_PATH
 		includes.extra += -$(INSTALL_FILE) $$PWD/src/qappctrl.h $(INSTALL_ROOT)$$includes.path
+		includes.extra += $$escape_expand(\\n\\t)-$(INSTALL_FILE) $$PWD/src/qgfalocale.h $(INSTALL_ROOT)$$includes.path
 		includes.uninstall += -$(DEL_FILE) $(INSTALL_ROOT)$$includes.path/qappctrl.h
+		includes.uninstall += $$escape_expand(\\n\\t)-$(DEL_FILE) $(INSTALL_ROOT)$$includes.path/qgfalocale.h
 		INSTALLS += includes
 
 		itoolchain.target = install_toolchain
@@ -91,6 +97,6 @@ deploylib.commands += $$escape_expand(\\n\\t)@echo TARGET="$(TARGET)" >> deployt
 deploylib.commands += $$escape_expand(\\n\\t)@echo TARGET0="$(TARGET0)" >> deploytargets
 deploylib.commands += $$escape_expand(\\n\\t)@echo TARGET1="$(TARGET1)" >> deploytargets
 deploylib.commands += $$escape_expand(\\n\\t)@echo TARGET2="$(TARGET2)" >> deploytargets
-deploylib.commands += $$escape_expand(\\n\\t)@echo HEADERS="\\\"qappctrl.h\\\"" >> deploytargets
+deploylib.commands += $$escape_expand(\\n\\t)@echo HEADERS="\\\"qappctrl.h qgfalocale.h\\\"" >> deploytargets
 PRE_TARGETDEPS += deploylib
 QMAKE_EXTRA_TARGETS += deploylib

+ 18 - 1
src/qappctrl.cpp

@@ -147,6 +147,7 @@ void QGfaAppCtrl::timerEvent(QTimerEvent *event)
 		static clock64_t nCurPass = 0;
 		struct timespec	tsEnterUpdate, tsLeaveUpdate;
 		::clock_gettime(CLOCK_MONOTONIC, &tsEnterUpdate);
+		GFA_SYSINFO_STORAGE_DEVICE_MAP sdm;
 		GFA_APPCTRL_SYSMEM sm;
 		HAPPINFO hAI;
 		bool bDoHeavyLoadUpdate = (_TIMESPEC_DIFF_US(tsEnterUpdate, m_tsLastHeavyLoadUpdate) >= m_nHeavyLoadUpdateIntervalUs);
@@ -184,7 +185,8 @@ void QGfaAppCtrl::timerEvent(QTimerEvent *event)
 					{
 						m_bSysInfoRunning = (state == GIAS_Running);
 						emit sysInfoRunningChanged(m_bSysInfoRunning);
-						m_sysInfo.setSysInfoRunning(m_bSysInfoRunning);
+						::GfaIpcAppCtrlGetStgDevMap(m_hAC, &sdm);
+						m_sysInfo.setSysInfoRunning(m_bSysInfoRunning, sdm);
 						bSysInfoStateTransition = true;
 					}
 				}
@@ -240,6 +242,12 @@ void QGfaAppCtrl::timerEvent(QTimerEvent *event)
 							m_sysInfo.mountAdded(nIndex, part);
 						}
 						break;
+					case GFA_APPCTRL_SYSEVENT_STG_DEV_UPDT_EVT:
+						if(::GfaIpcAppCtrlGetStgDevMap(m_hAC, &sdm))
+						{
+							m_sysInfo.updatePartitionInfo(sdm);
+						}
+						break;
 
 					/////////////////////////////////////////////////////////
 
@@ -469,6 +477,15 @@ int QGfaAppCtrl::appIndexFromAppID(quint64 nAppID)
 
 /////////////////////////////////////////////////////////////////////////////
 
+bool QGfaAppCtrl::sysInfoUpdateStgDevInfo(void)
+{
+	if(m_hAC)
+		return ::GfaIpcAppCtrlSysInfoUpdateStgDevInfo(m_hAC);
+	return false;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
 QQmlListProperty<QGfaAppInfo> QGfaAppCtrl::appInfo(void)
 {
 	return QQmlListProperty<QGfaAppInfo>(this, m_appInfo);

+ 44 - 2
src/qappctrl.h

@@ -36,10 +36,44 @@ typedef const STG_DEV_DISK_PART *LPCSTG_DEV_DISK_PART;
 
 /////////////////////////////////////////////////////////////////////////////
 
+typedef struct _STG_DEV_ROLES
+{
+	int nRole;
+	const char *pszRoleName;
+}STG_DEV_ROLES, *LPSTG_DEV_ROLES;
+typedef const STG_DEV_ROLES *LPCSTG_DEV_ROLES;
+
+/////////////////////////////////////////////////////////////////////////////
+
 class QGfaStgDevList : public QAbstractTableModel
 {
     Q_OBJECT
 
+public:
+	enum StgDevRoles
+	{
+	    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,
+		SDR_PARTSIZE_FMT,
+		SDR_PARTFSSIZE_FMT,
+		SDR_PARTFSFREE_FMT,
+		SDR_PARTFSUSED_FMT
+	};
+	Q_ENUM(StgDevRoles)
+
 public:
 	explicit QGfaStgDevList(QObject *pParent = NULL);
 	virtual ~QGfaStgDevList(void);
@@ -56,7 +90,8 @@ public:
 	void mountAdded(int nIndex, const GFA_SYSINFO_PARTITION &part);
 	void mountRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part);
 	void clearAll(void);
-	void updateModel(void);
+	void updatePartitionInfo(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm);
+//	void updateModel(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm);
 
 private:
 	void insertPartition(int nDiskIdx, int nPartIdx);
@@ -66,6 +101,8 @@ private:
 private:
 	GFA_SYSINFO_STORAGE_DEVICE_MAP m_stgDevShadowCpy;
 	std::vector<STG_DEV_DISK_PART> m_partVec;
+	
+	static const STG_DEV_ROLES m_roles[];
 };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -861,7 +898,7 @@ private:
 
 public:
 	void setSysMemInfo(LPCGFA_APPCTRL_SYSMEM psm, bool bDoHeavyLoadUpdate = false);
-	void setSysInfoRunning(bool bRunning);
+	void setSysInfoRunning(bool bRunning, const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm);
 	void setBootFromEmmc(bool bootFromEmmc);
 
 	inline void diskAdded(int nIndex, const GFA_SYSINFO_DISK &disk) {
@@ -888,6 +925,10 @@ public:
 		return m_stgDevList.mountRemoved(nIndex, part);
 	}
 
+	inline void updatePartitionInfo(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm) {
+		return m_stgDevList.updatePartitionInfo(sdm);
+	}
+
 	inline void UpdateSpiInfo(const GFA_SYSINFO_SPI &spi, bool bReset) {
 		return m_tivaInfo.UpdateSpiInfo(spi, bReset);
 	}
@@ -1088,6 +1129,7 @@ public:
 
 public:
 	Q_INVOKABLE int appIndexFromAppID(quint64 nAppID);
+	Q_INVOKABLE bool sysInfoUpdateStgDevInfo(void);
 
 public:
 	QQmlListProperty<QGfaAppInfo> appInfo(void);

+ 68 - 0
src/qgfalocale.cpp

@@ -0,0 +1,68 @@
+#include <unistd.h>
+#include <string>
+#include <gfa/svc/common/strutil.h>
+#include <time.h>
+#include <QTimeZone>
+#include "qgfalocale.h"
+
+/////////////////////////////////////////////////////////////////////////////
+
+#define _TIMEZONE_PATH										"/etc/timezone"
+#define _LOCTIME_SYMLINK_PATH								"/etc/localtime"
+#define _ZONEINFO_BASE_PATH									"/usr/share/zoneinfo"
+
+/////////////////////////////////////////////////////////////////////////////
+
+QGfaLocale::QGfaLocale(QObject *pParent) :	QObject(pParent),
+											m_strSysTimezoneID(QTimeZone::systemTimeZoneId())
+{
+    QList<QByteArray> aTz;
+    aTz = QTimeZone::availableTimeZoneIds();
+
+    foreach(QByteArray zone, aTz)
+    {
+        m_arrTimezoneIDs.append(zone);
+    }
+}
+
+QGfaLocale::~QGfaLocale(void)
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+void QGfaLocale::RegisterQmlTypes(QQmlEngine &rEng, int nVerMajor, int nVerMinor)
+{
+	qmlRegisterUncreatableType<QGfaLocale>("com.gfa.locale", nVerMajor, nVerMinor, "QGfaLocale", QStringLiteral("class not creatable in QML"));
+	rEng.rootContext()->setContextProperty(QStringLiteral("qGfaLocale"), this);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+QStringList QGfaLocale::timezoneIDs(void) const
+{
+	return m_arrTimezoneIDs;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+QString QGfaLocale::systemTimezoneID(void) const
+{
+	return m_strSysTimezoneID;
+}
+
+void QGfaLocale::setSystemTimezoneID(QString v)
+{
+	if(m_strSysTimezoneID != v)
+	{
+		m_strSysTimezoneID = v;
+	    std::string s = ::formatString("%s/%s", _ZONEINFO_BASE_PATH, v.toStdString().c_str());
+	    ::unlink(_LOCTIME_SYMLINK_PATH);
+		::symlink(s.c_str(), _LOCTIME_SYMLINK_PATH);
+		::writeFile(_TIMEZONE_PATH, ::formatString("%s\n", v.toStdString().c_str()));
+	    ::tzset();
+	    emit systemTimezoneIDChanged(m_strSysTimezoneID);
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////

+ 43 - 0
src/qgfalocale.h

@@ -0,0 +1,43 @@
+// qgfalocale.h :
+//
+
+#if !defined(AGD_QGFALOCALE_H__1D863498_0C6F_4A96_8DFB_C38D1C578D3D__INCLUDED_)
+#define AGD_QGFALOCALE_H__1D863498_0C6F_4A96_8DFB_C38D1C578D3D__INCLUDED_
+
+#include <QObject>
+#include <QQmlEngine>
+#include <QQmlContext>
+#include <QTranslator>
+
+/////////////////////////////////////////////////////////////////////////////
+// qgfalocale.h - Declarations:
+
+class QGfaLocale : public QObject
+{
+    Q_OBJECT
+    Q_PROPERTY(QStringList timezoneIDs READ timezoneIDs CONSTANT)
+    Q_PROPERTY(QString systemTimezoneID READ systemTimezoneID WRITE setSystemTimezoneID NOTIFY systemTimezoneIDChanged)
+
+public:
+	explicit QGfaLocale(QObject *pParent = NULL);
+	virtual ~QGfaLocale(void);
+
+public:
+	void RegisterQmlTypes(QQmlEngine &rEng, int nVerMajor = 1, int nVerMinor = 0);
+
+signals:
+    void systemTimezoneIDChanged(QString v);
+
+private:
+	QStringList timezoneIDs(void) const;
+    QString systemTimezoneID(void) const;
+    void setSystemTimezoneID(QString v);
+    
+
+private:
+    QStringList m_arrTimezoneIDs;
+	QString m_strSysTimezoneID;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+#endif	//	!defined(AGD_QGFALOCALE_H__1D863498_0C6F_4A96_8DFB_C38D1C578D3D__INCLUDED_)

+ 6 - 3
src/qnetworkinfo.cpp

@@ -857,7 +857,8 @@ QVariant QGfaNetInterfacesSchemaModel::ipV4String(const QVariant &val)
 {
 	if(val.isValid() && val.canConvert(QMetaType::UInt))
 	{
-		struct in_addr addr{::htonl(val.toUInt())};
+//		struct in_addr addr{::htonl(val.toUInt())};
+		struct in_addr addr{val.toUInt()};
 		return addr.s_addr ? ::inet_ntoa(addr) : "-";
 	}
 	return "error";
@@ -2216,7 +2217,8 @@ int QIPv4Address::b3(void) const
 
 QVariant QIPv4Address::addr(void) const
 {
-	return ::ntohl(m_addr.s_addr);
+//	return ::ntohl(m_addr.s_addr);
+	return m_addr.s_addr;
 }
 
 void QIPv4Address::setAddress(const QVariant &addr)
@@ -2322,7 +2324,8 @@ void QIPv4Address::setB3(int b)
 
 void QIPv4Address::setAddr(const QVariant &val)
 {
-	unsigned int addr = ::htonl(val.toUInt());
+//	unsigned int addr = ::htonl(val.toUInt());
+	unsigned int addr = val.toUInt();
 
 	if(m_addr.s_addr != addr)
 	{

+ 89 - 70
src/qsysinfo.cpp

@@ -17,51 +17,27 @@
 
 /////////////////////////////////////////////////////////////////////////////
 
-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"}
+const STG_DEV_ROLES QGfaStgDevList::m_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"},
+	{SDR_PARTSIZE_FMT,		"PartSizeFmt"},
+	{SDR_PARTFSSIZE_FMT,	"PartFsSizeFmt"},
+	{SDR_PARTFSFREE_FMT,	"PartFsFreeFmt"},
+	{SDR_PARTFSUSED_FMT,	"PartFsUsedFmt"}
 };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -76,6 +52,7 @@ QGfaStgDevList::QGfaStgDevList(QObject *pParent) : 	QAbstractTableModel(pParent)
 {
 	memset(&m_stgDevShadowCpy, 0, sizeof(m_stgDevShadowCpy));
     setObjectName("QGfaStgDevList");
+	static_assert(_countof(m_roles) == (SDR_PARTFSUSED_FMT - SDR_DISKNAME + 1), "enum StgDevRoles does not match array STG_DEV_ROLES!");
 }
 
 QGfaStgDevList::~QGfaStgDevList(void)
@@ -91,7 +68,7 @@ int QGfaStgDevList::rowCount(const QModelIndex &parent) const
 int QGfaStgDevList::columnCount(const QModelIndex &parent) const
 {
 	Q_UNUSED(parent);
-	return (int)_countof(g_roles);
+	return (int)_countof(m_roles);
 }
 
 QVariant QGfaStgDevList::data(const QModelIndex &index, int role) const
@@ -110,49 +87,61 @@ QVariant QGfaStgDevList::data(const QModelIndex &index, int role) const
 	{
 		switch(role)
 		{
-		case SDR_DiskName:
+		case SDR_DISKNAME:
 			val = _NA_STRING(disk.szName);
 			break;
-		case SDR_DiskDevNode:
+		case SDR_DISKDEVNODE:
 			val = _NA_STRING(disk.szDevNode);
 			break;
-		case SDR_DiskBusType:
+		case SDR_DISKBUSTYPE:
 			val = disk.internal ? "int" : _OPT_STRING(disk.szBus, "mmc");
 			break;
-		case SDR_DiskVendorName:
+		case SDR_DISKVENDORNAME:
 			val = _NA_STRING(disk.szVendor);
 			break;
-		case SDR_DiskVendorID:
+		case SDR_DISKVENDORID:
 			val = (int)disk.nVendorID;
 			break;
-		case SDR_DiskProductID:
+		case SDR_DISKPRODUCTID:
 			val = (int)disk.nProductID;
 			break;
-		case SDR_PartFsLabel:
+		case SDR_PARTFSLABEL:
 			val = _NA_STRING(part.szFsLabel);
 			break;
-		case SDR_PartFsType:
+		case SDR_PARTFSTYPE:
 			val = _NA_STRING(part.szFsType);
 			break;
-		case SDR_PartFsVersion:
+		case SDR_PARTFSVERSION:
 			val = _NA_STRING(part.szFsVersion);
 			break;
-		case SDR_PartDevNode:
+		case SDR_PARTDEVNODE:
 			val = _NA_STRING(part.szDevNode);
 			break;
-		case SDR_PartMountPoint:
+		case SDR_PARTMOUNTPOINT:
 			val = _NA_STRING(part.szMntPoint);
 			break;
-		case SDR_PartSize:
+		case SDR_PARTSIZE:
+			val = (quint64)part.nKiBPartSize;
+			break;
+		case SDR_PARTFSSIZE:
+			val = (quint64)part.nKiBSize;
+			break;
+		case SDR_PARTFSFREE:
+			val = (quint64)part.nKiBFree;
+			break;
+		case SDR_PARTFSUSED:
+			val = (quint64)part.nKiBUsed;
+			break;
+		case SDR_PARTSIZE_FMT:
 			val = FormatByteSize(part.nKiBPartSize * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
 			break;
-		case SDR_PartFsSize:
+		case SDR_PARTFSSIZE_FMT:
 			val = FormatByteSize(part.nKiBSize * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
 			break;
-		case SDR_PartFsFree:
+		case SDR_PARTFSFREE_FMT:
 			val = FormatByteSize(part.nKiBFree * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
 			break;
-		case SDR_PartFsUsed:
+		case SDR_PARTFSUSED_FMT:
 			val = FormatByteSize(part.nKiBUsed * _BYTE_SIZE_KIB, szBuf, _countof(szBuf));
 			break;
 		default:
@@ -167,9 +156,9 @@ QHash<int, QByteArray> QGfaStgDevList::roleNames(void) const
 {
 	QHash<int, QByteArray> roles;
 	
-	for(size_t i = 0; i < _countof(g_roles); ++i)
+	for(size_t i = 0; i < _countof(m_roles); ++i)
 	{
-		roles[g_roles[i].nRole] = g_roles[i].pszRoleName;
+		roles[m_roles[i].nRole] = m_roles[i].pszRoleName;
 	}
 
 	return roles;
@@ -258,7 +247,7 @@ void QGfaStgDevList::mountAdded(int nIndex, const GFA_SYSINFO_PARTITION &part)
 			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});
+			emit dataChanged(i, i, {SDR_PARTMOUNTPOINT, SDR_PARTFSSIZE, SDR_PARTFSFREE, SDR_PARTFSUSED});
 		}
 	}
 }
@@ -276,7 +265,7 @@ void QGfaStgDevList::mountRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part)
 			p.nKiBFree = 0;
 			p.nKiBUsed = 0;
 			QModelIndex i = createIndex(nIndex, 0);
-			emit dataChanged(i, i, {SDR_PartMountPoint, SDR_PartFsSize, SDR_PartFsFree, SDR_PartFsUsed});
+			emit dataChanged(i, i, {SDR_PARTMOUNTPOINT, SDR_PARTFSSIZE, SDR_PARTFSFREE, SDR_PARTFSUSED});
 		}
 	}
 }
@@ -294,12 +283,42 @@ void QGfaStgDevList::clearAll(void)
 	}
 }
 
-void QGfaStgDevList::updateModel(void)
+void QGfaStgDevList::updatePartitionInfo(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 {
-//	beginResetModel();
-//	endResetModel();
+	int nIndex = 0;
+	TRACE("Storage Device Map updated\n");
+
+	beginResetModel();
+	m_partVec.clear();
+	memcpy(&m_stgDevShadowCpy, &sdm, sizeof(sdm));
+	
+	for(int d = 0; d < GFA_APPCTRL_MAX_DISKS; ++d)
+	{
+		const GFA_SYSINFO_DISK &disk = m_stgDevShadowCpy.disks[d];
+
+		if(disk.valid)
+		{
+			for(int p = 0; p < (int)disk.nPartCount; ++p)
+			{
+				int nPartIdx = disk.aPartIdx[p];
+				const GFA_SYSINFO_PARTITION &part = m_stgDevShadowCpy.parts[nPartIdx];
+				
+				if(part.valid)
+				{
+					m_partVec.emplace_back(part.nDiskIdx, nPartIdx);
+					QModelIndex i = createIndex(nIndex++, 0);
+					emit dataChanged(i, i, {SDR_DISKNAME, 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});
+				}
+			}
+		}
+	}
+	endResetModel();
 }
 
+/*void QGfaStgDevList::updateModel(const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
+{
+}*/
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
@@ -512,7 +531,7 @@ QGfaSysInfo::~QGfaSysInfo(void)
 
 /////////////////////////////////////////////////////////////////////////////
 
-void QGfaSysInfo::setSysInfoRunning(bool bRunning)
+void QGfaSysInfo::setSysInfoRunning(bool bRunning, const GFA_SYSINFO_STORAGE_DEVICE_MAP &sdm)
 {
 	if(m_bSysInfoRunning != bRunning)
 	{
@@ -523,7 +542,7 @@ void QGfaSysInfo::setSysInfoRunning(bool bRunning)
 		}
 		else
 		{
-			m_stgDevList.updateModel();
+			m_stgDevList.updatePartitionInfo(sdm);
 		}
 	}
 }