Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
libksysguard
Commits
b347fcc0
Commit
b347fcc0
authored
Jan 12, 2021
by
David Redondo
🏎
Browse files
Do not set root twice when constructing ApplicationDataModel
Otherwise it will trigger two processes updates
parent
5b09cb7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
processcore/application_data_model.cpp
View file @
b347fcc0
...
...
@@ -25,10 +25,8 @@
using
namespace
KSysGuard
;
ApplicationDataModel
::
ApplicationDataModel
(
QObject
*
parent
)
:
CGroupDataModel
(
parent
)
:
CGroupDataModel
(
QStringLiteral
(
"/user.slice/user-%1.slice/user@%1.service"
).
arg
(
KUserId
::
currentEffectiveUserId
().
toString
()),
parent
)
{
const
QString
userId
=
KUserId
::
currentEffectiveUserId
().
toString
();
setRoot
(
QStringLiteral
(
"/user.slice/user-%1.slice/user@%1.service"
).
arg
(
userId
));
}
bool
ApplicationDataModel
::
filterAcceptsCGroup
(
const
QString
&
id
)
...
...
processcore/cgroup_data_model.cpp
View file @
b347fcc0
...
...
@@ -93,6 +93,11 @@ public:
};
CGroupDataModel
::
CGroupDataModel
(
QObject
*
parent
)
:
CGroupDataModel
(
QStringLiteral
(
"/"
),
parent
)
{
}
CGroupDataModel
::
CGroupDataModel
(
const
QString
&
root
,
QObject
*
parent
)
:
QAbstractItemModel
(
parent
)
,
d
(
new
CGroupDataModelPrivate
)
{
...
...
@@ -118,7 +123,7 @@ CGroupDataModel::CGroupDataModel(QObject *parent)
d
->
m_updateTimer
->
setInterval
(
2000
);
d
->
m_updateTimer
->
start
();
setRoot
(
QStringLiteral
(
"/"
)
);
setRoot
(
root
);
}
CGroupDataModel
::~
CGroupDataModel
()
...
...
processcore/cgroup_data_model.h
View file @
b347fcc0
...
...
@@ -61,6 +61,7 @@ class Q_DECL_EXPORT CGroupDataModel : public QAbstractItemModel
public:
CGroupDataModel
(
QObject
*
parent
=
nullptr
);
CGroupDataModel
(
const
QString
&
root
,
QObject
*
parent
=
nullptr
);
~
CGroupDataModel
();
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
())
const
override
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment