Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Discover
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Discover
Commits
df12760c
Commit
df12760c
authored
Jan 29, 2018
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cap the amount of KNS requests we do per query
There are a lot of wallpapers... BUG: 389605
parent
d3eddd3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
libdiscover/backends/KNSBackend/KNSBackend.cpp
libdiscover/backends/KNSBackend/KNSBackend.cpp
+7
-1
libdiscover/backends/KNSBackend/KNSBackend.h
libdiscover/backends/KNSBackend/KNSBackend.h
+1
-0
No files found.
libdiscover/backends/KNSBackend/KNSBackend.cpp
View file @
df12760c
...
...
@@ -213,7 +213,7 @@ void KNSBackend::receivedEntries(const KNSCore::EntryInternal::List& entries)
Q_EMIT
receivedResources
(
resources
);
}
if
(
resources
.
isEmpty
())
{
if
(
resources
.
isEmpty
()
||
m_stopSearching
)
{
Q_EMIT
searchFinished
();
Q_EMIT
availableForQueries
();
setFetching
(
false
);
...
...
@@ -346,6 +346,12 @@ ResultsStream* KNSBackend::searchStream(const QString &searchText)
m_onePage
=
false
;
m_responsePending
=
true
;
QSharedPointer
<
int
>
count
(
new
int
(
0
));
connect
(
this
,
&
KNSBackend
::
receivedResources
,
stream
,
[
this
,
count
](
const
QVector
<
AbstractResource
*>&
resources
){
*
count
+=
resources
.
count
();
if
(
*
count
>
2000
)
m_stopSearching
=
true
;
});
connect
(
this
,
&
KNSBackend
::
receivedResources
,
stream
,
&
ResultsStream
::
resourcesFound
);
connect
(
this
,
&
KNSBackend
::
searchFinished
,
stream
,
&
ResultsStream
::
finish
);
connect
(
this
,
&
KNSBackend
::
startingSearch
,
stream
,
&
ResultsStream
::
finish
);
...
...
libdiscover/backends/KNSBackend/KNSBackend.h
View file @
df12760c
...
...
@@ -83,6 +83,7 @@ private:
ResultsStream
*
searchStream
(
const
QString
&
searchText
);
bool
m_onePage
=
false
;
bool
m_stopSearching
=
false
;
bool
m_responsePending
=
false
;
bool
m_fetching
;
bool
m_isValid
;
...
...
Write
Preview
Markdown
is supported
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