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
c120636c
Commit
c120636c
authored
Jan 20, 2022
by
Aleix Pol Gonzalez
🐧
Browse files
Reset the ApplicationAddionsModel when the state of an application changes
BUG: 426027
parent
83bb529c
Pipeline
#126157
passed with stage
in 1 minute and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
libdiscover/ApplicationAddonsModel.cpp
View file @
c120636c
...
...
@@ -6,6 +6,7 @@
#include
"ApplicationAddonsModel.h"
#include
"libdiscover_debug.h"
#include
"utils.h"
#include
<Transaction/TransactionModel.h>
#include
<resources/AbstractResource.h>
#include
<resources/ResourcesModel.h>
...
...
@@ -17,6 +18,17 @@ ApplicationAddonsModel::ApplicationAddonsModel(QObject *parent)
// new QAbstractItemModelTester(this, this);
connect
(
TransactionModel
::
global
(),
&
TransactionModel
::
transactionRemoved
,
this
,
&
ApplicationAddonsModel
::
transactionOver
);
connect
(
ResourcesModel
::
global
(),
&
ResourcesModel
::
resourceDataChanged
,
this
,
[
this
](
AbstractResource
*
resource
,
const
QVector
<
QByteArray
>
&
properties
)
{
if
(
!
properties
.
contains
(
"state"
))
return
;
const
QString
appstreamId
=
resource
->
appstreamId
();
if
(
kContains
(
m_initial
,
[
&
appstreamId
](
const
PackageState
&
state
)
{
return
appstreamId
==
state
.
packageName
();
}))
{
resetState
();
}
});
}
QHash
<
int
,
QByteArray
>
ApplicationAddonsModel
::
roleNames
()
const
...
...
Aleix Pol Gonzalez
🐧
@apol
mentioned in commit
6c55f404
·
Jan 20, 2022
mentioned in commit
6c55f404
mentioned in commit 6c55f404c4795961cc6583924d5f7244532ff71f
Toggle commit list
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