This commit is contained in:
Kai 2026-09-11 13:17:19 +12:00 committed by GitHub
commit fbc2194a86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 11 deletions

View File

@ -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)
{

View File

@ -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(),

View File

@ -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);
}