Browse Source

Start up torrents after UI was created. Fixes #6454.

Commit dd0537d changed torrents startup code adding alerts processing
into it. Therefore alerts were processed before UI code subscribed to
signals and therefore part of alerts was not reflected in the UI.

Thus here we do not start torrents in Session constructor, but do that
from Application::exec() after UI was constructed and is ready to process
signals.
adaptive-webui-19844
Eugene Shalygin 8 years ago
parent
commit
21a72c651f
  1. 3
      src/app/application.cpp
  2. 1
      src/base/bittorrent/session.cpp
  3. 2
      src/base/bittorrent/session.h

3
src/app/application.cpp

@ -462,6 +462,9 @@ int Application::exec(const QStringList &params) @@ -462,6 +462,9 @@ int Application::exec(const QStringList &params)
m_paramsQueue.clear();
}
// Now UI is ready to process signals from Session
BitTorrent::Session::instance()->startUpTorrents();
return BaseApplication::exec();
}

1
src/base/bittorrent/session.cpp

@ -440,7 +440,6 @@ Session::Session(QObject *parent) @@ -440,7 +440,6 @@ Session::Session(QObject *parent)
Net::PortForwarder::initInstance(m_nativeSession);
qDebug("* BitTorrent Session constructed");
startUpTorrents();
}
bool Session::isDHTEnabled() const

2
src/base/bittorrent/session.h

@ -330,6 +330,7 @@ namespace BitTorrent @@ -330,6 +330,7 @@ namespace BitTorrent
QStringList bannedIPs() const;
void setBannedIPs(const QStringList &list);
void startUpTorrents();
TorrentHandle *findTorrent(const InfoHash &hash) const;
QHash<InfoHash, TorrentHandle *> torrents() const;
TorrentStatusReport torrentStatusReport() const;
@ -460,7 +461,6 @@ namespace BitTorrent @@ -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());

Loading…
Cancel
Save