mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Handle paths with (~, ., ..) properly
This commit is contained in:
parent
c334439df6
commit
50e620daf2
5 changed files with 67 additions and 33 deletions
|
@ -1836,11 +1836,13 @@ QString Bittorrent::getSavePath(QString hash) {
|
|||
}
|
||||
qDebug("getSavePath, got save_path from persistent data: %s", savePath.toLocal8Bit().data());
|
||||
}
|
||||
// Clean path
|
||||
savePath = misc::expandPath(savePath);
|
||||
// Checking if savePath Dir exists
|
||||
// create it if it is not
|
||||
QDir saveDir(savePath);
|
||||
if(!saveDir.exists()) {
|
||||
if(!saveDir.mkpath(saveDir.path())) {
|
||||
if(!saveDir.mkpath(saveDir.absolutePath())) {
|
||||
std::cerr << "Couldn't create the save directory: " << saveDir.path().toLocal8Bit().data() << "\n";
|
||||
// XXX: Do something else?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue