1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-02 09:55:55 +00:00

Minor Windows bug fixes

This commit is contained in:
Christophe Dumez 2010-07-25 15:30:26 +00:00
parent ff08abe177
commit afaca423cc
3 changed files with 12 additions and 0 deletions

View File

@ -967,7 +967,11 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
}
}
// Processing torrents
#ifdef Q_WS_WIN
const QString file = path.trimmed().replace("file:///", "", Qt::CaseInsensitive);
#else
const QString file = path.trimmed().replace("file://", "", Qt::CaseInsensitive);
#endif
if(file.isEmpty()) {
return h;
}

View File

@ -81,7 +81,11 @@ void engineSelectDlg::dropEvent(QDropEvent *event) {
QString file;
foreach(file, files) {
qDebug("dropped %s", qPrintable(file));
#ifdef Q_WS_WIN
file = file.replace("file:///", "");
#else
file = file.replace("file://", "");
#endif
if(file.startsWith("http://", Qt::CaseInsensitive) || file.startsWith("https://", Qt::CaseInsensitive) || file.startsWith("ftp://", Qt::CaseInsensitive)) {
setCursor(QCursor(Qt::WaitCursor));
downloader->downloadUrl(file);

View File

@ -314,7 +314,11 @@ void TransferListWidget::updateMetadata(QTorrentHandle &h) {
}
void TransferListWidget::previewFile(QString filePath) {
#ifdef Q_WS_WIN
QDesktopServices::openUrl(QUrl(QString("file:///")+filePath));
#else
QDesktopServices::openUrl(QUrl(QString("file://")+filePath));
#endif
}
int TransferListWidget::updateTorrent(int row) {