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
Discover
Commits
c97b7f57
Commit
c97b7f57
authored
Jan 15, 2021
by
Aleix Pol Gonzalez
🐧
Browse files
pk: From SystemUpgrade track changes of the packages upgrade
parent
ab019c74
Changes
1
Hide whitespace changes
Inline
Side-by-side
libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp
View file @
c97b7f57
...
...
@@ -60,11 +60,6 @@ public:
:
AbstractResource
(
backend
)
,
m_backend
(
backend
)
{
for
(
auto
res
:
qAsConst
(
m_resources
))
{
connect
(
res
,
&
AbstractResource
::
sizeChanged
,
this
,
[
this
]
{
Q_EMIT
m_backend
->
resourcesChanged
(
this
,
{
"size"
,
"homepage"
,
"license"
});
});
}
}
QString
packageName
()
const
override
{
return
QStringLiteral
(
"discover-offline-upgrade"
);}
...
...
@@ -132,8 +127,20 @@ public:
return
ret
;
}
void
refreshResource
()
{
Q_EMIT
m_backend
->
resourcesChanged
(
this
,
{
"size"
,
"license"
});
}
void
setCandidates
(
const
QSet
<
AbstractResource
*>
&
candidates
)
{
for
(
auto
res
:
(
m_resources
-
candidates
))
{
disconnect
(
res
,
&
AbstractResource
::
sizeChanged
,
this
,
&
SystemUpgrade
::
refreshResource
);
}
const
auto
newCandidates
=
(
candidates
-
m_resources
);
m_resources
=
candidates
;
for
(
auto
res
:
newCandidates
)
{
connect
(
res
,
&
AbstractResource
::
sizeChanged
,
this
,
&
SystemUpgrade
::
refreshResource
);
}
}
private:
...
...
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