1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 13:04:23 +00:00

Fix URL Seed support

This commit is contained in:
Christophe Dumez 2010-10-10 15:39:08 +00:00
parent 289ad37f06
commit a8d635f7ac

View File

@ -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) {} } catch(std::exception e) {
std::cout << "ERROR: Failed to convert the URL seed" << std::endl;
}
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) {