Browse Source

Do not display !.qB extension in save path

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
5d1a584eac
  1. 2
      src/bittorrent.cpp
  2. 2
      src/propertieswidget.cpp
  3. 3
      src/qtorrenthandle.cpp

2
src/bittorrent.cpp

@ -963,7 +963,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr @@ -963,7 +963,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
if(! torrentBackup.exists()) {
if(! torrentBackup.mkpath(torrentBackup.path())) {
std::cerr << "Couldn't create the directory: '" << qPrintable(torrentBackup.path()) << "'\n";
exit(1);
return h;
}
}
// Processing torrents

2
src/propertieswidget.cpp

@ -817,7 +817,7 @@ void PropertiesWidget::renameSelectedFile() { @@ -817,7 +817,7 @@ void PropertiesWidget::renameSelectedFile() {
// Also rename it in the files list model
PropListModel->setData(PropListModel->index(0, 0), new_file_name);
}
display_path = new_path;
display_path = h.firstFileSavePath();
} else {
display_path = savePath.absolutePath();
}

3
src/qtorrenthandle.cpp

@ -460,6 +460,9 @@ QString QTorrentHandle::firstFileSavePath() const { @@ -460,6 +460,9 @@ QString QTorrentHandle::firstFileSavePath() const {
if(!fsave_path.endsWith("/"))
fsave_path += "/";
fsave_path += misc::toQStringU(h.get_torrent_info().file_at(0).path.string());
// Remove .!qB extension
if(fsave_path.endsWith(".!qB", Qt::CaseInsensitive))
fsave_path.chop(4);
return fsave_path;
}

Loading…
Cancel
Save