mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Prefill torrent name when creating a new torrent. Closes #7229.
This commit is contained in:
parent
6270433237
commit
78dafc9cbe
@ -144,7 +144,7 @@ void TorrentCreatorDlg::onCreateButtonClicked()
|
|||||||
QString input = Utils::Fs::fromNativePath(m_ui->textInputPath->text()).trimmed();
|
QString input = Utils::Fs::fromNativePath(m_ui->textInputPath->text()).trimmed();
|
||||||
|
|
||||||
// test if readable
|
// test if readable
|
||||||
QFileInfo fi(input);
|
const QFileInfo fi(input);
|
||||||
if (!fi.isReadable()) {
|
if (!fi.isReadable()) {
|
||||||
QMessageBox::critical(this, tr("Torrent creator failed"), tr("Reason: Path to file/folder is not readable."));
|
QMessageBox::critical(this, tr("Torrent creator failed"), tr("Reason: Path to file/folder is not readable."));
|
||||||
return;
|
return;
|
||||||
@ -152,8 +152,8 @@ void TorrentCreatorDlg::onCreateButtonClicked()
|
|||||||
input = fi.canonicalFilePath();
|
input = fi.canonicalFilePath();
|
||||||
|
|
||||||
// get save path
|
// get save path
|
||||||
QString lastPath = m_storeLastSavePath;
|
const QString savePath = QString(m_storeLastSavePath) + QLatin1Char('/') + fi.fileName() + QLatin1String(".torrent");
|
||||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select where to save the new torrent"), lastPath, tr("Torrent Files (*.torrent)"));
|
QString destination = QFileDialog::getSaveFileName(this, tr("Select where to save the new torrent"), savePath, tr("Torrent Files (*.torrent)"));
|
||||||
if (destination.isEmpty())
|
if (destination.isEmpty())
|
||||||
return;
|
return;
|
||||||
if (!destination.endsWith(C_TORRENT_FILE_EXTENSION, Qt::CaseInsensitive))
|
if (!destination.endsWith(C_TORRENT_FILE_EXTENSION, Qt::CaseInsensitive))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user