mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-27 08:19:30 +08:00
Remove redundant disconnect()
The dialog is going out-of-scope in these instance and the signal-slot connection will disconnect automatically.
This commit is contained in:
parent
014273d7ec
commit
03fdc0e1c4
@ -600,9 +600,6 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint &)
|
|||||||
|
|
||||||
void AddNewTorrentDialog::accept()
|
void AddNewTorrentDialog::accept()
|
||||||
{
|
{
|
||||||
if (!m_hasMetadata)
|
|
||||||
disconnect(this, SLOT(updateMetadata(const BitTorrent::TorrentInfo&)));
|
|
||||||
|
|
||||||
// TODO: Check if destination actually exists
|
// TODO: Check if destination actually exists
|
||||||
m_torrentParams.skipChecking = m_ui->skipCheckingCheckBox->isChecked();
|
m_torrentParams.skipChecking = m_ui->skipCheckingCheckBox->isChecked();
|
||||||
|
|
||||||
@ -648,7 +645,6 @@ void AddNewTorrentDialog::accept()
|
|||||||
void AddNewTorrentDialog::reject()
|
void AddNewTorrentDialog::reject()
|
||||||
{
|
{
|
||||||
if (!m_hasMetadata) {
|
if (!m_hasMetadata) {
|
||||||
disconnect(this, SLOT(updateMetadata(BitTorrent::TorrentInfo)));
|
|
||||||
setMetadataProgressIndicator(false);
|
setMetadataProgressIndicator(false);
|
||||||
BitTorrent::Session::instance()->cancelLoadMetadata(m_hash);
|
BitTorrent::Session::instance()->cancelLoadMetadata(m_hash);
|
||||||
}
|
}
|
||||||
@ -660,7 +656,8 @@ void AddNewTorrentDialog::updateMetadata(const BitTorrent::TorrentInfo &info)
|
|||||||
{
|
{
|
||||||
if (info.hash() != m_hash) return;
|
if (info.hash() != m_hash) return;
|
||||||
|
|
||||||
disconnect(this, SLOT(updateMetadata(BitTorrent::TorrentInfo)));
|
disconnect(BitTorrent::Session::instance(), &BitTorrent::Session::metadataLoaded, this, &AddNewTorrentDialog::updateMetadata);
|
||||||
|
|
||||||
if (!info.isValid()) {
|
if (!info.isValid()) {
|
||||||
RaisedMessageBox::critical(this, tr("I/O Error"), ("Invalid metadata."));
|
RaisedMessageBox::critical(this, tr("I/O Error"), ("Invalid metadata."));
|
||||||
setMetadataProgressIndicator(false, tr("Invalid metadata"));
|
setMetadataProgressIndicator(false, tr("Invalid metadata"));
|
||||||
|
Loading…
Reference in New Issue
Block a user