| Summary: | Torrent at 100% but individually selected files not finished | ||
|---|---|---|---|
| Product: | [Applications] ktorrent | Reporter: | Eric P <eric.maillist> |
| Component: | general | Assignee: | Joris Guisson <joris.guisson> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Eric P
2006-11-24 22:48:53 UTC
SVN commit 607622 by guisson:
Fixed bug which resulted in the setting of the wrong chunk priority when not all files of a torrent were selected. This resulted in the torrent being at 100 %, while not all files where at 100 %.
BUG: 137840
M +15 -18 chunkmanager.cpp
M +3 -4 torrentfile.cpp
M +2 -5 torrentfile.h
--- trunk/extragear/network/ktorrent/libktorrent/torrent/chunkmanager.cpp #607621:607622
@@ -76,14 +76,9 @@
for (Uint32 i = 0;i < tor.getNumFiles();i++)
{
TorrentFile & tf = tor.getFile(i);
- connect(&tf,SIGNAL(downloadStatusChanged(TorrentFile*, bool )),
- this,SLOT(downloadStatusChanged(TorrentFile*, bool )));
connect(&tf,SIGNAL(downloadPriorityChanged(TorrentFile*, Priority )),
this,SLOT(downloadPriorityChanged(TorrentFile*, Priority )));
- if (tf.doNotDownload())
- {
- downloadStatusChanged(&tf,false);
- }
+
if (tf.getPriority() != NORMAL_PRIORITY)
{
downloadPriorityChanged(&tf,tf.getPriority());
@@ -823,17 +818,18 @@
if (*i == tf->getIndex())
continue;
- if (tf->getPriority() > maxp)
- maxp = tf->getPriority();
-
- if (!tor.getFile(*i).doNotDownload() && !modified)
+ const TorrentFile & other = tor.getFile(*i);
+ if (!other.doNotDownload())
{
- if (first != last)
+ if (first != last && !modified)
{
first++;
reprioritise_border_chunk = true;
modified = true;
}
+
+ if (other.getPriority() > maxp)
+ maxp = other.getPriority();
}
}
@@ -851,17 +847,18 @@
if (*i == tf->getIndex())
continue;
- if (tf->getPriority() > maxp)
- maxp = tf->getPriority();
-
- if (!tor.getFile(*i).doNotDownload() && !modified)
+ const TorrentFile & other = tor.getFile(*i);
+ if (!other.doNotDownload())
{
- if (last != first && last > 0)
+ if (first != last && last > 0 && !modified)
{
- modified = true;
- reprioritise_border_chunk = true;
last--;
+ reprioritise_border_chunk = true;
+ modified = true;
}
+
+ if (other.getPriority() > maxp)
+ maxp = other.getPriority();
}
}
--- trunk/extragear/network/ktorrent/libktorrent/torrent/torrentfile.cpp #607621:607622
@@ -70,20 +70,19 @@
{
priority = EXCLUDED;
if(m_emitDlStatusChanged)
- emit downloadStatusChanged(this,!dnd);
+ emit downloadPriorityChanged(this,priority);
}
if (priority == EXCLUDED && (!dnd))
{
priority = NORMAL_PRIORITY;
if(m_emitDlStatusChanged)
- emit downloadStatusChanged(this,!dnd);
+ emit downloadPriorityChanged(this,priority);
}
}
void TorrentFile::emitDownloadStatusChanged()
{
- if(priority == EXCLUDED)
- emit downloadStatusChanged(this, false);
+ emit downloadPriorityChanged(this,priority);
}
--- trunk/extragear/network/ktorrent/libktorrent/torrent/torrentfile.h #607621:607622
@@ -140,13 +140,10 @@
signals:
/**
- * Signal emitted when the Priority variable changes from or to EXCLUDED.
+ * Signal emitted when the Priority variable changes.
* @param tf The TorrentFile which emitted the signal
- * @param download Download the file or not
+ * @param newpriority THe new priority of the file
*/
- void downloadStatusChanged(TorrentFile* tf,bool download);
-
- /// signal emitted when the Priority variable changes
void downloadPriorityChanged(TorrentFile* tf,Priority newpriority);
};
|