1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-27 15:04:36 +00:00

Another fix for torrent addition from Web browser

This commit is contained in:
Christophe Dumez 2011-03-19 13:58:34 +00:00
parent 84705489fc
commit 536bd85fd0
2 changed files with 2 additions and 2 deletions

View File

@ -893,7 +893,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
if(QFile::rename(path, path+".torrent")) path += ".torrent"; if(QFile::rename(path, path+".torrent")) path += ".torrent";
#endif #endif
if(path.startsWith("file:", Qt::CaseInsensitive)) if(path.startsWith("file:", Qt::CaseInsensitive))
path = QUrl(path).toLocalFile(); path = QUrl::fromEncoded(path.toLocal8Bit()).toLocalFile();
if(path.isEmpty()) return h; if(path.isEmpty()) return h;
Q_ASSERT(!misc::isUrl(path)); Q_ASSERT(!misc::isUrl(path));

View File

@ -229,7 +229,7 @@ void torrentAdditionDialog::showLoad(QString filePath, QString from_url) {
// This is an URL to a local file, switch to local path // This is an URL to a local file, switch to local path
if(filePath.startsWith("file:", Qt::CaseInsensitive)) if(filePath.startsWith("file:", Qt::CaseInsensitive))
filePath = QUrl(filePath).toLocalFile(); filePath = QUrl::fromEncoded(filePath.toLocal8Bit()).toLocalFile();
if(!QFile::exists(filePath)) { if(!QFile::exists(filePath)) {
close(); close();