Browse Source

- A queueing system ASSERT hit fix

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
48ec57604f
  1. 6
      src/bittorrent.cpp

6
src/bittorrent.cpp

@ -204,6 +204,7 @@ void bittorrent::setMaxActiveTorrents(int val) { @@ -204,6 +204,7 @@ void bittorrent::setMaxActiveTorrents(int val) {
}
void bittorrent::increaseDlTorrentPriority(QString hash) {
Q_ASSERT(queueingEnabled);
int index = downloadQueue->indexOf(hash);
Q_ASSERT(index != -1);
if(index > 0) {
@ -215,6 +216,7 @@ void bittorrent::increaseDlTorrentPriority(QString hash) { @@ -215,6 +216,7 @@ void bittorrent::increaseDlTorrentPriority(QString hash) {
}
void bittorrent::increaseUpTorrentPriority(QString hash) {
Q_ASSERT(queueingEnabled);
int index = uploadQueue->indexOf(hash);
Q_ASSERT(index != -1);
if(index > 0) {
@ -226,6 +228,7 @@ void bittorrent::increaseUpTorrentPriority(QString hash) { @@ -226,6 +228,7 @@ void bittorrent::increaseUpTorrentPriority(QString hash) {
}
void bittorrent::decreaseDlTorrentPriority(QString hash) {
Q_ASSERT(queueingEnabled);
int index = downloadQueue->indexOf(hash);
Q_ASSERT(index != -1);
if(index >= 0 && index < (downloadQueue->size()-1)) {
@ -237,6 +240,7 @@ void bittorrent::decreaseDlTorrentPriority(QString hash) { @@ -237,6 +240,7 @@ void bittorrent::decreaseDlTorrentPriority(QString hash) {
}
void bittorrent::decreaseUpTorrentPriority(QString hash) {
Q_ASSERT(queueingEnabled);
int index = uploadQueue->indexOf(hash);
Q_ASSERT(index != -1);
if(index >= 0 && index < (uploadQueue->size()-1)) {
@ -817,8 +821,10 @@ bool bittorrent::resumeTorrent(QString hash) { @@ -817,8 +821,10 @@ bool bittorrent::resumeTorrent(QString hash) {
torrentsToPauseAfterChecking.removeAt(index);
success = true;
}
if(queueingEnabled) {
updateDownloadQueue();
updateUploadQueue();
}
return success;
}

Loading…
Cancel
Save