1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Fix save path encoding problem on Windows

This commit is contained in:
Christophe Dumez 2010-09-25 16:01:07 +00:00
parent a150e24ce4
commit d557410156
2 changed files with 5 additions and 5 deletions

View File

@ -867,13 +867,13 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
qDebug("addMagnetURI: Temp folder is enabled.");
qDebug("addTorrent::Temp folder is enabled.");
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
if(!QDir(torrent_tmp_path).exists())
QDir().mkpath(torrent_tmp_path);
qDebug("addMagnetURI: using save_path: %s", qPrintable(torrent_tmp_path));
} else {
p.save_path = savePath.toLocal8Bit().constData();
p.save_path = savePath.toUtf8().constData();
// Check if save path exists, creating it otherwise
if(!QDir(savePath).exists())
QDir().mkpath(savePath);
@ -1121,13 +1121,13 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
if(!torrent_tmp_path.endsWith("/")) torrent_tmp_path += "/";
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
if(!QDir(torrent_tmp_path).exists())
QDir().mkpath(torrent_tmp_path);
qDebug("addTorrent: using save_path: %s", qPrintable(torrent_tmp_path));
} else {
p.save_path = savePath.toLocal8Bit().constData();
p.save_path = savePath.toUtf8().constData();
// Check if save path exists, creating it otherwise
if(!QDir(savePath).exists())
QDir().mkpath(savePath);

View File

@ -227,7 +227,7 @@ int QTorrentHandle::num_incomplete() const {
QString QTorrentHandle::save_path() const {
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