blob: c3ffc5c3e90d2b42f14e99a215dd0c8ca6115185 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/*
* Copyright (c) 2011 Tobias Markmann
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
#include "FileTransferOverview.h"
#include <boost/bind.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/FileTransfer/FileTransferManager.h>
namespace Swift {
FileTransferOverview::FileTransferOverview(FileTransferManager* ftm) : fileTransferManager(ftm) {
fileTransferManager->onIncomingFileTransfer.connect(boost::bind(&FileTransferOverview::handleIncomingFileTransfer, this, _1));
}
FileTransferOverview::~FileTransferOverview() {
}
void FileTransferOverview::sendFile(const JID& jid, const std::string& filename) {
FileTransferController* controller = new FileTransferController(jid, filename, fileTransferManager);
fileTransfers.push_back(controller);
onNewFileTransferController(controller);
}
void FileTransferOverview::handleIncomingFileTransfer(IncomingFileTransfer::ref transfer) {
FileTransferController* controller = new FileTransferController(transfer);
fileTransfers.push_back(controller);
onNewFileTransferController(controller);
}
const std::vector<FileTransferController*>& FileTransferOverview::getFileTransfers() const {
return fileTransfers;
}
}
|