src/partdownloader.cpp

changeset 1224
5a31b6d4bf81
parent 1222
34def2630300
child 1226
d1199d965235
equal deleted inserted replaced
1223:4f8fa42aed07 1224:5a31b6d4bf81
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 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 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 (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 = 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