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 /Swift/Controllers/Storages
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 'Swift/Controllers/Storages')
-rw-r--r--Swift/Controllers/Storages/FileStorages.cpp15
-rw-r--r--Swift/Controllers/Storages/FileStorages.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/Swift/Controllers/Storages/FileStorages.cpp b/Swift/Controllers/Storages/FileStorages.cpp
index 6447099..cff87d3 100644
--- a/Swift/Controllers/Storages/FileStorages.cpp
+++ b/Swift/Controllers/Storages/FileStorages.cpp
@@ -9,6 +9,7 @@
#include "Swift/Controllers/Storages/AvatarFileStorage.h"
#include "Swift/Controllers/Storages/CapsFileStorage.h"
#include "Swift/Controllers/Storages/RosterFileStorage.h"
+#include <Swiften/History/SQLiteHistoryStorage.h>
namespace Swift {
@@ -18,6 +19,9 @@ FileStorages::FileStorages(const boost::filesystem::path& baseDir, const JID& ji
capsStorage = new CapsFileStorage(baseDir / "caps");
avatarStorage = new AvatarFileStorage(baseDir / "avatars", baseDir / profile / "avatars");
rosterStorage = new RosterFileStorage(baseDir / profile / "roster.xml");
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
+ historyStorage = new SQLiteHistoryStorage((baseDir / "history.db").string());
+#endif
}
FileStorages::~FileStorages() {
@@ -25,6 +29,9 @@ FileStorages::~FileStorages() {
delete avatarStorage;
delete capsStorage;
delete vcardStorage;
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
+ delete historyStorage;
+#endif
}
VCardStorage* FileStorages::getVCardStorage() const {
@@ -43,4 +50,12 @@ RosterStorage* FileStorages::getRosterStorage() const {
return rosterStorage;
}
+HistoryStorage* FileStorages::getHistoryStorage() const {
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
+ return historyStorage;
+#else
+ return NULL;
+#endif
+}
+
}
diff --git a/Swift/Controllers/Storages/FileStorages.h b/Swift/Controllers/Storages/FileStorages.h
index 28df314..5e89db8 100644
--- a/Swift/Controllers/Storages/FileStorages.h
+++ b/Swift/Controllers/Storages/FileStorages.h
@@ -15,6 +15,7 @@ namespace Swift {
class AvatarFileStorage;
class CapsFileStorage;
class RosterFileStorage;
+ class HistoryStorage;
class JID;
/**
@@ -43,11 +44,13 @@ namespace Swift {
virtual AvatarStorage* getAvatarStorage() const;
virtual CapsStorage* getCapsStorage() const;
virtual RosterStorage* getRosterStorage() const;
+ virtual HistoryStorage* getHistoryStorage() const;
private:
VCardFileStorage* vcardStorage;
AvatarFileStorage* avatarStorage;
CapsFileStorage* capsStorage;
RosterFileStorage* rosterStorage;
+ HistoryStorage* historyStorage;
};
}