mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 12:59:56 -07:00
Fix save path encoding problem on Windows
This commit is contained in:
parent
a150e24ce4
commit
d557410156
2 changed files with 5 additions and 5 deletions
|
@ -867,13 +867,13 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
|
||||||
qDebug("addMagnetURI: Temp folder is enabled.");
|
qDebug("addMagnetURI: Temp folder is enabled.");
|
||||||
qDebug("addTorrent::Temp folder is enabled.");
|
qDebug("addTorrent::Temp folder is enabled.");
|
||||||
QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
|
QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
|
||||||
p.save_path = torrent_tmp_path.toLocal8Bit().constData();
|
p.save_path = torrent_tmp_path.toUtf8().constData();
|
||||||
// Check if save path exists, creating it otherwise
|
// Check if save path exists, creating it otherwise
|
||||||
if(!QDir(torrent_tmp_path).exists())
|
if(!QDir(torrent_tmp_path).exists())
|
||||||
QDir().mkpath(torrent_tmp_path);
|
QDir().mkpath(torrent_tmp_path);
|
||||||
qDebug("addMagnetURI: using save_path: %s", qPrintable(torrent_tmp_path));
|
qDebug("addMagnetURI: using save_path: %s", qPrintable(torrent_tmp_path));
|
||||||
} else {
|
} else {
|
||||||
p.save_path = savePath.toLocal8Bit().constData();
|
p.save_path = savePath.toUtf8().constData();
|
||||||
// Check if save path exists, creating it otherwise
|
// Check if save path exists, creating it otherwise
|
||||||
if(!QDir(savePath).exists())
|
if(!QDir(savePath).exists())
|
||||||
QDir().mkpath(savePath);
|
QDir().mkpath(savePath);
|
||||||
|
@ -1121,13 +1121,13 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||||
if(!torrent_tmp_path.endsWith("/")) torrent_tmp_path += "/";
|
if(!torrent_tmp_path.endsWith("/")) torrent_tmp_path += "/";
|
||||||
torrent_tmp_path += root_folder;
|
torrent_tmp_path += root_folder;
|
||||||
}
|
}
|
||||||
p.save_path = torrent_tmp_path.toLocal8Bit().constData();
|
p.save_path = torrent_tmp_path.toUtf8().constData();
|
||||||
// Check if save path exists, creating it otherwise
|
// Check if save path exists, creating it otherwise
|
||||||
if(!QDir(torrent_tmp_path).exists())
|
if(!QDir(torrent_tmp_path).exists())
|
||||||
QDir().mkpath(torrent_tmp_path);
|
QDir().mkpath(torrent_tmp_path);
|
||||||
qDebug("addTorrent: using save_path: %s", qPrintable(torrent_tmp_path));
|
qDebug("addTorrent: using save_path: %s", qPrintable(torrent_tmp_path));
|
||||||
} else {
|
} else {
|
||||||
p.save_path = savePath.toLocal8Bit().constData();
|
p.save_path = savePath.toUtf8().constData();
|
||||||
// Check if save path exists, creating it otherwise
|
// Check if save path exists, creating it otherwise
|
||||||
if(!QDir(savePath).exists())
|
if(!QDir(savePath).exists())
|
||||||
QDir().mkpath(savePath);
|
QDir().mkpath(savePath);
|
||||||
|
|
|
@ -227,7 +227,7 @@ int QTorrentHandle::num_incomplete() const {
|
||||||
|
|
||||||
QString QTorrentHandle::save_path() const {
|
QString QTorrentHandle::save_path() const {
|
||||||
Q_ASSERT(h.is_valid());
|
Q_ASSERT(h.is_valid());
|
||||||
return misc::toQString(h.save_path().string()).replace("\\", "/");
|
return misc::toQStringU(h.save_path().string()).replace("\\", "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#if LIBTORRENT_VERSION_MINOR > 14
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue