File indexing completed on 2025-01-19 04:24:21

0001 /****************************************************************************************
0002  * Copyright (c) 2008 Edward Toroshchin <edward.hades@gmail.com>                        *
0003  * Copyright (c) 2009 Jeff Mitchell <mitchell@kde.org>                                  *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 
0018 #include "MySqlCollectionFactory.h"
0019 
0020 #include <core-impl/storage/StorageManager.h>
0021 #include <core-impl/collections/db/sql/SqlCollection.h>
0022 #include <core-impl/collections/db/sql/SqlCollectionFactory.h>
0023 
0024 #include <KLocalizedString>
0025 
0026 using namespace Collections;
0027 
0028 
0029 void
0030 MySqlCollectionFactory::init()
0031 {
0032     if( m_initialized )
0033         return;
0034 
0035     SqlCollectionFactory fac;
0036     auto storage = StorageManager::instance()->sqlStorage();
0037     SqlCollection *collection = fac.createSqlCollection( storage );
0038     m_initialized = true;
0039 
0040     Q_EMIT newCollection( collection );
0041 }