summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-24 13:46:12 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-24 15:56:44 (GMT)
commit9dccf1e0c86b10d41dd2d5f3bf71faf1bf8d77c8 (patch)
tree4d054c17e759f5f206c67fbbef1ca3e77647ba07 /Swift/QtUI
parentefc2bed8610f6e1b7fc29b3dd6f13137fc19bdf6 (diff)
downloadswift-9dccf1e0c86b10d41dd2d5f3bf71faf1bf8d77c8.zip
swift-9dccf1e0c86b10d41dd2d5f3bf71faf1bf8d77c8.tar.bz2
Created Storages interface.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtSwift.cpp14
-rw-r--r--Swift/QtUI/QtSwift.h11
2 files changed, 7 insertions, 18 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index d9879a2..d61f94c 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -26,9 +26,9 @@
#include "SwifTools/Application/PlatformApplicationPathProvider.h"
#include "Swiften/Avatars/AvatarFileStorage.h"
#include "Swiften/Disco/CapsFileStorage.h"
-#include "Swiften/VCards/VCardFileStorageFactory.h"
#include "Swiften/Base/String.h"
#include "Swiften/Base/Platform.h"
+#include "Swift/Controllers/FileStoragesFactory.h"
#include "Swiften/Elements/Presence.h"
#include "Swiften/Client/Client.h"
#include "Swift/Controllers/MainController.h"
@@ -95,9 +95,7 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
tabs_ = options.count("no-tabs") && !(splitter_ > 0) ? NULL : new QtChatTabs();
settings_ = new QtSettingsProvider();
applicationPathProvider_ = new PlatformApplicationPathProvider(SWIFT_APPLICATION_NAME);
- avatarStorage_ = new AvatarFileStorage(applicationPathProvider_->getAvatarDir());
- vcardStorageFactory_ = new VCardFileStorageFactory(applicationPathProvider_->getDataDir());
- capsStorage_ = new CapsFileStorage(applicationPathProvider_->getDataDir() / "caps");
+ storagesFactory_ = new FileStoragesFactory(applicationPathProvider_->getDataDir());
chatWindowFactory_ = new QtChatWindowFactory(splitter_, settings_, tabs_, "");
soundPlayer_ = new QtSoundPlayer(applicationPathProvider_);
#if defined(HAVE_GROWL)
@@ -147,9 +145,7 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
xmlConsoleWidgetFactory,
chatListWindowFactory,
mucSearchWindowFactory,
- avatarStorage_,
- capsStorage_,
- vcardStorageFactory_,
+ storagesFactory_,
dock_,
notifier_,
options.count("latency-debug") > 0);
@@ -197,9 +193,7 @@ QtSwift::~QtSwift() {
foreach (QtChatListWindowFactory* factory, chatListWindowFactories_) {
delete factory;
}
- delete capsStorage_;
- delete avatarStorage_;
- delete vcardStorageFactory_;
+ delete storagesFactory_;
}
}
diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h
index d72faaa..59fa746 100644
--- a/Swift/QtUI/QtSwift.h
+++ b/Swift/QtUI/QtSwift.h
@@ -4,8 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFT_QtSwift_H
-#define SWIFT_QtSwift_H
+#pragma once
#include <boost/program_options/variables_map.hpp>
#include <boost/program_options/options_description.hpp>
@@ -31,7 +30,7 @@ class QSplitter;
namespace Swift {
class Dock;
class Notifier;
- class VCardStorageFactory;
+ class StoragesFactory;
class AutoUpdater;
class ApplicationPathProvider;
class AvatarStorage;
@@ -70,9 +69,7 @@ namespace Swift {
Dock* dock_;
QtChatTabs* tabs_;
ApplicationPathProvider* applicationPathProvider_;
- AvatarStorage* avatarStorage_;
- CapsStorage* capsStorage_;
- VCardStorageFactory* vcardStorageFactory_;
+ StoragesFactory* storagesFactory_;
AutoUpdater* autoUpdater_;
Notifier* notifier_;
#if defined(SWIFTEN_PLATFORM_MACOSX)
@@ -83,5 +80,3 @@ namespace Swift {
#endif
};
}
-
-#endif