diff --git a/src/app/application.cpp b/src/app/application.cpp index 061604f71..56a0906f9 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -462,6 +462,9 @@ int Application::exec(const QStringList ¶ms) m_paramsQueue.clear(); } + // Now UI is ready to process signals from Session + BitTorrent::Session::instance()->startUpTorrents(); + return BaseApplication::exec(); } diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 56474550e..d521141fd 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -440,7 +440,6 @@ Session::Session(QObject *parent) Net::PortForwarder::initInstance(m_nativeSession); qDebug("* BitTorrent Session constructed"); - startUpTorrents(); } bool Session::isDHTEnabled() const diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index adeae914a..bdfc0d899 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -330,6 +330,7 @@ namespace BitTorrent QStringList bannedIPs() const; void setBannedIPs(const QStringList &list); + void startUpTorrents(); TorrentHandle *findTorrent(const InfoHash &hash) const; QHash torrents() const; TorrentStatusReport torrentStatusReport() const; @@ -460,7 +461,6 @@ namespace BitTorrent void enableIPFilter(); void disableIPFilter(); - void startUpTorrents(); bool addTorrent_impl(AddTorrentData addData, const MagnetUri &magnetUri, TorrentInfo torrentInfo = TorrentInfo(), const QByteArray &fastresumeData = QByteArray());