mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-21 12:29:04 -06:00
Fix libtorrent CMakeLists to always enable DHT mode
Close torrents when SyncWidget is closed
This commit is contained in:
@@ -121,7 +121,7 @@ set(ed25519_sources
|
||||
set(includes include ed25519/src)
|
||||
|
||||
option(LIBTORRENT_pool-allocators "Uses a pool allocator for disk and piece buffers" ON)
|
||||
option(LIBTORRENT_dht "enable support for Mainline DHT" OFF)
|
||||
option(LIBTORRENT_dht "enable support for Mainline DHT" ON)
|
||||
option(LIBTORRENT_unicode "enable unicode support" ON)
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo)
|
||||
|
||||
@@ -138,11 +138,22 @@ SyncWidget::SyncWidget(QWidget* parent, Qt::WindowFlags f)
|
||||
}
|
||||
|
||||
SyncWidget::~SyncWidget() {
|
||||
libtorrent::entry dht = _session->dht_state();
|
||||
std::string s = dht.to_string();
|
||||
|
||||
openspace::DownloadManager::deinitialize();
|
||||
ghoul::deinitialize();
|
||||
delete _session;
|
||||
}
|
||||
|
||||
void SyncWidget::closeEvent(QCloseEvent* event) {
|
||||
std::vector<libtorrent::torrent_handle> handles = _session->get_torrents();
|
||||
for (libtorrent::torrent_handle h : handles) {
|
||||
h.flush_cache();
|
||||
_session->remove_torrent(h);
|
||||
}
|
||||
}
|
||||
|
||||
void SyncWidget::setSceneFiles(QMap<QString, QString> sceneFiles) {
|
||||
_sceneFiles = std::move(sceneFiles);
|
||||
QStringList keys = _sceneFiles.keys();
|
||||
@@ -601,3 +612,4 @@ void SyncWidget::handleFileFutureAddition(
|
||||
_futuresToAdd.insert(_futuresToAdd.end(), futures.begin(), futures.end());
|
||||
_mutex.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,8 @@ private slots:
|
||||
void syncButtonPressed();
|
||||
void handleTimer();
|
||||
|
||||
void closeEvent(QCloseEvent* event);
|
||||
|
||||
private:
|
||||
struct DirectFile {
|
||||
QString module;
|
||||
|
||||
2
data
2
data
Submodule data updated: e234fc3176...8665ad57ba
Reference in New Issue
Block a user