Browse Source

Correctly update tracker tier number in the trackers tab. Closes #1075.

adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
3d9f3eb1b3
  1. 9
      src/properties/trackerlist.cpp

9
src/properties/trackerlist.cpp

@ -141,6 +141,7 @@ void TrackerList::moveSelectionUp() { @@ -141,6 +141,7 @@ void TrackerList::moveSelectionUp() {
h.replace_trackers(trackers);
// Reannounce
h.force_reannounce();
loadTrackers();
}
void TrackerList::moveSelectionDown() {
@ -177,6 +178,7 @@ void TrackerList::moveSelectionDown() { @@ -177,6 +178,7 @@ void TrackerList::moveSelectionDown() {
h.replace_trackers(trackers);
// Reannounce
h.force_reannounce();
loadTrackers();
}
void TrackerList::clear() {
@ -252,13 +254,13 @@ void TrackerList::loadTrackers() { @@ -252,13 +254,13 @@ void TrackerList::loadTrackers() {
QTreeWidgetItem *item = tracker_items.value(tracker_url, 0);
if (!item) {
item = new QTreeWidgetItem();
item->setText(COL_TIER, QString::number(it->tier));
item->setText(COL_URL, tracker_url);
addTopLevelItem(item);
tracker_items[tracker_url] = item;
} else {
old_trackers_urls.removeOne(tracker_url);
}
item->setText(COL_TIER, QString::number(it->tier));
TrackerInfos data = trackers_data.value(tracker_url, TrackerInfos(tracker_url));
QString error_message = data.last_message.trimmed();
if (it->verified) {
@ -292,10 +294,11 @@ void TrackerList::askForTrackers() { @@ -292,10 +294,11 @@ void TrackerList::askForTrackers() {
if (!h.is_valid()) return;
QStringList trackers = TrackersAdditionDlg::askForTrackers(h);
if (!trackers.empty()) {
foreach (const QString& tracker, trackers) {
for (int i=0; i<trackers.count(); i++) {
const QString& tracker = trackers[i];
if (tracker.trimmed().isEmpty()) continue;
announce_entry url(tracker.toStdString());
url.tier = 0;
url.tier = (topLevelItemCount() - NB_STICKY_ITEM) + i;
h.add_tracker(url);
}
// Reannounce to new trackers

Loading…
Cancel
Save