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
913afb06
Commit
913afb06
authored
Jan 04, 2018
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't allow empty searches in debug mode
They are not useful
parent
13d53ae9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
libdiscover/resources/AbstractResourcesBackend.h
libdiscover/resources/AbstractResourcesBackend.h
+2
-0
libdiscover/resources/ResourcesModel.cpp
libdiscover/resources/ResourcesModel.cpp
+2
-0
No files found.
libdiscover/resources/AbstractResourcesBackend.h
View file @
913afb06
...
...
@@ -101,6 +101,8 @@ class DISCOVERCOMMON_EXPORT AbstractResourcesBackend : public QObject
QString
origin
;
bool
allBackends
=
false
;
bool
isEmpty
()
const
{
return
!
category
&&
state
==
AbstractResource
::
Broken
&&
mimetype
.
isEmpty
()
&&
search
.
isEmpty
()
&&
extends
.
isEmpty
()
&&
resourceUrl
.
isEmpty
()
&&
origin
.
isEmpty
();
}
bool
shouldFilter
(
AbstractResource
*
res
)
const
;
void
filterJustInCase
(
QVector
<
AbstractResource
*>&
input
)
const
;
};
...
...
libdiscover/resources/ResourcesModel.cpp
View file @
913afb06
...
...
@@ -322,6 +322,8 @@ AggregatedResultsStream * ResourcesModel::findResourceByPackageName(const QUrl&
AggregatedResultsStream
*
ResourcesModel
::
search
(
const
AbstractResourcesBackend
::
Filters
&
search
)
{
Q_ASSERT
(
!
search
.
isEmpty
());
auto
streams
=
kTransform
<
QSet
<
ResultsStream
*>>
(
m_backends
,
[
search
](
AbstractResourcesBackend
*
backend
){
return
backend
->
search
(
search
);
});
return
new
AggregatedResultsStream
(
streams
);
}
...
...
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