mirror of
https://github.com/RetroShare/RetroShare.git
synced 2026-09-14 11:06:01 +05:00
Merge fa096b9cc4 into 01bc50edb3
This commit is contained in:
commit
fbc2194a86
@ -1365,11 +1365,11 @@ void RetroshareDirModel::downloadDirectory(const DirDetails & dirDetails, int pr
|
||||
}
|
||||
else if (dirDetails.type & DIR_TYPE_DIR)
|
||||
{
|
||||
// No need to pre-create the destination folder here: each file's
|
||||
// FileRequest() stages into the Partials directory, and
|
||||
// RsDirUtil::moveFile() creates any missing destination directories
|
||||
// lazily once that file actually completes.
|
||||
std::list<DirStub>::const_iterator it;
|
||||
QDir dwlDir(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str()));
|
||||
QString cleanPath = QDir::cleanPath(QString::fromUtf8(dirDetails.path.substr(prefixLen).c_str()));
|
||||
|
||||
if (!dwlDir.mkpath(cleanPath)) return;
|
||||
|
||||
for(uint32_t i=0;i<dirDetails.children.size();++i)
|
||||
{
|
||||
|
||||
@ -74,10 +74,10 @@ void RsCollection::autoDownloadFiles(ColFileInfo colFileInfo, QString dlDir) con
|
||||
if (!colFileInfo.filename_has_wrong_characters)
|
||||
{
|
||||
QString cleanPath = dlDir + colFileInfo.path ;
|
||||
std::cout << "making directory " << cleanPath.toStdString() << std::endl;
|
||||
|
||||
if(!QDir(QApplication::applicationDirPath()).mkpath(cleanPath))
|
||||
std::cerr << "Unable to make path: " + cleanPath.toStdString() << std::endl;
|
||||
// No need to pre-create cleanPath here: FileRequest() stages into
|
||||
// the Partials directory, and RsDirUtil::moveFile() creates any
|
||||
// missing destination directories lazily once the file completes.
|
||||
|
||||
if (colFileInfo.type==DIR_TYPE_FILE)
|
||||
rsFiles->FileRequest(colFileInfo.name.toUtf8().constData(),
|
||||
|
||||
@ -739,10 +739,9 @@ void RsCollectionDialog::download()
|
||||
const auto& sdd = mCollection->fileTree().directoryData(e.index);
|
||||
std::string subpath = RsDirUtil::makePath(path,sdd.name);
|
||||
|
||||
std::cerr << "Creating subdir " << sdd.name << " to directory " << path << std::endl;
|
||||
|
||||
if(!QDir(QApplication::applicationDirPath()).mkpath(QString::fromUtf8(subpath.c_str())))
|
||||
QMessageBox::warning(NULL,tr("Unable to make path"),tr("Unable to make path:")+"<br> "+QString::fromUtf8(subpath.c_str())) ;
|
||||
// No need to pre-create subpath here: FileRequest() stages into
|
||||
// the Partials directory, and RsDirUtil::moveFile() creates any
|
||||
// missing destination directories lazily once a file completes.
|
||||
|
||||
recursDL(dirdata.subdirs[i],subpath);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user