From 536bd85fd0415cd99a141a97dfcf7b80a91ccd9e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 19 Mar 2011 13:58:34 +0000 Subject: [PATCH] Another fix for torrent addition from Web browser --- src/qtlibtorrent/qbtsession.cpp | 2 +- src/torrentadditiondlg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index b39ef7256..ea4fc57e0 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -893,7 +893,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr if(QFile::rename(path, path+".torrent")) path += ".torrent"; #endif if(path.startsWith("file:", Qt::CaseInsensitive)) - path = QUrl(path).toLocalFile(); + path = QUrl::fromEncoded(path.toLocal8Bit()).toLocalFile(); if(path.isEmpty()) return h; Q_ASSERT(!misc::isUrl(path)); diff --git a/src/torrentadditiondlg.cpp b/src/torrentadditiondlg.cpp index 572a60e40..6761dfb76 100644 --- a/src/torrentadditiondlg.cpp +++ b/src/torrentadditiondlg.cpp @@ -229,7 +229,7 @@ void torrentAdditionDialog::showLoad(QString filePath, QString from_url) { // This is an URL to a local file, switch to local path if(filePath.startsWith("file:", Qt::CaseInsensitive)) - filePath = QUrl(filePath).toLocalFile(); + filePath = QUrl::fromEncoded(filePath.toLocal8Bit()).toLocalFile(); if(!QFile::exists(filePath)) { close();