diff options
Diffstat (limited to 'Slimber')
-rw-r--r-- | Slimber/FileVCardCollection.cpp | 3 | ||||
-rw-r--r-- | Slimber/Server.cpp | 2 | ||||
-rw-r--r-- | Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/Slimber/FileVCardCollection.cpp b/Slimber/FileVCardCollection.cpp index 97ade08..24249d4 100644 --- a/Slimber/FileVCardCollection.cpp +++ b/Slimber/FileVCardCollection.cpp @@ -1,17 +1,18 @@ /* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include "Slimber/FileVCardCollection.h" +#include <boost/smart_ptr/make_shared.hpp> #include <boost/filesystem/fstream.hpp> #include <Swiften/Base/ByteArray.h> #include <Swiften/Elements/VCard.h> #include <Swiften/Serializer/PayloadSerializers/VCardSerializer.h> #include <Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h> #include <Swiften/Parser/PayloadParsers/VCardParser.h> namespace Swift { @@ -24,19 +25,19 @@ boost::shared_ptr<VCard> FileVCardCollection::getOwnVCard() const { ByteArray data; readByteArrayFromFile(data, boost::filesystem::path(vcardsPath / std::string("vcard.xml")).string()); VCardParser parser; PayloadParserTester tester(&parser); tester.parse(byteArrayToString(data)); return boost::dynamic_pointer_cast<VCard>(parser.getPayload()); } else { - return boost::shared_ptr<VCard>(new VCard()); + return boost::make_shared<VCard>(); } } void FileVCardCollection::setOwnVCard(boost::shared_ptr<VCard> v) { boost::filesystem::ofstream file(vcardsPath / std::string("vcard.xml")); file << VCardSerializer().serializePayload(v); file.close(); } diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp index 769217f..b63ca67 100644 --- a/Slimber/Server.cpp +++ b/Slimber/Server.cpp @@ -321,19 +321,19 @@ void Server::handleConnectFinished(boost::shared_ptr<LinkLocalConnector> connect connectors.erase(std::remove(connectors.begin(), connectors.end(), connector), connectors.end()); } void Server::registerLinkLocalSession(boost::shared_ptr<Session> session) { session->onSessionFinished.connect( boost::bind(&Server::handleLinkLocalSessionFinished, this, session)); session->onElementReceived.connect( boost::bind(&Server::handleLinkLocalElementReceived, this, _1, session)); linkLocalSessions.push_back(session); - //tracers.push_back(boost::shared_ptr<SessionTracer>(new SessionTracer(session))); + //tracers.push_back(boost::make_shared<SessionTracer>(session)); session->startSession(); } boost::shared_ptr<Session> Server::getLinkLocalSessionForJID(const JID& jid) { foreach(const boost::shared_ptr<Session> session, linkLocalSessions) { if (session->getRemoteJID() == jid) { return session; } } diff --git a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp index e45861b..c138b2c 100644 --- a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp +++ b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp @@ -36,19 +36,19 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture { CPPUNIT_TEST(testGetRoster_InfoWithFirstAndLastName); CPPUNIT_TEST(testGetRoster_NoInfo); CPPUNIT_TEST(testGetServiceForJID); CPPUNIT_TEST(testGetServiceForJID_NoMatch); CPPUNIT_TEST_SUITE_END(); public: void setUp() { eventLoop = new DummyEventLoop(); - querier = boost::shared_ptr<FakeDNSSDQuerier>(new FakeDNSSDQuerier("wonderland.lit", eventLoop)); + querier = boost::make_shared<FakeDNSSDQuerier>("wonderland.lit", eventLoop); browser = new LinkLocalServiceBrowser(querier); browser->start(); } void tearDown() { browser->stop(); delete browser; delete eventLoop; } |