Browse Source

Minor Windows bug fixes

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
afaca423cc
  1. 4
      src/bittorrent.cpp
  2. 4
      src/engineselectdlg.cpp
  3. 4
      src/transferlistwidget.cpp

4
src/bittorrent.cpp

@ -967,7 +967,11 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr @@ -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;
}

4
src/engineselectdlg.cpp

@ -81,7 +81,11 @@ void engineSelectDlg::dropEvent(QDropEvent *event) { @@ -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);

4
src/transferlistwidget.cpp

@ -314,7 +314,11 @@ void TransferListWidget::updateMetadata(QTorrentHandle &h) { @@ -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) {

Loading…
Cancel
Save