summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-30 14:11:35 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-30 17:44:46 (GMT)
commit59be74ec6fc7bc495f2a261b8f274b8555aee306 (patch)
tree915be433534956f9316ba41220c064af77b9da90 /Swiften/Examples
parentc759220a7fcd824a7a842a468c660558fa1a1cf1 (diff)
downloadswift-59be74ec6fc7bc495f2a261b8f274b8555aee306.zip
swift-59be74ec6fc7bc495f2a261b8f274b8555aee306.tar.bz2
Changed CoreClient::onError to CoreClient::onDisconnected.
The error parameter is optional.
Diffstat (limited to 'Swiften/Examples')
-rw-r--r--Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp4
-rw-r--r--Swiften/Examples/SendFile/SendFile.cpp6
-rw-r--r--Swiften/Examples/SendMessage/SendMessage.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp
index e870d83..9da5cdf 100644
--- a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp
+++ b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp
@@ -46,7 +46,7 @@ void handleConnected() {
discoInfoRequest->send();
}
-void handleError(const ClientError&) {
+void handleDisconnected(const boost::optional<ClientError>&) {
exitCode = CANNOT_AUTH;
eventLoop.stop();
}
@@ -73,7 +73,7 @@ int main(int argc, char* argv[]) {
timeout = (timeout ? timeout : 30) * 1000;
ClientXMLTracer* tracer = new ClientXMLTracer(client);
client->onConnected.connect(&handleConnected);
- errorConnection = client->onError.connect(&handleError);
+ errorConnection = client->onDisconnected.connect(&handleDisconnected);
std::cout << "Connecting to JID " << jid << " with timeout " << timeout << "ms on host: "; ;
if (!connectHost.isEmpty()) {
std::cout << connectHost << std::endl;
diff --git a/Swiften/Examples/SendFile/SendFile.cpp b/Swiften/Examples/SendFile/SendFile.cpp
index 6f72480..f0a2d59 100644
--- a/Swiften/Examples/SendFile/SendFile.cpp
+++ b/Swiften/Examples/SendFile/SendFile.cpp
@@ -32,13 +32,13 @@ class FileSender {
client = new Swift::Client(&eventLoop, jid, password);
client->onConnected.connect(boost::bind(&FileSender::handleConnected, this));
- client->onError.connect(boost::bind(&FileSender::handleError, this, _1));
+ client->onDisconnected.connect(boost::bind(&FileSender::handleDisconnected, this, _1));
//tracer = new ClientXMLTracer(client);
}
~FileSender() {
//delete tracer;
- client->onError.disconnect(boost::bind(&FileSender::handleError, this, _1));
+ client->onDisconnected.disconnect(boost::bind(&FileSender::handleDisconnected, this, _1));
client->onConnected.disconnect(boost::bind(&FileSender::handleConnected, this));
delete client;
delete socksBytestreamServer;
@@ -67,7 +67,7 @@ class FileSender {
transfer->start();
}
- void handleError(const ClientError&) {
+ void handleDisconnected(const boost::optional<ClientError>&) {
std::cerr << "Error!" << std::endl;
exit(-1);
}
diff --git a/Swiften/Examples/SendMessage/SendMessage.cpp b/Swiften/Examples/SendMessage/SendMessage.cpp
index d9ed923..fe020aa 100644
--- a/Swiften/Examples/SendMessage/SendMessage.cpp
+++ b/Swiften/Examples/SendMessage/SendMessage.cpp
@@ -37,7 +37,7 @@ void handleConnected() {
eventLoop.stop();
}
-void handleError(const ClientError&) {
+void handleDisconnected(const boost::optional<ClientError>&) {
std::cerr << "Error!" << std::endl;
exitCode = 1;
eventLoop.stop();
@@ -64,7 +64,7 @@ int main(int argc, char* argv[]) {
ClientXMLTracer* tracer = new ClientXMLTracer(client);
client->onConnected.connect(&handleConnected);
- errorConnection = client->onError.connect(&handleError);
+ errorConnection = client->onDisconnected.connect(&handleDisconnected);
if (!connectHost.isEmpty()) {
client->connect(connectHost);
} else {