Warning, /plasma/plasma-systemmonitor/src/faces/applicationstable/contents/ui/ApplicationInformation.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQml
0008 
0009 QtObject {
0010     id: info
0011 
0012     property var model
0013     property var index
0014     onIndexChanged: info.update()
0015 
0016     property var sensorColumns
0017     property int role
0018     property int pidsRole
0019 
0020     property string name
0021     property string menuId
0022     property real cpu
0023     property real memory
0024     property real netInbound
0025     property real netOutbound
0026     property real diskRead
0027     property real diskWrite
0028 
0029     property string cpuMode
0030 
0031     property string iconName
0032 
0033     property var pids: []
0034 
0035     property var connection: Connections {
0036         target: model
0037         function onDataChanged() { if (info) { info.update() } }
0038     }
0039 
0040     function update() {
0041         if ( model == null || index == null) {
0042             return
0043         }
0044 
0045         name = "" + model.data(model.index(index.row, sensorColumns["name"]), role)
0046         cpu = parseFloat(model.data(model.index(index.row, sensorColumns["cpu"]), role))
0047         memory = parseFloat(model.data(model.index(index.row, sensorColumns["memory"]), role))
0048         netInbound = parseFloat(model.data(model.index(index.row, sensorColumns["netInbound"]), role))
0049         netOutbound = parseFloat(model.data(model.index(index.row, sensorColumns["netOutbound"]), role))
0050         diskRead = parseFloat(model.data(model.index(index.row, sensorColumns["diskRead"]), role))
0051         diskWrite = parseFloat(model.data(model.index(index.row, sensorColumns["diskWrite"]), role))
0052         iconName = "" + model.data(model.index(index.row, sensorColumns["iconName"]), role)
0053 
0054         pids = model.data(model.index(index.row, 0), pidsRole)
0055         if (!pids) {
0056             pids = []
0057         }
0058     }
0059 }