summaryrefslogtreecommitdiffstats
path: root/examples/network/torrent
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/torrent')
-rw-r--r--examples/network/torrent/connectionmanager.cpp2
-rw-r--r--examples/network/torrent/filemanager.h2
-rw-r--r--examples/network/torrent/mainwindow.cpp6
-rw-r--r--examples/network/torrent/mainwindow.h4
-rw-r--r--examples/network/torrent/metainfo.cpp2
-rw-r--r--examples/network/torrent/peerwireclient.h14
-rw-r--r--examples/network/torrent/torrentclient.cpp4
-rw-r--r--examples/network/torrent/torrentclient.h2
-rw-r--r--examples/network/torrent/torrentserver.h2
-rw-r--r--examples/network/torrent/trackerclient.h2
10 files changed, 20 insertions, 20 deletions
diff --git a/examples/network/torrent/connectionmanager.cpp b/examples/network/torrent/connectionmanager.cpp
index d7b0418619..87b7a16e28 100644
--- a/examples/network/torrent/connectionmanager.cpp
+++ b/examples/network/torrent/connectionmanager.cpp
@@ -86,7 +86,7 @@ QByteArray ConnectionManager::clientId() const
{
if (id.isEmpty()) {
// Generate peer id
- int startupTime = int(QDateTime::currentDateTime().toTime_t());
+ qint64 startupTime = QDateTime::currentSecsSinceEpoch();
id += QString::asprintf("-QT%04x-", QT_VERSION >> 8).toLatin1();
id += QByteArray::number(startupTime, 10);
diff --git a/examples/network/torrent/filemanager.h b/examples/network/torrent/filemanager.h
index 73061ad059..82f9983ea6 100644
--- a/examples/network/torrent/filemanager.h
+++ b/examples/network/torrent/filemanager.h
@@ -100,7 +100,7 @@ signals:
void pieceVerified(int pieceIndex, bool verified);
protected:
- void run() Q_DECL_OVERRIDE;
+ void run() override;
private slots:
bool verifySinglePiece(int pieceIndex);
diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp
index 2b3d3e8b3a..efdf187174 100644
--- a/examples/network/torrent/mainwindow.cpp
+++ b/examples/network/torrent/mainwindow.cpp
@@ -67,8 +67,8 @@ signals:
void fileDropped(const QString &fileName);
protected:
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
#endif
};
@@ -80,7 +80,7 @@ public:
inline TorrentViewDelegate(MainWindow *mainWindow) : QItemDelegate(mainWindow) {}
void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index ) const Q_DECL_OVERRIDE
+ const QModelIndex &index ) const override
{
if (index.column() != 2) {
QItemDelegate::paint(painter, option, index);
diff --git a/examples/network/torrent/mainwindow.h b/examples/network/torrent/mainwindow.h
index 7c18f770f8..9c55b72256 100644
--- a/examples/network/torrent/mainwindow.h
+++ b/examples/network/torrent/mainwindow.h
@@ -73,11 +73,11 @@ class MainWindow : public QMainWindow
public:
MainWindow(QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
const TorrentClient *clientForRow(int row) const;
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void loadSettings();
diff --git a/examples/network/torrent/metainfo.cpp b/examples/network/torrent/metainfo.cpp
index e3718999b8..565533e2f9 100644
--- a/examples/network/torrent/metainfo.cpp
+++ b/examples/network/torrent/metainfo.cpp
@@ -141,7 +141,7 @@ bool MetaInfo::parse(const QByteArray &data)
}
if (dict.contains("creation date"))
- metaInfoCreationDate.setTime_t(dict.value("creation date").toInt());
+ metaInfoCreationDate.setSecsSinceEpoch(dict.value("creation date").toInt());
if (dict.contains("comment"))
metaInfoComment = QString::fromUtf8(dict.value("comment").toByteArray());
if (dict.contains("created by"))
diff --git a/examples/network/torrent/peerwireclient.h b/examples/network/torrent/peerwireclient.h
index 6fee52bee0..e03b538f63 100644
--- a/examples/network/torrent/peerwireclient.h
+++ b/examples/network/torrent/peerwireclient.h
@@ -122,14 +122,14 @@ public:
qint64 uploadSpeed() const;
bool canTransferMore() const;
- qint64 bytesAvailable() const Q_DECL_OVERRIDE { return incomingBuffer.size() + QTcpSocket::bytesAvailable(); }
+ qint64 bytesAvailable() const override { return incomingBuffer.size() + QTcpSocket::bytesAvailable(); }
qint64 socketBytesAvailable() const { return socket.bytesAvailable(); }
qint64 socketBytesToWrite() const { return socket.bytesToWrite(); }
- void setReadBufferSize(qint64 size) Q_DECL_OVERRIDE;
+ void setReadBufferSize(qint64 size) override;
void connectToHost(const QHostAddress &address,
- quint16 port, OpenMode openMode = ReadWrite) Q_DECL_OVERRIDE;
+ quint16 port, OpenMode openMode = ReadWrite) override;
void diconnectFromHost();
signals:
@@ -148,11 +148,11 @@ signals:
void bytesReceived(qint64 size);
protected:
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 readLineData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 readData(char *data, qint64 maxlen) override;
+ qint64 readLineData(char *data, qint64 maxlen) override;
+ qint64 writeData(const char *data, qint64 len) override;
private slots:
void sendHandShake();
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp
index 6b184be39c..ba87924ff9 100644
--- a/examples/network/torrent/torrentclient.cpp
+++ b/examples/network/torrent/torrentclient.cpp
@@ -703,7 +703,7 @@ void TorrentClient::connectToPeers()
// Pick a random peer from the list of weighed peers.
TorrentPeer *peer = weighedPeers.takeAt(qrand() % weighedPeers.size());
weighedPeers.removeAll(peer);
- peer->connectStart = QDateTime::currentDateTime().toTime_t();
+ peer->connectStart = QDateTime::currentSecsSinceEpoch();
peer->lastVisited = peer->connectStart;
// Connect to the peer.
@@ -717,7 +717,7 @@ QList<TorrentPeer *> TorrentClient::weighedFreePeers() const
QList<TorrentPeer *> weighedPeers;
// Generate a list of peers that we want to connect to.
- uint now = QDateTime::currentDateTime().toTime_t();
+ qint64 now = QDateTime::currentSecsSinceEpoch();
QList<TorrentPeer *> freePeers;
QMap<QString, int> connectionsPerPeer;
foreach (TorrentPeer *peer, d->peers) {
diff --git a/examples/network/torrent/torrentclient.h b/examples/network/torrent/torrentclient.h
index 4db60b9a8c..b9b88b3a07 100644
--- a/examples/network/torrent/torrentclient.h
+++ b/examples/network/torrent/torrentclient.h
@@ -168,7 +168,7 @@ public slots:
void setupIncomingConnection(PeerWireClient *client);
protected slots:
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
private slots:
// File management
diff --git a/examples/network/torrent/torrentserver.h b/examples/network/torrent/torrentserver.h
index 884cce1db8..b0d2b3c012 100644
--- a/examples/network/torrent/torrentserver.h
+++ b/examples/network/torrent/torrentserver.h
@@ -68,7 +68,7 @@ public:
void removeClient(TorrentClient *client);
protected:
- void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE;
+ void incomingConnection(qintptr socketDescriptor) override;
private slots:
void removeClient();
diff --git a/examples/network/torrent/trackerclient.h b/examples/network/torrent/trackerclient.h
index 787e7b2c84..323fc67eba 100644
--- a/examples/network/torrent/trackerclient.h
+++ b/examples/network/torrent/trackerclient.h
@@ -88,7 +88,7 @@ signals:
void stopped();
protected:
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
private slots:
void fetchPeerList();