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
} }
} }
// Processing torrents // 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); const QString file = path.trimmed().replace("file://", "", Qt::CaseInsensitive);
#endif
if(file.isEmpty()) { if(file.isEmpty()) {
return h; return h;
} }

4
src/engineselectdlg.cpp

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

4
src/transferlistwidget.cpp

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

Loading…
Cancel
Save