Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
Akonadi Search
Commits
e05cc3bd
Commit
e05cc3bd
authored
Aug 29, 2020
by
Ahmad Samir
Committed by
Daniel Vrátil
Aug 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent crash by catching exceptions thrown by Xapian::WritableDatabase::commit
BUG: 418804
parent
25041b07
Pipeline
#32511
passed with stage
in 29 minutes and 26 seconds
Changes
5
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
27 deletions
+54
-27
agent/akonotesindexer.cpp
agent/akonotesindexer.cpp
+10
-5
agent/calendarindexer.cpp
agent/calendarindexer.cpp
+10
-5
agent/collectionindexer.cpp
agent/collectionindexer.cpp
+8
-1
agent/contactindexer.cpp
agent/contactindexer.cpp
+10
-5
agent/emailindexer.cpp
agent/emailindexer.cpp
+16
-11
No files found.
agent/akonotesindexer.cpp
View file @
e05cc3bd
...
...
@@ -27,10 +27,8 @@ AkonotesIndexer::AkonotesIndexer(const QString &path)
AkonotesIndexer
::~
AkonotesIndexer
()
{
if
(
m_db
)
{
m_db
->
commit
();
delete
m_db
;
}
commit
();
delete
m_db
;
}
QStringList
AkonotesIndexer
::
mimeTypes
()
const
...
...
@@ -125,9 +123,16 @@ void AkonotesIndexer::processPart(KMime::Content *content, KMime::Content *mainC
void
AkonotesIndexer
::
commit
()
{
if
(
m_db
)
{
if
(
!
m_db
)
{
return
;
}
try
{
m_db
->
commit
();
}
catch
(
const
Xapian
::
Error
&
err
)
{
qCWarning
(
AKONADI_INDEXER_AGENT_LOG
)
<<
err
.
get_error_string
();
}
qCDebug
(
AKONADI_INDEXER_AGENT_LOG
)
<<
"Xapian Committed"
;
}
void
AkonotesIndexer
::
remove
(
const
Akonadi
::
Item
&
item
)
...
...
agent/calendarindexer.cpp
View file @
e05cc3bd
...
...
@@ -30,10 +30,8 @@ CalendarIndexer::CalendarIndexer(const QString &path)
CalendarIndexer
::~
CalendarIndexer
()
{
if
(
m_db
)
{
m_db
->
commit
();
delete
m_db
;
}
commit
();
delete
m_db
;
}
QStringList
CalendarIndexer
::
mimeTypes
()
const
...
...
@@ -59,9 +57,16 @@ void CalendarIndexer::index(const Akonadi::Item &item)
void
CalendarIndexer
::
commit
()
{
if
(
m_db
)
{
if
(
!
m_db
)
{
return
;
}
try
{
m_db
->
commit
();
}
catch
(
const
Xapian
::
Error
&
err
)
{
qCWarning
(
AKONADI_INDEXER_AGENT_LOG
)
<<
err
.
get_error_string
();
}
qCDebug
(
AKONADI_INDEXER_AGENT_LOG
)
<<
"Xapian Committed"
;
}
void
CalendarIndexer
::
remove
(
const
Akonadi
::
Item
&
item
)
...
...
agent/collectionindexer.cpp
View file @
e05cc3bd
...
...
@@ -149,7 +149,14 @@ void CollectionIndexer::move(const Akonadi::Collection &collection, const Akonad
void
CollectionIndexer
::
commit
()
{
if
(
m_db
)
{
if
(
!
m_db
)
{
return
;
}
try
{
m_db
->
commit
();
}
catch
(
const
Xapian
::
Error
&
err
)
{
qCWarning
(
AKONADI_INDEXER_AGENT_LOG
)
<<
err
.
get_error_string
();
}
qCDebug
(
AKONADI_INDEXER_AGENT_LOG
)
<<
"Xapian Committed"
;
}
agent/contactindexer.cpp
View file @
e05cc3bd
...
...
@@ -31,10 +31,8 @@ ContactIndexer::ContactIndexer(const QString &path)
ContactIndexer
::~
ContactIndexer
()
{
if
(
m_db
)
{
m_db
->
commit
();
delete
m_db
;
}
commit
();
delete
m_db
;
}
QStringList
ContactIndexer
::
mimeTypes
()
const
...
...
@@ -162,9 +160,16 @@ void ContactIndexer::remove(const Akonadi::Collection &collection)
void
ContactIndexer
::
commit
()
{
if
(
m_db
)
{
if
(
!
m_db
)
{
return
;
}
try
{
m_db
->
commit
();
}
catch
(
const
Xapian
::
Error
&
err
)
{
qCWarning
(
AKONADI_INDEXER_AGENT_LOG
)
<<
err
.
get_error_string
();
}
qCDebug
(
AKONADI_INDEXER_AGENT_LOG
)
<<
"Xapian Committed"
;
}
void
ContactIndexer
::
move
(
Akonadi
::
Item
::
Id
itemId
,
Akonadi
::
Collection
::
Id
from
,
Akonadi
::
Collection
::
Id
to
)
...
...
agent/emailindexer.cpp
View file @
e05cc3bd
...
...
@@ -42,15 +42,9 @@ EmailIndexer::EmailIndexer(const QString &path, const QString &contactDbPath)
EmailIndexer
::~
EmailIndexer
()
{
if
(
m_db
)
{
m_db
->
commit
();
delete
m_db
;
}
if
(
m_contactDb
)
{
m_contactDb
->
commit
();
delete
m_contactDb
;
}
commit
();
delete
m_db
;
delete
m_contactDb
;
}
QStringList
EmailIndexer
::
mimeTypes
()
const
...
...
@@ -397,9 +391,20 @@ void EmailIndexer::move(Akonadi::Item::Id itemId, Akonadi::Collection::Id from,
void
EmailIndexer
::
commit
()
{
if
(
m_db
)
{
m_db
->
commit
();
try
{
m_db
->
commit
();
}
catch
(
const
Xapian
::
Error
&
err
)
{
qCWarning
(
AKONADI_INDEXER_AGENT_LOG
)
<<
err
.
get_error_string
();
}
qCDebug
(
AKONADI_INDEXER_AGENT_LOG
)
<<
"Xapian Committed"
;
}
if
(
m_contactDb
)
{
m_contactDb
->
commit
();
try
{
m_contactDb
->
commit
();
}
catch
(
const
Xapian
::
Error
&
err
)
{
qCWarning
(
AKONADI_INDEXER_AGENT_LOG
)
<<
err
.
get_error_string
();
}
qCDebug
(
AKONADI_INDEXER_AGENT_LOG
)
<<
"Xapian Committed"
;
}
}
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