summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCătălin Badea <catalin.badea392@gmail.com>2012-08-21 19:06:05 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-08-30 20:54:18 (GMT)
commit7d0cd94de71d9e55e573e28206470439ecde3db5 (patch)
treec361caa96dac71d53a74ba76aa3dc1d349a0c59e /Swiften/Client
parent6856199274e9c5e581220fccf520b8f011519d17 (diff)
downloadswift-7d0cd94de71d9e55e573e28206470439ecde3db5.zip
swift-7d0cd94de71d9e55e573e28206470439ecde3db5.tar.bz2
History dialog
Add history dialog as an experimental feature. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/MemoryStorages.cpp15
-rw-r--r--Swiften/Client/MemoryStorages.h2
-rw-r--r--Swiften/Client/Storages.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/Swiften/Client/MemoryStorages.cpp b/Swiften/Client/MemoryStorages.cpp
index fe171f7..703e9ff 100644
--- a/Swiften/Client/MemoryStorages.cpp
+++ b/Swiften/Client/MemoryStorages.cpp
@@ -9,6 +9,7 @@
#include <Swiften/Avatars/AvatarMemoryStorage.h>
#include <Swiften/Disco/CapsMemoryStorage.h>
#include <Swiften/Roster/RosterMemoryStorage.h>
+#include <Swiften/History/SQLiteHistoryStorage.h>
namespace Swift {
@@ -17,6 +18,9 @@ MemoryStorages::MemoryStorages() {
capsStorage = new CapsMemoryStorage();
avatarStorage = new AvatarMemoryStorage();
rosterStorage = new RosterMemoryStorage();
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
+ historyStorage = new SQLiteHistoryStorage(":memory:");
+#endif
}
MemoryStorages::~MemoryStorages() {
@@ -24,6 +28,9 @@ MemoryStorages::~MemoryStorages() {
delete avatarStorage;
delete capsStorage;
delete vcardStorage;
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
+ delete historyStorage;
+#endif
}
VCardStorage* MemoryStorages::getVCardStorage() const {
@@ -42,5 +49,13 @@ RosterStorage* MemoryStorages::getRosterStorage() const {
return rosterStorage;
}
+HistoryStorage* MemoryStorages::getHistoryStorage() const {
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
+ return historyStorage;
+#else
+ return NULL;
+#endif
+}
+
}
diff --git a/Swiften/Client/MemoryStorages.h b/Swiften/Client/MemoryStorages.h
index ca01a7a..403a89a 100644
--- a/Swiften/Client/MemoryStorages.h
+++ b/Swiften/Client/MemoryStorages.h
@@ -24,11 +24,13 @@ namespace Swift {
virtual AvatarStorage* getAvatarStorage() const;
virtual CapsStorage* getCapsStorage() const;
virtual RosterStorage* getRosterStorage() const;
+ virtual HistoryStorage* getHistoryStorage() const;
private:
VCardMemoryStorage* vcardStorage;
AvatarStorage* avatarStorage;
CapsStorage* capsStorage;
RosterStorage* rosterStorage;
+ HistoryStorage* historyStorage;
};
}
diff --git a/Swiften/Client/Storages.h b/Swiften/Client/Storages.h
index 89b770c..76650a6 100644
--- a/Swiften/Client/Storages.h
+++ b/Swiften/Client/Storages.h
@@ -13,6 +13,7 @@ namespace Swift {
class AvatarStorage;
class CapsStorage;
class RosterStorage;
+ class HistoryStorage;
/**
* An interface to hold storage classes for different
@@ -26,5 +27,6 @@ namespace Swift {
virtual AvatarStorage* getAvatarStorage() const = 0;
virtual CapsStorage* getCapsStorage() const = 0;
virtual RosterStorage* getRosterStorage() const = 0;
+ virtual HistoryStorage* getHistoryStorage() const = 0;
};
}