summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-04-07 19:57:03 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-08-24 17:10:23 (GMT)
commit6e4b357141a6d09632f1e96d0eaf54f79daf52c9 (patch)
tree7627e6309e9b7048e0da0482fff389a6648b2aae /Swift
parent1586683c148825cd24863aec6ef940c8c0fec5ea (diff)
downloadswift-6e4b357141a6d09632f1e96d0eaf54f79daf52c9.zip
swift-6e4b357141a6d09632f1e96d0eaf54f79daf52c9.tar.bz2
Added VCardStorage.
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/MainController.cpp27
-rw-r--r--Swift/Controllers/MainController.h18
-rw-r--r--Swift/QtUI/QtSwift.cpp20
-rw-r--r--Swift/QtUI/QtSwift.h2
4 files changed, 63 insertions, 4 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index b267dd2..6eb3a2c 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -19,6 +19,7 @@
#include "Swiften/Network/MainBoostIOServiceThread.h"
#include "Swift/Controllers/BuildVersion.h"
#include "Swift/Controllers/Chat/ChatController.h"
+#include "Swiften/VCards/VCardStorageFactory.h"
#include "Swift/Controllers/Chat/MUCSearchController.h"
#include "Swift/Controllers/Chat/ChatsManager.h"
#include "Swift/Controllers/EventController.h"
@@ -63,8 +64,30 @@ static const String CLIENT_VERSION = "1.0-devel";
static const String CLIENT_NODE = "http://swift.im";
-MainController::MainController(ChatWindowFactory* chatWindowFactory, MainWindowFactory *mainWindowFactory, LoginWindowFactory *loginWindowFactory, EventWindowFactory* eventWindowFactory, SettingsProvider *settings, SystemTray* systemTray, SoundPlayer* soundPlayer, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory, ChatListWindowFactory* chatListWindowFactory, MUCSearchWindowFactory* mucSearchWindowFactory, AvatarStorage* avatarStorage, ApplicationMessageDisplay* applicationMessageDisplay, bool useDelayForLatency)
- : timerFactory_(&boostIOServiceThread_.getIOService()), idleDetector_(&idleQuerier_, &timerFactory_, 100), chatWindowFactory_(chatWindowFactory), mainWindowFactory_(mainWindowFactory), loginWindowFactory_(loginWindowFactory), settings_(settings), loginWindow_(NULL), useDelayForLatency_(useDelayForLatency) {
+MainController::MainController(
+ ChatWindowFactory* chatWindowFactory,
+ MainWindowFactory *mainWindowFactory,
+ LoginWindowFactory *loginWindowFactory,
+ EventWindowFactory* eventWindowFactory,
+ SettingsProvider *settings,
+ SystemTray* systemTray,
+ SoundPlayer* soundPlayer,
+ XMLConsoleWidgetFactory* xmlConsoleWidgetFactory,
+ ChatListWindowFactory* chatListWindowFactory,
+ MUCSearchWindowFactory* mucSearchWindowFactory,
+ AvatarStorage* avatarStorage,
+ VCardStorageFactory* vcardStorageFactory,
+ ApplicationMessageDisplay* applicationMessageDisplay,
+ bool useDelayForLatency) :
+ timerFactory_(&boostIOServiceThread_.getIOService()),
+ idleDetector_(&idleQuerier_, &timerFactory_, 100),
+ chatWindowFactory_(chatWindowFactory),
+ mainWindowFactory_(mainWindowFactory),
+ loginWindowFactory_(loginWindowFactory),
+ settings_(settings),
+ loginWindow_(NULL),
+ vcardStorageFactory_(vcardStorageFactory),
+ useDelayForLatency_(useDelayForLatency) {
presenceOracle_ = NULL;
avatarManager_ = NULL;
chatsManager_ = NULL;
diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h
index e220211..a612175 100644
--- a/Swift/Controllers/MainController.h
+++ b/Swift/Controllers/MainController.h
@@ -63,10 +63,25 @@ namespace Swift {
class MUCSearchController;
class MUCSearchWindowFactory;
class StatusTracker;
+ class VCardStorageFactory;
class MainController {
public:
- MainController(ChatWindowFactory* chatWindowFactory, MainWindowFactory *mainWindowFactory, LoginWindowFactory *loginWindowFactory, EventWindowFactory* eventWindowFactory, SettingsProvider *settings, SystemTray* systemTray, SoundPlayer* soundPlayer, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory, ChatListWindowFactory* chatListWindowFactory_, MUCSearchWindowFactory* mucSearchWindowFactory, AvatarStorage* avatarStorage, ApplicationMessageDisplay* applicationMessageDisplay, bool useDelayForLatency);
+ MainController(
+ ChatWindowFactory* chatWindowFactory,
+ MainWindowFactory *mainWindowFactory,
+ LoginWindowFactory *loginWindowFactory,
+ EventWindowFactory* eventWindowFactory,
+ SettingsProvider *settings,
+ SystemTray* systemTray,
+ SoundPlayer* soundPlayer,
+ XMLConsoleWidgetFactory* xmlConsoleWidgetFactory,
+ ChatListWindowFactory* chatListWindowFactory_,
+ MUCSearchWindowFactory* mucSearchWindowFactory,
+ AvatarStorage* avatarStorage,
+ VCardStorageFactory* vcardStorageFactory,
+ ApplicationMessageDisplay* applicationMessageDisplay,
+ bool useDelayForLatency);
~MainController();
@@ -105,6 +120,7 @@ namespace Swift {
SettingsProvider *settings_;
ProfileSettingsProvider* profileSettings_;
AvatarStorage* avatarStorage_;
+ VCardStorageFactory* vcardStorageFactory_;
ApplicationMessageDisplay* applicationMessageDisplay_;
ChatController* chatController_;
XMPPRosterController* xmppRosterController_;
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 55bc112..0405681 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -24,6 +24,7 @@
#include "Swiften/Application/PlatformApplication.h"
#include "Swiften/Application/PlatformApplicationPathProvider.h"
#include "Swiften/Avatars/AvatarFileStorage.h"
+#include "Swiften/VCards/VCardFileStorageFactory.h"
#include "Swiften/Base/String.h"
#include "Swiften/Base/Platform.h"
#include "Swiften/Elements/Presence.h"
@@ -79,6 +80,7 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
application_ = new PlatformApplication(SWIFT_APPLICATION_NAME);
applicationPathProvider_ = new PlatformApplicationPathProvider(SWIFT_APPLICATION_NAME);
avatarStorage_ = new AvatarFileStorage(applicationPathProvider_->getAvatarDir());
+ vcardStorageFactory_ = new VCardFileStorageFactory(applicationPathProvider_->getDataDir());
chatWindowFactory_ = new QtChatWindowFactory(splitter_, settings_, tabs_);
soundPlayer_ = new QtSoundPlayer(applicationPathProvider_);
if (splitter_) {
@@ -100,7 +102,21 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
chatListWindowFactories_.push_back(chatListWindowFactory);
QtMUCSearchWindowFactory* mucSearchWindowFactory = new QtMUCSearchWindowFactory();
mucSearchWindowFactories_.push_back(mucSearchWindowFactory);
- MainController* mainController = new MainController(chatWindowFactory_, rosterWindowFactory, loginWindowFactory, eventWindowFactory, settings_, systemTray, soundPlayer_, xmlConsoleWidgetFactory, chatListWindowFactory, mucSearchWindowFactory, avatarStorage_, application_->getApplicationMessageDisplay(), options.count("latency-debug") > 0);
+ MainController* mainController = new MainController(
+ chatWindowFactory_,
+ rosterWindowFactory,
+ loginWindowFactory,
+ eventWindowFactory,
+ settings_,
+ systemTray,
+ soundPlayer_,
+ xmlConsoleWidgetFactory,
+ chatListWindowFactory,
+ mucSearchWindowFactory,
+ avatarStorage_,
+ vcardStorageFactory_,
+ application_->getApplicationMessageDisplay(),
+ options.count("latency-debug") > 0);
mainControllers_.push_back(mainController);
}
@@ -144,6 +160,8 @@ QtSwift::~QtSwift() {
foreach (QtChatListWindowFactory* factory, chatListWindowFactories_) {
delete factory;
}
+ delete avatarStorage_;
+ delete vcardStorageFactory_;
}
}
diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h
index d205f9f..a0ea069 100644
--- a/Swift/QtUI/QtSwift.h
+++ b/Swift/QtUI/QtSwift.h
@@ -22,6 +22,7 @@ namespace po = boost::program_options;
class QSplitter;
namespace Swift {
+ class VCardStorageFactory;
class AutoUpdater;
class Application;
class ApplicationPathProvider;
@@ -61,6 +62,7 @@ namespace Swift {
Application* application_;
ApplicationPathProvider* applicationPathProvider_;
AvatarStorage* avatarStorage_;
+ VCardStorageFactory* vcardStorageFactory_;
AutoUpdater* autoUpdater_;
};