Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
Nepomuk Core
Commits
56e476cd
Commit
56e476cd
authored
Dec 17, 2012
by
Simeon Bird
Browse files
Fix crash if asked to index invalid pdf document. Fix is
as suggested in the poppler-qt4 example. BUG: 310912
parent
1225d953
Changes
1
Hide whitespace changes
Inline
Side-by-side
services/fileindexer/indexer/popplerextractor.cpp
View file @
56e476cd
...
...
@@ -53,6 +53,12 @@ SimpleResourceGraph PopplerExtractor::extract(const QUrl& resUri, const QUrl& fi
SimpleResource
fileRes
(
resUri
);
Poppler
::
Document
*
pdfDoc
=
Poppler
::
Document
::
load
(
fileUrl
.
toLocalFile
(),
0
,
0
);
if
(
!
pdfDoc
||
pdfDoc
->
isLocked
()
){
delete
pdfDoc
;
return
graph
;
}
QString
title
=
pdfDoc
->
info
(
QLatin1String
(
"Title"
));
if
(
!
title
.
isEmpty
()
)
{
fileRes
.
addProperty
(
NIE
::
title
(),
title
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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