src/partdownloader.cpp

changeset 1323
05b3e173c900
parent 1263
0256edecda54
child 1326
69a90bd2dba2
equal deleted inserted replaced
1322:d8935cdb24c0 1323:05b3e173c900
59 path = QFileDialog::getExistingDirectory(this, "Path for downloaded files:"); 59 path = QFileDialog::getExistingDirectory(this, "Path for downloaded files:");
60 60
61 if (path.isEmpty()) 61 if (path.isEmpty())
62 reject(); 62 reject();
63 else 63 else
64 m_config->setDownloadFilePath(path); 64 config::setDownloadFilePath(path);
65 } 65 }
66 } 66 }
67 67
68 QString PartDownloader::url() 68 QString PartDownloader::url()
69 { 69 {
88 void PartDownloader::modifyDestination(QString& destination) const 88 void PartDownloader::modifyDestination(QString& destination) const
89 { 89 {
90 destination = destination.simplified(); 90 destination = destination.simplified();
91 91
92 // If the user doesn't want us to guess, stop right here. 92 // If the user doesn't want us to guess, stop right here.
93 if (not m_config->guessDownloadPaths()) 93 if (not config::guessDownloadPaths())
94 return; 94 return;
95 95
96 // Ensure .dat extension 96 // Ensure .dat extension
97 if (destination.right (4) != ".dat") 97 if (destination.right (4) != ".dat")
98 { 98 {
253 _requests.clear(); 253 _requests.clear();
254 254
255 if (primaryFile()) 255 if (primaryFile())
256 emit primaryFileDownloaded(); 256 emit primaryFileDownloaded();
257 257
258 if (m_config->autoCloseDownloadDialog() and not failed) 258 if (config::autoCloseDownloadDialog() and not failed)
259 { 259 {
260 // Close automatically if desired. 260 // Close automatically if desired.
261 accept(); 261 accept();
262 } 262 }
263 else 263 else
306 _primaryFile = document; 306 _primaryFile = document;
307 } 307 }
308 308
309 QString PartDownloader::downloadPath() 309 QString PartDownloader::downloadPath()
310 { 310 {
311 QString path = m_config->downloadFilePath(); 311 QString path = config::downloadFilePath();
312 312
313 if (DIRSLASH[0] != '/') 313 if (DIRSLASH[0] != '/')
314 path.replace(DIRSLASH, "/"); 314 path.replace(DIRSLASH, "/");
315 315
316 return path; 316 return path;

mercurial