source: SMSSender/src/business/BCGatewayManager.cpp @ 44:e087b878bc49

3.0
Last change on this file since 44:e087b878bc49 was 44:e087b878bc49, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Removed unused libraries from project-files.
  • Fixed segfault on account creation (the default storage for a gateway is assigned at startup now; not in account loading, which was erroneous)
  • Removed versioning from Makefiles
File size: 944 bytes
Line 
1/*
2 * BCGatewayManager.cpp
3 *
4 *  Created on: Aug 30, 2009
5 *      Author: saemy
6 */
7
8#include "BCGatewayManager.h"
9
10#include <QDir>
11
12#include "BCLibraryLoader.h"
13#include "../persistence/PersistenceFactory.h"
14
15BCGatewayManager* BCGatewayManager::instance_=0;
16BCGatewayManager* BCGatewayManager::instance(){
17    return instance_ ? instance_ : (instance_ = new BCGatewayManager);
18}
19
20
21void BCGatewayManager::loadGatewaysFromLibraryPath(const QDir& libraryPath) {
22    BCLibraryLoader::instance()->loadLibraries(libraryPath);
23
24    foreach (IGateway* gateway, BCLibraryLoader::instance()->gateways()) {
25        gateway->setDefaultStorage(PersistenceFactory::instance()->getStorage());
26        gatewayList_.insert(gateway->name(), gateway);
27    }
28}
29
30IGateway* BCGatewayManager::getGateway(const QString& gatewayName) {
31    return gatewayList_[gatewayName];
32}
33
34QList<IGateway*> BCGatewayManager::getGatewayList() {
35    return gatewayList_.values();
36}
Note: See TracBrowser for help on using the repository browser.