-rw-r--r-- | libopie2/opiepim/core/opimaccessfactory.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libopie2/opiepim/core/opimaccessfactory.h b/libopie2/opiepim/core/opimaccessfactory.h index 6aaa5e4..a80e67c 100644 --- a/libopie2/opiepim/core/opimaccessfactory.h +++ b/libopie2/opiepim/core/opimaccessfactory.h @@ -77,20 +77,20 @@ class OPimAccessFactory * string unique for your application ! * @see OPimGlobal */ static T* create( OPimGlobal::PimType type, OPimGlobal::DatabaseStyle dbStyle, const QString& appName ){ - + OPimBase *base; switch ( type ){ case OPimGlobal::TODOLIST: - return dynamic_cast<T*>( new OPimTodoAccess( OBackendFactory<OPimTodoAccessBackend>::create( type, dbStyle, appName ) ) ); + base = new OPimTodoAccess( OBackendFactory<OPimTodoAccessBackend>::create( type, dbStyle, appName ) ); case OPimGlobal::CONTACTLIST: - return dynamic_cast<T*>( new OPimContactAccess( QString::null, QString::null, OBackendFactory<OPimContactAccessBackend>::create( type, dbStyle, appName ) ) ); + base = new OPimContactAccess( QString::null, QString::null, OBackendFactory<OPimContactAccessBackend>::create( type, dbStyle, appName ) ); case OPimGlobal::DATEBOOK: - return dynamic_cast<T*>( new ODateBookAccess( OBackendFactory<ODateBookAccessBackend>::create( type, dbStyle, appName ) ) ); + base = new ODateBookAccess( OBackendFactory<ODateBookAccessBackend>::create( type, dbStyle, appName ) ); default: return 0l; - } + return static_cast<T*>( base ); } /** |