src/partdownloader.cpp

changeset 1017
fc1c13db9618
parent 1014
f0a8ecb6a357
child 1046
f4a7b56c7eb2
equal deleted inserted replaced
1016:3b279b5e57d3 1017:fc1c13db9618
72 path = QFileDialog::getExistingDirectory (this, "Path for downloaded files:"); 72 path = QFileDialog::getExistingDirectory (this, "Path for downloaded files:");
73 73
74 if (path.isEmpty()) 74 if (path.isEmpty())
75 reject(); 75 reject();
76 else 76 else
77 Config->setDownloadFilePath (path); 77 m_config->setDownloadFilePath (path);
78 } 78 }
79 } 79 }
80 80
81 QString PartDownloader::url() 81 QString PartDownloader::url()
82 { 82 {
101 void PartDownloader::modifyDestination (QString& dest) const 101 void PartDownloader::modifyDestination (QString& dest) const
102 { 102 {
103 dest = dest.simplified(); 103 dest = dest.simplified();
104 104
105 // If the user doesn't want us to guess, stop right here. 105 // If the user doesn't want us to guess, stop right here.
106 if (not Config->guessDownloadPaths()) 106 if (not m_config->guessDownloadPaths())
107 return; 107 return;
108 108
109 // Ensure .dat extension 109 // Ensure .dat extension
110 if (dest.right (4) != ".dat") 110 if (dest.right (4) != ".dat")
111 { 111 {
269 emit primaryFileDownloaded(); 269 emit primaryFileDownloaded();
270 270
271 for (LDDocument* f : m_files) 271 for (LDDocument* f : m_files)
272 f->reloadAllSubfiles(); 272 f->reloadAllSubfiles();
273 273
274 if (Config->autoCloseDownloadDialog() and not failed) 274 if (m_config->autoCloseDownloadDialog() and not failed)
275 { 275 {
276 // Close automatically if desired. 276 // Close automatically if desired.
277 accept(); 277 accept();
278 } 278 }
279 else 279 else
321 m_primaryFile = document; 321 m_primaryFile = document;
322 } 322 }
323 323
324 QString PartDownloader::downloadPath() 324 QString PartDownloader::downloadPath()
325 { 325 {
326 QString path = Config->downloadFilePath(); 326 QString path = m_config->downloadFilePath();
327 327
328 if (DIRSLASH[0] != '/') 328 if (DIRSLASH[0] != '/')
329 path.replace (DIRSLASH, "/"); 329 path.replace (DIRSLASH, "/");
330 330
331 return path; 331 return path;

mercurial