src/partDownloader.cpp

changeset 978
4603d8fd063e
parent 971
c00f9665a9f8
child 981
5d5d84ab2c48
equal deleted inserted replaced
977:dc3ceb65cda7 978:4603d8fd063e
267 267
268 // ============================================================================= 268 // =============================================================================
269 // 269 //
270 void PartDownloader::downloadFile (QString dest, QString url, bool primary) 270 void PartDownloader::downloadFile (QString dest, QString url, bool primary)
271 { 271 {
272 const int row = form()->progress->rowCount(); 272 int row = form()->progress->rowCount();
273 273
274 // Don't download files repeadetly. 274 // Don't download files repeadetly.
275 if (filesToDownload().indexOf (dest) != -1) 275 if (filesToDownload().indexOf (dest) != -1)
276 return; 276 return;
277 277
310 for (PartDownloadRequest* req : requests()) 310 for (PartDownloadRequest* req : requests())
311 { 311 {
312 if (not req->isFinished()) 312 if (not req->isFinished())
313 return; 313 return;
314 314
315 if (req->state() == PartDownloadRequest::State::Failed) 315 if (req->state() == PartDownloadRequest::State::Failed)
316 failed = true; 316 failed = true;
317 } 317 }
318 318
319 for (PartDownloadRequest* req : requests()) 319 for (PartDownloadRequest* req : requests())
320 delete req; 320 delete req;
322 m_requests.clear(); 322 m_requests.clear();
323 323
324 // Update everything now 324 // Update everything now
325 if (primaryFile() != null) 325 if (primaryFile() != null)
326 { 326 {
327 LDDocument::setCurrent (primaryFile()); 327 g_win->changeDocument (primaryFile());
328 g_win->doFullRefresh(); 328 g_win->doFullRefresh();
329 g_win->R()->resetAngles(); 329 g_win->R()->resetAngles();
330 } 330 }
331 331
332 for (LDDocument* f : m_files) 332 for (LDDocument* f : m_files)
333 f->reloadAllSubfiles(); 333 f->reloadAllSubfiles();
334 334
335 if (m_config->autoCloseDownloadDialog() and not failed) 335 if (m_config->autoCloseDownloadDialog() and not failed)
336 { 336 {
337 // Close automatically if desired. 337 // Close automatically if desired.

mercurial