mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 23:16:20 +02:00
Move SendAssetTask declaration to header
This commit is contained in:
parent
2e585256ff
commit
34f7aa74f3
2 changed files with 30 additions and 26 deletions
|
@ -29,32 +29,17 @@ void writeError(NLPacketList* packetList, AssetServerError error) {
|
||||||
packetList->writePrimitive(error);
|
packetList->writePrimitive(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
class SendAssetTask : public QRunnable {
|
SendAssetTask::SendAssetTask(MessageID messageID, const QByteArray& assetHash, QString filePath, DataOffset start, DataOffset end,
|
||||||
public:
|
const SharedNodePointer& sendToNode) :
|
||||||
SendAssetTask(MessageID messageID, const QByteArray& assetHash, QString filePath, DataOffset start, DataOffset end, const SharedNodePointer& sendToNode) :
|
QRunnable(),
|
||||||
QRunnable(),
|
_messageID(messageID),
|
||||||
_messageID(messageID),
|
_assetHash(assetHash),
|
||||||
_assetHash(assetHash),
|
_filePath(filePath),
|
||||||
_filePath(filePath),
|
_start(start),
|
||||||
_start(start),
|
_end(end),
|
||||||
_end(end),
|
_sendToNode(sendToNode)
|
||||||
_sendToNode(sendToNode)
|
{
|
||||||
{
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void run();
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void finished();
|
|
||||||
|
|
||||||
private:
|
|
||||||
MessageID _messageID;
|
|
||||||
QByteArray _assetHash;
|
|
||||||
QString _filePath;
|
|
||||||
DataOffset _start;
|
|
||||||
DataOffset _end;
|
|
||||||
SharedNodePointer _sendToNode;
|
|
||||||
};
|
|
||||||
|
|
||||||
void SendAssetTask::run() {
|
void SendAssetTask::run() {
|
||||||
qDebug() << "Starting task to send asset: " << _assetHash << " for messageID " << _messageID;
|
qDebug() << "Starting task to send asset: " << _assetHash << " for messageID " << _messageID;
|
||||||
|
|
|
@ -40,4 +40,23 @@ private:
|
||||||
QThreadPool _taskPool;
|
QThreadPool _taskPool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SendAssetTask : public QRunnable {
|
||||||
|
public:
|
||||||
|
SendAssetTask(MessageID messageID, const QByteArray& assetHash, QString filePath, DataOffset start, DataOffset end,
|
||||||
|
const SharedNodePointer& sendToNode);
|
||||||
|
|
||||||
|
void run();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void finished();
|
||||||
|
|
||||||
|
private:
|
||||||
|
MessageID _messageID;
|
||||||
|
QByteArray _assetHash;
|
||||||
|
QString _filePath;
|
||||||
|
DataOffset _start;
|
||||||
|
DataOffset _end;
|
||||||
|
SharedNodePointer _sendToNode;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue