downloading a PDF to add it to the current document was no longer working due to changes in QUrl::toLocalFile

preferencesAboutTextFull
Clément Fauconnier 5 years ago
parent 90fd7191df
commit 11654b6ee9
  1. 6
      src/board/UBBoardController.cpp

@ -1397,8 +1397,11 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
qDebug() << "accepting mime type" << mimeType << "as PDF";
qDebug() << "pdf data length: " << pData.size();
qDebug() << "sourceurl : " + sourceUrl.toString();
QString sUrl = sourceUrl.toString();
int result = 0;
if(!sourceUrl.isEmpty()){
if(!sourceUrl.isEmpty() && (sUrl.startsWith("file://") || sUrl.startsWith("/")))
{
QStringList fileNames;
fileNames << sourceUrl.toLocalFile();
result = UBDocumentManager::documentManager()->addFilesToDocument(selectedDocument(), fileNames);
@ -1411,6 +1414,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
QStringList fileNames;
fileNames << pdfFile.fileName();
result = UBDocumentManager::documentManager()->addFilesToDocument(selectedDocument(), fileNames);
emit documentThumbnailsUpdated(this);
pdfFile.close();
}
}

Loading…
Cancel
Save