Browse Source

- Fixed pause/resume actions in Web UI

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
81aac9ebcc
  1. 12
      src/bittorrent.cpp
  2. 4
      src/bittorrent.h

12
src/bittorrent.cpp

@ -312,6 +312,18 @@ void bittorrent::resumeAllTorrents() { @@ -312,6 +312,18 @@ void bittorrent::resumeAllTorrents() {
}
}
void bittorrent::pauseTorrent(QString hash) {
QTorrentHandle h = getTorrentHandle(hash);
if(!h.is_paused())
h.pause();
}
void bittorrent::resumeTorrent(QString hash) {
QTorrentHandle h = getTorrentHandle(hash);
if(h.is_paused())
h.resume();
}
void bittorrent::loadWebSeeds(QString hash) {
QFile urlseeds_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".urlseeds");
if(!urlseeds_file.open(QIODevice::ReadOnly | QIODevice::Text)) return;

4
src/bittorrent.h

@ -106,8 +106,12 @@ class bittorrent : public QObject { @@ -106,8 +106,12 @@ class bittorrent : public QObject {
void downloadFromUrl(QString url);
void downloadFromURLList(const QStringList& url_list);
void deleteTorrent(QString hash, bool permanent = false);
/* Needed by Web UI */
void pauseAllTorrents();
void resumeAllTorrents();
void pauseTorrent(QString hash);
void resumeTorrent(QString hash);
/* End Web UI */
void saveDHTEntry();
void preAllocateAllFiles(bool b);
void saveFastResumeData();

Loading…
Cancel
Save