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
4b991b85
Commit
4b991b85
authored
Sep 30, 2020
by
Laurent Montel
😁
Browse files
Add more const
parent
109dfe13
Pipeline
#36009
passed with stage
in 15 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
agent/emailindexer.cpp
View file @
4b991b85
...
...
@@ -86,8 +86,8 @@ void EmailIndexer::index(const Akonadi::Item &item)
Q_ASSERT_X
(
item
.
parentCollection
().
isValid
(),
"Akonadi::Search::EmailIndexer::index"
,
"Item does not have a valid parent collection"
);
Akonadi
::
Collection
::
Id
colId
=
item
.
parentCollection
().
id
();
QByteArray
term
=
'C'
+
QByteArray
::
number
(
colId
);
const
Akonadi
::
Collection
::
Id
colId
=
item
.
parentCollection
().
id
();
const
QByteArray
term
=
'C'
+
QByteArray
::
number
(
colId
);
m_doc
->
add_boolean_term
(
term
.
data
());
m_db
->
replace_document
(
item
.
id
(),
*
m_doc
);
...
...
@@ -141,7 +141,7 @@ void EmailIndexer::insert(const QByteArray &key, const KMime::Types::Mailbox::Li
return
;
}
for
(
const
KMime
::
Types
::
Mailbox
&
mbox
:
list
)
{
std
::
string
name
(
mbox
.
name
().
toStdString
());
const
std
::
string
name
(
mbox
.
name
().
toStdString
());
m_termGen
->
index_text_without_positions
(
name
,
1
,
key
.
data
());
m_termGen
->
index_text_without_positions
(
name
,
1
);
m_termGen
->
index_text_without_positions
(
mbox
.
address
().
data
(),
1
,
key
.
data
());
...
...
@@ -160,7 +160,7 @@ void EmailIndexer::insert(const QByteArray &key, const KMime::Types::Mailbox::Li
continue
;
}
catch
(
const
Xapian
::
DocNotFoundError
&
)
{
Xapian
::
Document
doc
;
std
::
string
pretty
(
pa
.
toStdString
());
const
std
::
string
pretty
(
pa
.
toStdString
());
doc
.
set_data
(
pretty
);
Xapian
::
TermGenerator
termGen
;
...
...
@@ -181,7 +181,7 @@ void EmailIndexer::process(const KMime::Message::Ptr &msg)
// (Give the subject a higher priority)
KMime
::
Headers
::
Subject
*
subject
=
msg
->
subject
(
false
);
if
(
subject
)
{
std
::
string
str
(
subject
->
asUnicodeString
().
toStdString
());
const
std
::
string
str
(
subject
->
asUnicodeString
().
toStdString
());
qCDebug
(
AKONADI_INDEXER_AGENT_LOG
)
<<
"Indexing"
<<
str
.
c_str
();
m_termGen
->
index_text_without_positions
(
str
,
1
,
"SU"
);
m_termGen
->
index_text_without_positions
(
str
,
100
);
...
...
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