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 c6a489933..caf7a735a 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -441,7 +441,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 0af2500ca..e1cb3d9e1 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -333,6 +333,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; @@ -463,7 +464,6 @@ namespace BitTorrent void enableIPFilter(); void disableIPFilter(); - void startUpTorrents(); bool addTorrent_impl(AddTorrentData addData, const MagnetUri &magnetUri, TorrentInfo torrentInfo = TorrentInfo(), const QByteArray &fastresumeData = QByteArray());