diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-10-10 13:38:19 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-10-10 13:38:19 (GMT) |
commit | 5fcadd4e60d2e8bd8866bddef6bcefa59a18adf8 (patch) | |
tree | 198eafdec1dce1b7dc6ce21fbbd86bebbd4098cb | |
parent | 29e4e51e21b8902c82456cc85af46fa5f5889f04 (diff) | |
download | swift-5fcadd4e60d2e8bd8866bddef6bcefa59a18adf8.zip swift-5fcadd4e60d2e8bd8866bddef6bcefa59a18adf8.tar.bz2 |
Move SoftwareVersionResponder constructor arguments to setter.
-rw-r--r-- | Documentation/API/SConscript | 9 | ||||
-rw-r--r-- | Documentation/SConscript | 3 | ||||
-rw-r--r-- | Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp | 4 | ||||
-rw-r--r-- | Documentation/SwiftenDevelopersGuide/SConscript | 3 | ||||
-rw-r--r-- | Swift/Controllers/MainController.cpp | 3 | ||||
-rw-r--r-- | Swiften/Queries/Responders/SoftwareVersionResponder.cpp | 11 | ||||
-rw-r--r-- | Swiften/Queries/Responders/SoftwareVersionResponder.h | 13 |
7 files changed, 24 insertions, 22 deletions
diff --git a/Documentation/API/SConscript b/Documentation/API/SConscript index 0a7ae36..df20b27 100644 --- a/Documentation/API/SConscript +++ b/Documentation/API/SConscript @@ -1,7 +1,6 @@ Import("env") -myenv = env.Clone() - -myenv.Tool("DoxyGen", toolpath = ["#/BuildTools/SCons/Tools"]) - -myenv.DoxyGen("Doxyfile") +if "doc" in ARGUMENTS : + myenv = env.Clone() + myenv.Tool("DoxyGen", toolpath = ["#/BuildTools/SCons/Tools"]) + myenv.DoxyGen("Doxyfile") diff --git a/Documentation/SConscript b/Documentation/SConscript index b42fc62..da93894 100644 --- a/Documentation/SConscript +++ b/Documentation/SConscript @@ -1,5 +1,4 @@ Import("env") if env["SCONS_STAGE"] == "build" : - if "doc" in ARGUMENTS : - SConscript(dirs = ["SwiftenDevelopersGuide", "API"]) + SConscript(dirs = ["SwiftenDevelopersGuide", "API"]) diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp index 98a63d6..d675062 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoBot5.cpp @@ -25,8 +25,8 @@ class EchoBot { bind(&EchoBot::handlePresenceReceived, this, _1)); tracer = new ClientXMLTracer(client); //... - softwareVersionResponder = new SoftwareVersionResponder( - "EchoBot", "1.0", client->getIQRouter()); + softwareVersionResponder = new SoftwareVersionResponder(client->getIQRouter()); + softwareVersionResponder->setVersion("EchoBot", "1.0"); softwareVersionResponder->start(); //... client->connect(); diff --git a/Documentation/SwiftenDevelopersGuide/SConscript b/Documentation/SwiftenDevelopersGuide/SConscript index fb08a8f..dc00ab4 100644 --- a/Documentation/SwiftenDevelopersGuide/SConscript +++ b/Documentation/SwiftenDevelopersGuide/SConscript @@ -81,7 +81,8 @@ def generateDocBookCode(env, target, source) : ################################################################################ -env.DocBook("Swiften Developers Guide.xml") +if "doc" in ARGUMENTS : + env.DocBook("Swiften Developers Guide.xml") for i in range(1, 6) : source = "Examples/EchoBot/EchoBot" + str(i) + ".cpp" diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 48cceca..53b9ab0 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -293,7 +293,8 @@ void MainController::handleConnected() { eventWindowController_ = new EventWindowController(eventController_, eventWindowFactory_); - clientVersionResponder_ = new SoftwareVersionResponder(CLIENT_NAME, buildVersion, client_->getIQRouter()); + clientVersionResponder_ = new SoftwareVersionResponder(client_->getIQRouter()); + clientVersionResponder_->setVersion(CLIENT_NAME, buildVersion); clientVersionResponder_->start(); loginWindow_->morphInto(rosterController_->getWindow()); diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp index a900ecb..b2e7273 100644 --- a/Swiften/Queries/Responders/SoftwareVersionResponder.cpp +++ b/Swiften/Queries/Responders/SoftwareVersionResponder.cpp @@ -9,13 +9,16 @@ namespace Swift { -SoftwareVersionResponder::SoftwareVersionResponder( - const String& client, const String& version, IQRouter* router) : - GetResponder<SoftwareVersion>(router), client_(client), version_(version) { +SoftwareVersionResponder::SoftwareVersionResponder(IQRouter* router) : GetResponder<SoftwareVersion>(router) { +} + +void SoftwareVersionResponder::setVersion(const String& client, const String& version) { + this->client = client; + this->version = version; } bool SoftwareVersionResponder::handleGetRequest(const JID& from, const String& id, boost::shared_ptr<SoftwareVersion>) { - sendResponse(from, id, boost::shared_ptr<SoftwareVersion>(new SoftwareVersion(client_, version_))); + sendResponse(from, id, boost::shared_ptr<SoftwareVersion>(new SoftwareVersion(client, version))); return true; } diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.h b/Swiften/Queries/Responders/SoftwareVersionResponder.h index b877b0c..7242b4b 100644 --- a/Swiften/Queries/Responders/SoftwareVersionResponder.h +++ b/Swiften/Queries/Responders/SoftwareVersionResponder.h @@ -4,8 +4,7 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_SoftwareVersionResponder_H -#define SWIFTEN_SoftwareVersionResponder_H +#pragma once #include "Swiften/Queries/GetResponder.h" #include "Swiften/Elements/SoftwareVersion.h" @@ -15,15 +14,15 @@ namespace Swift { class SoftwareVersionResponder : public GetResponder<SoftwareVersion> { public: - SoftwareVersionResponder(const String& client, const String& version, IQRouter* router); + SoftwareVersionResponder(IQRouter* router); + + void setVersion(const String& client, const String& version); private: virtual bool handleGetRequest(const JID& from, const String& id, boost::shared_ptr<SoftwareVersion> payload); private: - String client_; - String version_; + String client; + String version; }; } - -#endif |