summaryrefslogtreecommitdiffstats
path: root/libktorrent/torrent
diff options
context:
space:
mode:
Diffstat (limited to 'libktorrent/torrent')
-rw-r--r--libktorrent/torrent/queuemanager.cpp7
-rw-r--r--libktorrent/torrent/queuemanager.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/libktorrent/torrent/queuemanager.cpp b/libktorrent/torrent/queuemanager.cpp
index 0c76b8a..bf64a2e 100644
--- a/libktorrent/torrent/queuemanager.cpp
+++ b/libktorrent/torrent/queuemanager.cpp
@@ -49,6 +49,7 @@ namespace bt
keep_seeding = true; //test. Will be passed from Core
paused_state = false;
+ ordering = false;
}
@@ -439,11 +440,13 @@ namespace bt
void QueueManager::orderQueue()
{
- if (!downloads.count())
+ if (!downloads.count() || ordering)
return;
if (paused_state || exiting)
return;
+
+ ordering = true;
downloads.sort();
@@ -584,7 +587,7 @@ namespace bt
}
}
}
-
+ ordering = false;
}
void QueueManager::torrentFinished(kt::TorrentInterface* tc)
diff --git a/libktorrent/torrent/queuemanager.h b/libktorrent/torrent/queuemanager.h
index e49ad44..a51e9ec 100644
--- a/libktorrent/torrent/queuemanager.h
+++ b/libktorrent/torrent/queuemanager.h
@@ -169,6 +169,7 @@ namespace bt
bool paused_state;
bool keep_seeding;
bool exiting;
+ bool ordering;
};
}
#endif