reimplemented detection of broken references in PartDownloadRequest::downloadFinished

Sat, 03 Mar 2018 17:56:49 +0200

author
Santeri Piippo
date
Sat, 03 Mar 2018 17:56:49 +0200
changeset 1265
f05683924e86
parent 1264
5f00dfde4901
child 1266
eeaca12d3d76

reimplemented detection of broken references in PartDownloadRequest::downloadFinished

src/partdownloadrequest.cpp file | annotate | diff | comparison | revisions
--- a/src/partdownloadrequest.cpp	Sat Mar 03 17:52:40 2018 +0200
+++ b/src/partdownloadrequest.cpp	Sat Mar 03 17:56:49 2018 +0200
@@ -217,17 +217,12 @@
 
 	// Iterate through this file and check for errors. If there's any that stems
 	// from unknown file references, try resolve that by downloading the reference.
-	// This is why downloading a part may end up downloading multiple files, as
-	// it resolves dependencies.
 	for (LDObject* obj : document->objects())
 	{
-		LDError* err = dynamic_cast<LDError*> (obj);
+		LDSubfileReference* reference = dynamic_cast<LDSubfileReference*>(obj);
 
-		if (err == nullptr or err->fileReferenced().isEmpty())
-			continue;
-
-		QString dest = err->fileReferenced();
-		prompt()->downloadFromPartsTracker (dest);
+		if (reference and reference->fileInfo(m_documents) == nullptr)
+			prompt()->downloadFromPartsTracker(reference->referenceName());
 	}
 
 	prompt()->addFile (document);

mercurial