Browse Source

Fix URL Seed support

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
a8d635f7ac
  1. 18
      src/qtlibtorrent/qtorrenthandle.cpp

18
src/qtlibtorrent/qtorrenthandle.cpp

@ -241,13 +241,15 @@ QStringList QTorrentHandle::url_seeds() const {
Q_ASSERT(h.is_valid()); Q_ASSERT(h.is_valid());
QStringList res; QStringList res;
try { try {
std::vector<std::string> existing_seeds = h.get_torrent_info().url_seeds(); const std::set<std::string> existing_seeds = h.url_seeds();
unsigned int nbSeeds = existing_seeds.size(); std::set<std::string>::const_iterator it;
QString existing_seed; for(it = existing_seeds.begin(); it != existing_seeds.end(); it++) {
for(unsigned int i=0; i<nbSeeds; ++i) { qDebug("URL Seed: %s", it->c_str());
res << misc::toQString(existing_seeds[i]); res << misc::toQString(*it);
}
} catch(std::exception e) {
std::cout << "ERROR: Failed to convert the URL seed" << std::endl;
} }
} catch(std::exception e) {}
return res; return res;
} }
@ -546,7 +548,9 @@ void QTorrentHandle::remove_url_seed(QString seed) {
void QTorrentHandle::add_url_seed(QString seed) { void QTorrentHandle::add_url_seed(QString seed) {
Q_ASSERT(h.is_valid()); 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) { void QTorrentHandle::set_max_uploads(int val) {

Loading…
Cancel
Save