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
PIM
Akonadi Search
Commits
40684369
Commit
40684369
authored
Mar 14, 2022
by
Laurent Montel
😁
Browse files
Fix clazy warnings
parent
f2360a19
Pipeline
#150025
passed with stage
in 1 minute and 45 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
akonadiplugin/searchplugin.cpp
View file @
40684369
...
...
@@ -188,9 +188,10 @@ Term recursiveEmailTermMapping(const Akonadi::SearchTerm &term)
Term
recursiveCalendarTermMapping
(
const
Akonadi
::
SearchTerm
&
term
)
{
if
(
!
term
.
subTerms
().
isEmpty
())
{
const
auto
subTerms
{
term
.
subTerms
()};
if
(
!
subTerms
.
isEmpty
())
{
Term
t
(
mapRelation
(
term
.
relation
()));
for
(
const
Akonadi
::
SearchTerm
&
subterm
:
term
.
subTerms
()
)
{
for
(
const
Akonadi
::
SearchTerm
&
subterm
:
subTerms
)
{
const
Term
newTerm
=
recursiveCalendarTermMapping
(
subterm
);
if
(
newTerm
.
isValid
())
{
t
.
addSubTerm
(
newTerm
);
...
...
@@ -223,9 +224,10 @@ Term recursiveCalendarTermMapping(const Akonadi::SearchTerm &term)
Term
recursiveNoteTermMapping
(
const
Akonadi
::
SearchTerm
&
term
)
{
if
(
!
term
.
subTerms
().
isEmpty
())
{
const
auto
subTerms
{
term
.
subTerms
()};
if
(
!
subTerms
.
isEmpty
())
{
Term
t
(
mapRelation
(
term
.
relation
()));
for
(
const
Akonadi
::
SearchTerm
&
subterm
:
term
.
subTerms
()
)
{
for
(
const
Akonadi
::
SearchTerm
&
subterm
:
subTerms
)
{
const
Term
newTerm
=
recursiveNoteTermMapping
(
subterm
);
if
(
newTerm
.
isValid
())
{
t
.
addSubTerm
(
newTerm
);
...
...
@@ -251,9 +253,10 @@ Term recursiveNoteTermMapping(const Akonadi::SearchTerm &term)
Term
recursiveContactTermMapping
(
const
Akonadi
::
SearchTerm
&
term
)
{
if
(
!
term
.
subTerms
().
isEmpty
())
{
const
auto
subTerms
{
term
.
subTerms
()};
if
(
!
subTerms
.
isEmpty
())
{
Term
t
(
mapRelation
(
term
.
relation
()));
for
(
const
Akonadi
::
SearchTerm
&
subterm
:
term
.
subTerms
()
)
{
for
(
const
Akonadi
::
SearchTerm
&
subterm
:
subTerms
)
{
const
Term
newTerm
=
recursiveContactTermMapping
(
subterm
);
if
(
newTerm
.
isValid
())
{
t
.
addSubTerm
(
newTerm
);
...
...
core/query.cpp
View file @
40684369
...
...
@@ -204,7 +204,8 @@ ResultIterator Query::exec()
SearchStore
*
storeMatch
=
nullptr
;
for
(
const
QSharedPointer
<
SearchStore
>
&
store
:
std
::
as_const
(
*
s_searchStores
))
{
bool
matches
=
true
;
for
(
const
QString
&
type
:
types
())
{
const
auto
typeList
{
types
()};
for
(
const
QString
&
type
:
typeList
)
{
if
(
!
store
->
types
().
contains
(
type
))
{
matches
=
false
;
break
;
...
...
core/query.h
View file @
40684369
...
...
@@ -126,9 +126,9 @@ public:
void
addCustomOption
(
const
QString
&
option
,
const
QVariant
&
value
);
void
removeCustomOption
(
const
QString
&
option
);
QVariant
customOption
(
const
QString
&
option
)
const
;
QVariantMap
customOptions
()
const
;
Q_REQUIRED_RESULT
QVariantMap
customOptions
()
const
;
ResultIterator
exec
();
Q_REQUIRED_RESULT
ResultIterator
exec
();
Q_REQUIRED_RESULT
QByteArray
toJSON
()
const
;
static
Query
fromJSON
(
const
QByteArray
&
arr
);
...
...
core/searchstore.cpp
View file @
40684369
...
...
@@ -78,7 +78,7 @@ SearchStore::List SearchStore::searchStores()
const
QStringList
paths
=
QCoreApplication
::
libraryPaths
();
for
(
const
QString
&
libraryPath
:
paths
)
{
QString
path
(
libraryPath
+
QStringLiteral
(
"/akonadi"
));
const
QString
path
(
libraryPath
+
QStringLiteral
(
"/akonadi"
));
QDir
dir
(
path
);
if
(
!
dir
.
exists
())
{
...
...
core/term.cpp
View file @
40684369
...
...
@@ -301,10 +301,10 @@ Term Term::fromVariantMap(const QVariantMap &map)
Term
term
;
QString
andOrString
;
if
(
map
.
contains
(
Q
Latin1
String
(
"$and"
)))
{
if
(
map
.
contains
(
QString
Literal
(
"$and"
)))
{
andOrString
=
QStringLiteral
(
"$and"
);
term
.
setOperation
(
And
);
}
else
if
(
map
.
contains
(
Q
Latin1
String
(
"$or"
)))
{
}
else
if
(
map
.
contains
(
QString
Literal
(
"$or"
)))
{
andOrString
=
QStringLiteral
(
"$or"
);
term
.
setOperation
(
Or
);
}
...
...
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