39 |
39 |
40 // ============================================================================= |
40 // ============================================================================= |
41 // ----------------------------------------------------------------------------- |
41 // ----------------------------------------------------------------------------- |
42 void PartDownloader::k_download() |
42 void PartDownloader::k_download() |
43 { str path = getDownloadPath(); |
43 { str path = getDownloadPath(); |
|
44 assert (false); |
44 |
45 |
45 if (path == "" || QDir (path).exists() == false) |
46 if (path == "" || QDir (path).exists() == false) |
46 { critical (PartDownloader::tr ("You need to specify a valid path for " |
47 { critical (PartDownloader::tr ("You need to specify a valid path for " |
47 "downloaded files in the configuration to download paths.")); |
48 "downloaded files in the configuration to download paths.")); |
48 |
49 |
230 // Don't download files repeadetly. |
231 // Don't download files repeadetly. |
231 if (m_filesToDownload.indexOf (dest) != -1) |
232 if (m_filesToDownload.indexOf (dest) != -1) |
232 return; |
233 return; |
233 |
234 |
234 modifyDest (dest); |
235 modifyDest (dest); |
235 print ("DOWNLOAD: %1 -> %2\n", url, PartDownloader::getDownloadPath() + DIRSLASH + dest); |
236 log ("DOWNLOAD: %1 -> %2\n", url, PartDownloader::getDownloadPath() + DIRSLASH + dest); |
236 PartDownloadRequest* req = new PartDownloadRequest (url, dest, primary, this); |
237 PartDownloadRequest* req = new PartDownloadRequest (url, dest, primary, this); |
237 |
238 |
238 m_filesToDownload << dest; |
239 m_filesToDownload << dest; |
239 m_requests << req; |
240 m_requests << req; |
240 ui->progress->insertRow (row); |
241 ui->progress->insertRow (row); |
318 str dirpath = dirname (m_fpath); |
319 str dirpath = dirname (m_fpath); |
319 |
320 |
320 QDir dir (dirpath); |
321 QDir dir (dirpath); |
321 |
322 |
322 if (!dir.exists()) |
323 if (!dir.exists()) |
323 { print ("Creating %1...\n", dirpath); |
324 { log ("Creating %1...\n", dirpath); |
324 |
325 |
325 if (!dir.mkpath (dirpath)) |
326 if (!dir.mkpath (dirpath)) |
326 critical (fmt (tr ("Couldn't create the directory %1!"), dirpath)); |
327 critical (fmt (tr ("Couldn't create the directory %1!"), dirpath)); |
327 } |
328 } |
328 |
329 |