mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 14:12:30 -06:00
Fix compilation on Windows (Remove using namespace libtorrent; from headers)
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
#include <libtorrent/bitfield.hpp>
|
||||
#include <math.h>
|
||||
|
||||
using namespace libtorrent;
|
||||
#define BAR_HEIGHT 18
|
||||
|
||||
class DownloadedPiecesBar: public QWidget {
|
||||
@@ -54,7 +53,7 @@ public:
|
||||
setFixedHeight(BAR_HEIGHT);
|
||||
}
|
||||
|
||||
void setProgress(const bitfield &pieces, const bitfield &downloading_pieces) {
|
||||
void setProgress(const libtorrent::bitfield &pieces, const libtorrent::bitfield &downloading_pieces) {
|
||||
if(pieces.empty()) {
|
||||
// Empty bar
|
||||
QPixmap pix = QPixmap(1, 1);
|
||||
@@ -67,8 +66,8 @@ public:
|
||||
const uint w = width();
|
||||
if(nb_pieces > w) {
|
||||
const uint ratio = floor(nb_pieces/(double)w);
|
||||
bitfield scaled_pieces(ceil(nb_pieces/(double)ratio), false);
|
||||
bitfield scaled_downloading(ceil(nb_pieces/(double)ratio), false);
|
||||
libtorrent::bitfield scaled_pieces(ceil(nb_pieces/(double)ratio), false);
|
||||
libtorrent::bitfield scaled_downloading(ceil(nb_pieces/(double)ratio), false);
|
||||
uint scaled_index = 0;
|
||||
for(qulonglong i=0; i<nb_pieces; i+= ratio) {
|
||||
bool have = true;
|
||||
|
||||
@@ -45,8 +45,6 @@
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#endif
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
class PeerAdditionDlg: public QDialog, private Ui::addPeerDialog {
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
#include <vector>
|
||||
#include "qinisettings.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
PeerListWidget::PeerListWidget(PropertiesWidget *parent): QTreeView(parent), properties(parent), display_flags(false) {
|
||||
// Visual settings
|
||||
setRootIsDecorated(false);
|
||||
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
|
||||
public slots:
|
||||
void loadPeers(const QTorrentHandle &h, bool force_hostname_resolution=false);
|
||||
QStandardItem* addPeer(QString ip, peer_info peer);
|
||||
void updatePeer(QString ip, peer_info peer);
|
||||
QStandardItem* addPeer(QString ip, libtorrent::peer_info peer);
|
||||
void updatePeer(QString ip, libtorrent::peer_info peer);
|
||||
void handleResolved(QString ip, QString hostname);
|
||||
void updatePeerHostNameResolutionState();
|
||||
void updatePeerCountryResolutionState();
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
#include "qinisettings.h"
|
||||
#include "proptabbar.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, TransferListWidget *transferList):
|
||||
QWidget(parent), transferList(transferList), main_window(main_window) {
|
||||
|
||||
@@ -248,7 +250,7 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
|
||||
// Expand first item if possible
|
||||
filesList->expand(PropListModel->index(0, 0));
|
||||
}
|
||||
} catch(invalid_handle e) {
|
||||
} catch(invalid_handle& e) {
|
||||
|
||||
}
|
||||
// Load dynamic data
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
if(index.column() != PRIORITY) return 0;
|
||||
if(properties) {
|
||||
QTorrentHandle h = properties->getCurrentTorrent();
|
||||
if(!h.is_valid() || static_cast<torrent_handle>(h).is_seed() || !h.has_metadata()) return 0;
|
||||
if(!h.is_valid() || static_cast<libtorrent::torrent_handle>(h).is_seed() || !h.has_metadata()) return 0;
|
||||
}
|
||||
if(index.data().toInt() <= 0) {
|
||||
// IGNORED or MIXED
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "qbtsession.h"
|
||||
#include "qinisettings.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), properties(properties) {
|
||||
// Graphical settings
|
||||
setRootIsDecorated(false);
|
||||
|
||||
@@ -79,8 +79,8 @@ public slots:
|
||||
}
|
||||
QList<QUrl> existingTrackers;
|
||||
// Load from torrent handle
|
||||
std::vector<announce_entry> tor_trackers = h.trackers();
|
||||
std::vector<announce_entry>::iterator itr = tor_trackers.begin();
|
||||
std::vector<libtorrent::announce_entry> tor_trackers = h.trackers();
|
||||
std::vector<libtorrent::announce_entry>::iterator itr = tor_trackers.begin();
|
||||
while(itr != tor_trackers.end()) {
|
||||
existingTrackers << QUrl(misc::toQString(itr->url));
|
||||
itr++;
|
||||
|
||||
Reference in New Issue
Block a user