summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Slimber')
-rw-r--r--Slimber/CLI/main.cpp2
-rw-r--r--Slimber/Cocoa/CocoaAction.h26
-rw-r--r--Slimber/Cocoa/CocoaAction.mm22
-rw-r--r--Slimber/Cocoa/CocoaMenulet.h2
-rw-r--r--Slimber/Cocoa/SConscript1
-rw-r--r--Slimber/Cocoa/main.h2
-rw-r--r--Slimber/Cocoa/main.mm2
-rw-r--r--Slimber/FileVCardCollection.cpp14
-rw-r--r--Slimber/LinkLocalPresenceManager.cpp8
-rw-r--r--Slimber/LinkLocalPresenceManager.h6
-rw-r--r--Slimber/MainController.cpp10
-rw-r--r--Slimber/Menulet.h2
-rw-r--r--Slimber/MenuletController.cpp2
-rw-r--r--Slimber/Qt/main.cpp4
-rw-r--r--Slimber/SConscript1
-rw-r--r--Slimber/Server.cpp42
-rw-r--r--Slimber/Server.h20
-rw-r--r--Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp48
-rw-r--r--Slimber/VCardCollection.h2
19 files changed, 85 insertions, 131 deletions
diff --git a/Slimber/CLI/main.cpp b/Slimber/CLI/main.cpp
index 5252373..3dd59a6 100644
--- a/Slimber/CLI/main.cpp
+++ b/Slimber/CLI/main.cpp
@@ -4,7 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "Swiften/EventLoop/SimpleEventLoop.h"
+#include <Swiften/EventLoop/SimpleEventLoop.h>
#include "Slimber/CLI/DummyMenulet.h"
#include "Slimber/MainController.h"
diff --git a/Slimber/Cocoa/CocoaAction.h b/Slimber/Cocoa/CocoaAction.h
deleted file mode 100644
index a46ef7c..0000000
--- a/Slimber/Cocoa/CocoaAction.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
- */
-
-#pragma once
-
-#include <Cocoa/Cocoa.h>
-#include <boost/function.hpp>
-
-@interface CocoaAction : NSObject {
- boost::function<void ()>* function;
-}
-
-/**
- * Acquires ownership of 'f'.
- */
-- (id) initWithFunction: (boost::function<void()>*) f;
-
-/**
- * Calls the functor passed as a parameter to the contsructor.
- */
-- (void) doAction: (id) sender;
-
-@end
diff --git a/Slimber/Cocoa/CocoaAction.mm b/Slimber/Cocoa/CocoaAction.mm
deleted file mode 100644
index 15498a1..0000000
--- a/Slimber/Cocoa/CocoaAction.mm
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "Slimber/Cocoa/CocoaAction.h"
-
-@implementation CocoaAction
-
-- (id) initWithFunction: (boost::function<void()>*) f {
- if ([super init]) {
- function = f;
- }
- return self;
-}
-
-- (void) dealloc {
- delete function;
- [super dealloc];
-}
-
-- (void) doAction: (id) sender {
- (void) sender;
- (*function)();
-}
-
-@end
diff --git a/Slimber/Cocoa/CocoaMenulet.h b/Slimber/Cocoa/CocoaMenulet.h
index 7f2758b..5c7c33e 100644
--- a/Slimber/Cocoa/CocoaMenulet.h
+++ b/Slimber/Cocoa/CocoaMenulet.h
@@ -9,7 +9,7 @@
#include <Cocoa/Cocoa.h>
#include "Slimber/Menulet.h"
-#include "Slimber/Cocoa/CocoaAction.h"
+#include <SwifTools/Cocoa/CocoaAction.h>
class CocoaMenulet : public Menulet {
public:
diff --git a/Slimber/Cocoa/SConscript b/Slimber/Cocoa/SConscript
index e2d8221..d664846 100644
--- a/Slimber/Cocoa/SConscript
+++ b/Slimber/Cocoa/SConscript
@@ -16,7 +16,6 @@ myenv.Program("Slimber", [
"main.mm",
"CocoaController.mm",
"CocoaMenulet.mm",
- "CocoaAction.mm"
])
myenv.Nib("MainMenu")
diff --git a/Slimber/Cocoa/main.h b/Slimber/Cocoa/main.h
index 681139d..0f686ad 100644
--- a/Slimber/Cocoa/main.h
+++ b/Slimber/Cocoa/main.h
@@ -6,6 +6,6 @@
#pragma once
-#include "Swiften/EventLoop/Cocoa/CocoaEventLoop.h"
+#include <Swiften/EventLoop/Cocoa/CocoaEventLoop.h>
extern Swift::CocoaEventLoop* eventLoop;
diff --git a/Slimber/Cocoa/main.mm b/Slimber/Cocoa/main.mm
index fc051e0..167c1ab 100644
--- a/Slimber/Cocoa/main.mm
+++ b/Slimber/Cocoa/main.mm
@@ -1,7 +1,7 @@
#include <Cocoa/Cocoa.h>
#include "Slimber/Cocoa/main.h"
-#include "Swiften/EventLoop/Cocoa/CocoaEventLoop.h"
+#include <Swiften/EventLoop/Cocoa/CocoaEventLoop.h>
Swift::CocoaEventLoop* eventLoop;
diff --git a/Slimber/FileVCardCollection.cpp b/Slimber/FileVCardCollection.cpp
index 960cd84..97ade08 100644
--- a/Slimber/FileVCardCollection.cpp
+++ b/Slimber/FileVCardCollection.cpp
@@ -8,11 +8,11 @@
#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"
+#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 {
@@ -22,11 +22,11 @@ FileVCardCollection::FileVCardCollection(boost::filesystem::path dir) : vcardsPa
boost::shared_ptr<VCard> FileVCardCollection::getOwnVCard() const {
if (boost::filesystem::exists(vcardsPath / std::string("vcard.xml"))) {
ByteArray data;
- data.readFromFile(boost::filesystem::path(vcardsPath / std::string("vcard.xml")).string());
+ readByteArrayFromFile(data, boost::filesystem::path(vcardsPath / std::string("vcard.xml")).string());
VCardParser parser;
PayloadParserTester tester(&parser);
- tester.parse(data.toString());
+ tester.parse(byteArrayToString(data));
return boost::dynamic_pointer_cast<VCard>(parser.getPayload());
}
else {
diff --git a/Slimber/LinkLocalPresenceManager.cpp b/Slimber/LinkLocalPresenceManager.cpp
index edb7e91..708327e 100644
--- a/Slimber/LinkLocalPresenceManager.cpp
+++ b/Slimber/LinkLocalPresenceManager.cpp
@@ -8,10 +8,10 @@
#include <boost/bind.hpp>
-#include "Swiften/Base/foreach.h"
-#include "Swiften/LinkLocal/LinkLocalServiceBrowser.h"
-#include "Swiften/Elements/RosterPayload.h"
-#include "Swiften/Elements/Presence.h"
+#include <Swiften/Base/foreach.h>
+#include <Swiften/LinkLocal/LinkLocalServiceBrowser.h>
+#include <Swiften/Elements/RosterPayload.h>
+#include <Swiften/Elements/Presence.h>
namespace Swift {
diff --git a/Slimber/LinkLocalPresenceManager.h b/Slimber/LinkLocalPresenceManager.h
index 26bb7ce..5613448 100644
--- a/Slimber/LinkLocalPresenceManager.h
+++ b/Slimber/LinkLocalPresenceManager.h
@@ -7,11 +7,11 @@
#pragma once
#include <boost/shared_ptr.hpp>
-#include "Swiften/Base/boost_bsignals.h"
+#include <Swiften/Base/boost_bsignals.h>
-#include "Swiften/Elements/RosterItemPayload.h"
+#include <Swiften/Elements/RosterItemPayload.h>
#include <string>
-#include "Swiften/JID/JID.h"
+#include <Swiften/JID/JID.h>
namespace Swift {
class LinkLocalService;
diff --git a/Slimber/MainController.cpp b/Slimber/MainController.cpp
index e39a660..c2bbb40 100644
--- a/Slimber/MainController.cpp
+++ b/Slimber/MainController.cpp
@@ -10,11 +10,11 @@
#include <boost/lexical_cast.hpp>
#include <iostream>
-#include "Swiften/Base/foreach.h"
-#include "SwifTools/Application/PlatformApplicationPathProvider.h"
-#include "Swiften/LinkLocal/LinkLocalService.h"
-#include "Swiften/LinkLocal/LinkLocalServiceBrowser.h"
-#include "Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h"
+#include <Swiften/Base/foreach.h>
+#include <SwifTools/Application/PlatformApplicationPathProvider.h>
+#include <Swiften/LinkLocal/LinkLocalService.h>
+#include <Swiften/LinkLocal/LinkLocalServiceBrowser.h>
+#include <Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h>
#include "Slimber/Server.h"
#include "Slimber/FileVCardCollection.h"
#include "Slimber/MenuletController.h"
diff --git a/Slimber/Menulet.h b/Slimber/Menulet.h
index df3c32c..f734b18 100644
--- a/Slimber/Menulet.h
+++ b/Slimber/Menulet.h
@@ -7,7 +7,7 @@
#pragma once
#include <string>
-#include "Swiften/Base/boost_bsignals.h"
+#include <Swiften/Base/boost_bsignals.h>
class Menulet {
public:
diff --git a/Slimber/MenuletController.cpp b/Slimber/MenuletController.cpp
index 351db21..03b9187 100644
--- a/Slimber/MenuletController.cpp
+++ b/Slimber/MenuletController.cpp
@@ -6,7 +6,7 @@
#include "Slimber/MenuletController.h"
-#include "Swiften/Base/foreach.h"
+#include <Swiften/Base/foreach.h>
#include <string>
#include "Slimber/Menulet.h"
diff --git a/Slimber/Qt/main.cpp b/Slimber/Qt/main.cpp
index 0971eca..517a253 100644
--- a/Slimber/Qt/main.cpp
+++ b/Slimber/Qt/main.cpp
@@ -11,8 +11,8 @@
#include "QtMenulet.h"
#include "Slimber/MainController.h"
-#include "Swiften/EventLoop/Qt/QtEventLoop.h"
-#include "Slimber/Qt/BuildVersion.h"
+#include <Swiften/EventLoop/Qt/QtEventLoop.h>
+#include <Slimber/Qt/BuildVersion.h>
int main(int argc, char* argv[]) {
QApplication app(argc, argv);
diff --git a/Slimber/SConscript b/Slimber/SConscript
index 9a84c17..dc7fefa 100644
--- a/Slimber/SConscript
+++ b/Slimber/SConscript
@@ -33,6 +33,7 @@ if "Slimber" in env["PROJECTS"] :
myenv = env.Clone()
myenv.MergeFlags(env["BOOST_FLAGS"])
myenv.MergeFlags(env["SWIFTEN_FLAGS"])
+ myenv.MergeFlags(env["SWIFTEN_DEP_FLAGS"])
myenv.StaticLibrary("Slimber", [
"LinkLocalPresenceManager.cpp",
"FileVCardCollection.cpp",
diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp
index 380ce6a..fb9318e 100644
--- a/Slimber/Server.cpp
+++ b/Slimber/Server.cpp
@@ -8,29 +8,31 @@
#include <string>
#include <boost/bind.hpp>
-
-#include "Swiften/Base/String.h"
-#include "Swiften/LinkLocal/LinkLocalConnector.h"
-#include "Swiften/Network/Connection.h"
-#include "Swiften/Session/SessionTracer.h"
-#include "Swiften/Elements/Element.h"
-#include "Swiften/Elements/Presence.h"
-#include "Swiften/Elements/RosterPayload.h"
-#include "Swiften/Network/BoostConnection.h"
-#include "Swiften/Network/BoostConnectionServer.h"
-#include "Swiften/Session/SessionTracer.h"
-#include "Swiften/Elements/IQ.h"
-#include "Swiften/Elements/VCard.h"
-#include "Swiften/Server/UserRegistry.h"
+#include <iostream>
+
+#include <Swiften/Base/foreach.h>
+#include <Swiften/Base/String.h>
+#include <Swiften/LinkLocal/LinkLocalConnector.h>
+#include <Swiften/Network/Connection.h>
+#include <Swiften/Session/SessionTracer.h>
+#include <Swiften/Elements/Element.h>
+#include <Swiften/Elements/Presence.h>
+#include <Swiften/Elements/RosterPayload.h>
+#include <Swiften/Network/BoostConnection.h>
+#include <Swiften/Network/BoostConnectionServer.h>
+#include <Swiften/Session/SessionTracer.h>
+#include <Swiften/Elements/IQ.h>
+#include <Swiften/Elements/VCard.h>
+#include <Swiften/Server/UserRegistry.h>
#include <string>
-#include "Swiften/LinkLocal/LinkLocalServiceInfo.h"
-#include "Swiften/LinkLocal/OutgoingLinkLocalSession.h"
-#include "Swiften/LinkLocal/IncomingLinkLocalSession.h"
-#include "Swiften/LinkLocal/LinkLocalServiceBrowser.h"
-#include "Swiften/Network/ConnectionServer.h"
+#include <Swiften/LinkLocal/LinkLocalServiceInfo.h>
+#include <Swiften/LinkLocal/OutgoingLinkLocalSession.h>
+#include <Swiften/LinkLocal/IncomingLinkLocalSession.h>
+#include <Swiften/LinkLocal/LinkLocalServiceBrowser.h>
+#include <Swiften/Network/ConnectionServer.h>
#include "Slimber/VCardCollection.h"
#include "Slimber/LinkLocalPresenceManager.h"
-#include "Swiften/Server/ServerFromClientSession.h"
+#include <Swiften/Server/ServerFromClientSession.h>
namespace Swift {
diff --git a/Slimber/Server.h b/Slimber/Server.h
index 98332fd..386365b 100644
--- a/Slimber/Server.h
+++ b/Slimber/Server.h
@@ -10,15 +10,15 @@
#include <boost/optional.hpp>
#include <vector>
-#include "Swiften/Network/BoostIOServiceThread.h"
-#include "Swiften/Network/BoostConnectionServer.h"
-#include "Swiften/Server/UserRegistry.h"
-#include "Swiften/Base/IDGenerator.h"
-#include "Swiften/Server/ServerFromClientSession.h"
-#include "Swiften/JID/JID.h"
-#include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h"
-#include "Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h"
-#include "Swiften/LinkLocal/LinkLocalServiceInfo.h"
+#include <Swiften/Network/BoostIOServiceThread.h>
+#include <Swiften/Network/BoostConnectionServer.h>
+#include <Swiften/Server/UserRegistry.h>
+#include <Swiften/Base/IDGenerator.h>
+#include <Swiften/Server/ServerFromClientSession.h>
+#include <Swiften/JID/JID.h>
+#include <Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h>
+#include <Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h>
+#include <Swiften/LinkLocal/LinkLocalServiceInfo.h>
#include "Slimber/ServerError.h"
namespace Swift {
@@ -87,7 +87,7 @@ namespace Swift {
public:
DummyUserRegistry() {}
- virtual bool isValidUserPassword(const JID&, const std::string&) const {
+ virtual bool isValidUserPassword(const JID&, const SafeByteArray&) const {
return true;
}
};
diff --git a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
index 47eb05c..e45861b 100644
--- a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
+++ b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp
@@ -9,16 +9,16 @@
#include <boost/bind.hpp>
#include <map>
-#include "Swiften/Elements/Presence.h"
-#include "Swiften/Elements/RosterPayload.h"
-#include "Swiften/Elements/RosterItemPayload.h"
+#include <Swiften/Elements/Presence.h>
+#include <Swiften/Elements/RosterPayload.h>
+#include <Swiften/Elements/RosterItemPayload.h>
#include "Slimber/LinkLocalPresenceManager.h"
-#include "Swiften/LinkLocal/LinkLocalServiceInfo.h"
-#include "Swiften/LinkLocal/LinkLocalServiceBrowser.h"
-#include "Swiften/LinkLocal/DNSSD/DNSSDServiceID.h"
-#include "Swiften/LinkLocal/DNSSD/DNSSDResolveServiceQuery.h"
-#include "Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h"
-#include "Swiften/EventLoop/DummyEventLoop.h"
+#include <Swiften/LinkLocal/LinkLocalServiceInfo.h>
+#include <Swiften/LinkLocal/LinkLocalServiceBrowser.h>
+#include <Swiften/LinkLocal/DNSSD/DNSSDServiceID.h>
+#include <Swiften/LinkLocal/DNSSD/DNSSDResolveServiceQuery.h>
+#include <Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h>
+#include <Swiften/EventLoop/DummyEventLoop.h>
using namespace Swift;
@@ -56,14 +56,14 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
void testConstructor() {
addService("alice@wonderland");
addService("rabbit@teaparty");
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getRoster()->getItems().size()));
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(testling->getAllPresence().size()));
}
void testServiceAdded() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice");
@@ -79,7 +79,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testServiceRemoved() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
removeService("alice@wonderland");
@@ -92,7 +92,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testServiceChanged() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
updateServicePresence("alice@wonderland", LinkLocalServiceInfo::Away, "I'm Away");
@@ -105,7 +105,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetAllPresence() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("rabbit@teaparty");
@@ -121,7 +121,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice");
addService("rabbit@teaparty", "Rabbit");
@@ -140,7 +140,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithNick() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "Alice", "Alice In", "Wonderland");
@@ -149,7 +149,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithFirstName() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "Alice In", "");
@@ -158,7 +158,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithLastName() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "", "Wonderland");
@@ -167,7 +167,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_InfoWithFirstAndLastName() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland", "", "Alice In", "Wonderland");
@@ -176,7 +176,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetRoster_NoInfo() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
@@ -185,7 +185,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetServiceForJID() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("rabbit@teaparty");
@@ -197,7 +197,7 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
void testGetServiceForJID_NoMatch() {
- std::auto_ptr<LinkLocalPresenceManager> testling(createTestling());
+ boost::shared_ptr<LinkLocalPresenceManager> testling(createTestling());
addService("alice@wonderland");
addService("queen@garden");
@@ -206,8 +206,8 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {
}
private:
- std::auto_ptr<LinkLocalPresenceManager> createTestling() {
- std::auto_ptr<LinkLocalPresenceManager> testling(
+ boost::shared_ptr<LinkLocalPresenceManager> createTestling() {
+ boost::shared_ptr<LinkLocalPresenceManager> testling(
new LinkLocalPresenceManager(browser));
testling->onRosterChanged.connect(boost::bind(
&LinkLocalPresenceManagerTest::handleRosterChanged, this, _1));
diff --git a/Slimber/VCardCollection.h b/Slimber/VCardCollection.h
index 2203444..4e50848 100644
--- a/Slimber/VCardCollection.h
+++ b/Slimber/VCardCollection.h
@@ -8,7 +8,7 @@
#include <boost/shared_ptr.hpp>
-#include "Swiften/Elements/VCard.h"
+#include <Swiften/Elements/VCard.h>
namespace Swift {
class VCardCollection {