Skip to content
GitLab
Menu
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
9dc488c2
Commit
9dc488c2
authored
Feb 22, 2021
by
Aleix Pol Gonzalez
🐧
Browse files
pk: make sure search queries eventually finish
BUG: 432384
parent
b9ec2833
Changes
1
Hide whitespace changes
Inline
Side-by-side
libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
View file @
9dc488c2
...
...
@@ -453,6 +453,7 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
if
(
!
resources
.
isEmpty
())
{
stream
->
setResources
(
resources
);
}
stream
->
finish
();
};
runWhenInitialized
(
f
,
stream
);
return
stream
;
...
...
@@ -466,6 +467,7 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
auto
installedAndNameFilter
=
[
filter
]
(
AbstractResource
*
res
)
{
return
res
->
state
()
>=
AbstractResource
::
Installed
&&
(
res
->
name
().
contains
(
filter
.
search
)
||
res
->
packageName
()
==
filter
.
search
);
};
bool
furtherSearch
=
false
;
if
(
!
toResolve
.
isEmpty
())
{
resolvePackages
(
kTransform
<
QStringList
>
(
toResolve
,
[]
(
AbstractResource
*
res
)
{
return
res
->
packageName
();
}));
connect
(
m_resolveTransaction
,
&
PKResolveTransaction
::
allFinished
,
this
,
[
stream
,
toResolve
,
installedAndNameFilter
]
{
...
...
@@ -474,6 +476,7 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
Q_EMIT
stream
->
resourcesFound
(
resolved
);
stream
->
finish
();
});
furtherSearch
=
true
;
}
const
auto
resolved
=
kFilter
<
QVector
<
AbstractResource
*>>
(
m_packages
.
packages
,
installedAndNameFilter
);
...
...
@@ -484,8 +487,12 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
if
(
toResolve
.
isEmpty
())
stream
->
finish
();
});
});
furtherSearch
=
true
;
}
if
(
!
furtherSearch
)
stream
->
finish
();
};
runWhenInitialized
(
f
,
stream
);
return
stream
;
...
...
@@ -496,6 +503,7 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
if
(
!
resources
.
isEmpty
())
{
stream
->
setResources
(
resources
);
}
stream
->
finish
();
};
runWhenInitialized
(
f
,
stream
);
return
stream
;
...
...
Aleix Pol Gonzalez
🐧
@apol
mentioned in commit
2b28baa6
·
Feb 22, 2021
mentioned in commit
2b28baa6
mentioned in commit 2b28baa68cc1d2c942be9247b0f9fb8d0d1ab80b
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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