diff options
Diffstat (limited to 'Swift/Controllers/Storages')
-rw-r--r-- | Swift/Controllers/Storages/FileStorages.cpp | 15 | ||||
-rw-r--r-- | Swift/Controllers/Storages/FileStorages.h | 3 |
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; }; } |