From a8d635f7ac338c0de644fdfcace898b7d0c88866 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 10 Oct 2010 15:39:08 +0000 Subject: [PATCH] Fix URL Seed support --- src/qtlibtorrent/qtorrenthandle.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/qtlibtorrent/qtorrenthandle.cpp b/src/qtlibtorrent/qtorrenthandle.cpp index 1c149d5ed..02fb4312b 100644 --- a/src/qtlibtorrent/qtorrenthandle.cpp +++ b/src/qtlibtorrent/qtorrenthandle.cpp @@ -241,13 +241,15 @@ QStringList QTorrentHandle::url_seeds() const { Q_ASSERT(h.is_valid()); QStringList res; try { - std::vector existing_seeds = h.get_torrent_info().url_seeds(); - unsigned int nbSeeds = existing_seeds.size(); - QString existing_seed; - for(unsigned int i=0; i existing_seeds = h.url_seeds(); + std::set::const_iterator it; + for(it = existing_seeds.begin(); it != existing_seeds.end(); it++) { + qDebug("URL Seed: %s", it->c_str()); + res << misc::toQString(*it); } - } catch(std::exception e) {} + } catch(std::exception e) { + std::cout << "ERROR: Failed to convert the URL seed" << std::endl; + } return res; } @@ -546,7 +548,9 @@ void QTorrentHandle::remove_url_seed(QString seed) { void QTorrentHandle::add_url_seed(QString seed) { Q_ASSERT(h.is_valid()); - h.add_url_seed(seed.toStdString()); + const std::string str_seed = seed.toStdString(); + qDebug("calling h.add_url_seed(%s)", str_seed.c_str()); + h.add_url_seed(str_seed); } void QTorrentHandle::set_max_uploads(int val) {