[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [amarok] /: Create Storage plugins as basis for local collection
From:       Ralf Engels <ralf-engels () gmx ! de>
Date:       2015-01-17 18:12:19
Message-ID: E1YCXr9-000431-PI () scm ! kde ! org
[Download RAW message or body]

Git commit a81d1b126d9efa85aa73bbf24a0f86e6597c8575 by Ralf Engels.
Committed on 22/12/2014 at 21:54.
Pushed by rengels into branch 'master'.

Create Storage plugins as basis for local collection

The old plugin model had the local collections (server or embedded)
create SqlStorage objects that were used by whole amarok.
This also meant several strange behaviours:
- there needed to be two collections when in fact the only difference
  were the storages they created
- the local collection needed to be initialized first or else
  the storage might not be available for other plugins or collections
- the CollectionManager was also providing the SqlStorage

The new plugin model has storage factories and only one local
collection.

Updated plugin version to 7.2

M  +1    -0    src/CMakeLists.txt
M  +21   -21   src/PluginManager.cpp
M  +2    -1    src/PluginManager.h
M  +1    -1    src/core-impl/collections/audiocd/amarok_collection-audiocdcollection.desktop
 M  +1    -1    src/core-impl/collections/daap/amarok_collection-daapcollection.desktop
 M  +1    -6    src/core-impl/collections/db/sql/CMakeLists.txt
A  +39   -0    src/core-impl/collections/db/sql/mysqlcollection/CMakeLists.txt
R  +6    -7    src/core-impl/collections/db/sql/mysqlcollection/MySqlCollectionFactory.cpp \
[from: src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.cpp \
- 084% similarity] C  +6    -6    \
src/core-impl/collections/db/sql/mysqlcollection/MySqlCollectionFactory.h [from: \
src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h - 080% \
similarity] C  +3    -3    \
src/core-impl/collections/db/sql/mysqlcollection/MySqlQueryMaker.cpp [from: \
src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp - 089% similarity] \
C  +9    -4    src/core-impl/collections/db/sql/mysqlcollection/MySqlQueryMaker.h \
[from: src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h - 091% \
similarity] R  +46   -46   \
src/core-impl/collections/db/sql/mysqlcollection/amarok_collection-mysqlcollection.desktop \
[from: src/core-impl/collections/db/sql/mysqlecollection/amarok_collection-mysqlecollection.desktop \
- 073% similarity] D  +0    -48   \
src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.cpp D  \
+0    -130  src/core-impl/collections/db/sql/mysqlservercollection/amarok_collection-mysqlservercollection.desktop
 M  +1    -1    src/core-impl/collections/ipodcollection/amarok_collection-ipodcollection.desktop
 M  +1    -1    src/core-impl/collections/mediadevicecollection/amarok_collection-mediadevicecollection.desktop
 M  +1    -1    src/core-impl/collections/mtpcollection/amarok_collection-mtpcollection.desktop
 M  +1    -1    src/core-impl/collections/nepomukcollection/amarok_collection-nepomukcollection.desktop
 M  +1    -1    src/core-impl/collections/playdarcollection/amarok_collection-playdarcollection.desktop
 M  +1    -6    src/core-impl/collections/support/CollectionManager.cpp
M  +1    -1    src/core-impl/collections/umscollection/amarok_collection-umscollection.desktop
 M  +1    -1    src/core-impl/collections/upnpcollection/amarok_collection-upnpcollection.desktop
 M  +10   -7    src/core-impl/storage/StorageManager.cpp
M  +3    -0    src/core-impl/storage/StorageManager.h
A  +6    -0    src/core-impl/storage/sql/CMakeLists.txt
C  +26   -21   src/core-impl/storage/sql/amarok_sqlstorage_export.h [from: \
src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h - 058% \
similarity] R  +0    -0    src/core-impl/storage/sql/mysql-shared/MySqlStorage.cpp \
[from: src/core-impl/collections/db/sql/mysql-shared/MySqlStorage.cpp - 100% \
similarity] R  +4    -4    src/core-impl/storage/sql/mysql-shared/MySqlStorage.h \
[from: src/core-impl/collections/db/sql/mysql-shared/MySqlStorage.h - 094% \
similarity] R  +9    -9    src/core-impl/storage/sql/mysqlestorage/CMakeLists.txt \
[from: src/core-impl/collections/db/sql/mysqlecollection/CMakeLists.txt - 055% \
similarity] R  +0    -0    \
src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.cpp [from: \
src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.cpp - 100% \
similarity] R  +5    -5    \
src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h [from: \
src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.h - 087% \
similarity] C  +20   -10   \
src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorageFactory.cpp [from: \
src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp - 065% similarity] \
C  +12   -11   src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorageFactory.h \
[from: src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h - 074% \
similarity] A  +27   -0    \
src/core-impl/storage/sql/mysqlestorage/amarok_storage-mysqlestorage.desktop R  +9    \
-9    src/core-impl/storage/sql/mysqlserverstorage/CMakeLists.txt [from: \
src/core-impl/collections/db/sql/mysqlservercollection/CMakeLists.txt - 053% \
similarity] A  +140  -0    \
src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorage.cpp     [License: GPL \
(v2+)] R  +12   -17   \
src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorage.h [from: \
src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.h - 070% \
similarity] C  +20   -10   \
src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorageFactory.cpp [from: \
src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp - 064% similarity] \
R  +12   -11   src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorageFactory.h \
[from: src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h - 073% \
similarity] A  +27   -0    \
src/core-impl/storage/sql/mysqlserverstorage/amarok_storage-mysqlserverstorage.desktop
 M  +5    -0    src/core/CMakeLists.txt
M  +0    -12   src/core/collections/Collection.h
D  +0    -70   src/core/collections/support/SqlStorage.h
R  +7    -12   src/core/storage/StorageFactory.cpp [from: \
src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp - 073% similarity] \
R  +31   -17   src/core/storage/StorageFactory.h [from: \
src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h - 055% \
similarity] M  +1    -1    src/importers/amarok/amarok_importer-amarok.desktop
M  +1    -1    src/importers/banshee/amarok_importer-banshee.desktop
M  +1    -1    src/importers/clementine/amarok_importer-clementine.desktop
M  +1    -1    src/importers/fastforward/amarok_importer-fastforward.desktop
M  +1    -1    src/importers/itunes/amarok_importer-itunes.desktop
M  +1    -1    src/importers/rhythmbox/amarok_importer-rhythmbox.desktop
M  +1    -1    src/services/amazon/amarok_service_amazonstore.desktop
M  +1    -1    src/services/ampache/amarok_service_ampache.desktop
M  +1    -1    src/services/gpodder/amarok_service_gpodder.desktop
M  +1    -1    src/services/jamendo/amarok_service_jamendo.desktop
M  +1    -1    src/services/lastfm/amarok_service_lastfm.desktop
M  +1    -1    src/services/magnatune/amarok_service_magnatunestore.desktop
M  +1    -1    src/services/mp3tunes/amarok_service_mp3tunes.desktop
M  +1    -1    src/services/opmldirectory/amarok_service_opmldirectory.desktop
M  +9    -4    tests/core-impl/collections/db/sql/CMakeLists.txt
M  +1    -1    tests/core-impl/collections/db/sql/TestDatabaseUpdater.cpp
M  +1    -1    tests/core-impl/collections/db/sql/TestSqlAlbum.cpp
M  +1    -1    tests/core-impl/collections/db/sql/TestSqlArtist.cpp
M  +1    -1    tests/core-impl/collections/db/sql/TestSqlCollection.cpp
M  +1    -1    tests/core-impl/collections/db/sql/TestSqlCollectionLocation.cpp
M  +1    -1    tests/core-impl/collections/db/sql/TestSqlQueryMaker.cpp
M  +1    -1    tests/core-impl/collections/db/sql/TestSqlScanManager.cpp
M  +1    -1    tests/core-impl/collections/db/sql/TestSqlTrack.cpp
M  +0    -13   tests/importers/TestImporterManager.cpp
M  +0    -2    tests/importers/TestImporterManager.h

http://commits.kde.org/amarok/a81d1b126d9efa85aa73bbf24a0f86e6597c8575

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5c5dbbb..7b7369f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -27,6 +27,7 @@ include_directories(
 
 add_subdirectory( core )
 add_subdirectory( core-impl/collections )
+add_subdirectory( core-impl/storage/sql )
 #don't use our own libplasma anymore, but still pick up our \
applets/engines/containments  add_subdirectory( context )
 add_subdirectory( services )
diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp
index 7d7e411..4f19047 100644
--- a/src/PluginManager.cpp
+++ b/src/PluginManager.cpp
@@ -37,7 +37,11 @@
 #include <QMetaEnum>
 
 
-const int Plugins::PluginManager::s_pluginFrameworkVersion = 71;
+/** Defines the used plugin version number.
+ *
+ *  This must match the desktop files.
+ */
+const int Plugins::PluginManager::s_pluginFrameworkVersion = 72;
 Plugins::PluginManager* Plugins::PluginManager::s_instance = 0;
 
 Plugins::PluginManager*
@@ -116,7 +120,9 @@ Plugins::PluginManager::checkPluginEnabledStates()
     foreach( const KPluginInfo &pluginInfo, m_pluginInfos )
     {
         Type type;
-        if( pluginInfo.category() == QLatin1String("Collection") )
+        if( pluginInfo.category() == QLatin1String("Storage") )
+            type = Storage;
+        else if( pluginInfo.category() == QLatin1String("Collection") )
             type = Collection;
         else if( pluginInfo.category() == QLatin1String("Service") )
             type = Service;
@@ -132,19 +138,8 @@ Plugins::PluginManager::checkPluginEnabledStates()
         PluginFactory *factory = createFactory( pluginInfo );
         if( factory )
         {
-            // the collection with the storage needs to go first.
-            QString pluginName = pluginInfo.pluginName();
-            if( pluginName == \
                QLatin1String("amarok_collection-mysqlservercollection") ||
-                pluginName == QLatin1String("amarok_collection-mysqlecollection") )
-            {
-                m_factoriesByType[ type ].prepend( factory );
-                allFactories.prepend( factory );
-            }
-            else
-            {
-                m_factoriesByType[ type ] << factory;
-                allFactories << factory;
-            }
+            m_factoriesByType[ type ] << factory;
+            allFactories << factory;
         }
     }
 
@@ -153,7 +148,7 @@ Plugins::PluginManager::checkPluginEnabledStates()
     // - handle the new list of factories, disabling old ones and enabling new ones.
 
     PERF_LOG( "Loading storage plugins" )
-    StorageManager::instance()->setFactories( m_factoriesByType.value( Collection ) \
); +    StorageManager::instance()->setFactories( m_factoriesByType.value( Storage ) \
);  PERF_LOG( "Loaded storage plugins" )
 
     PERF_LOG( "Loading collection plugins" )
@@ -175,6 +170,8 @@ Plugins::PluginManager::checkPluginEnabledStates()
     // have a chance to connect to signals
     //
     // we need to init by type and the storages need to go first
+    foreach( PluginFactory* factory, m_factoriesByType[ Storage ] )
+        factory->init();
     foreach( PluginFactory* factory, m_factoriesByType[ Collection ] )
         factory->init();
     foreach( PluginFactory* factory, m_factoriesByType[ Service ] )
@@ -189,18 +186,21 @@ Plugins::PluginManager::isPluginEnabled( const KPluginInfo \
&pluginInfo ) const  {
     const QString pluginName = pluginInfo.pluginName();
 
-    // the sql collection is a core collection. It cannot be switched off
-    // and needs to be first to be initialized since it's storage needs
-    // to be created before everything else
+    // The type of storage to be used it determined by the configuration
     const bool useMySqlServer = Amarok::config( "MySQL" ).readEntry( "UseServer", \
                false );
-    if( pluginName == QLatin1String("amarok_collection-mysqlservercollection") )
+    if( pluginName == QLatin1String("amarok_storage-mysqlserverstorage") )
     {
         return useMySqlServer;
     }
-    else if( pluginName == QLatin1String("amarok_collection-mysqlecollection") )
+    else if( pluginName == QLatin1String("amarok_storage-mysqlestorage") )
     {
         return !useMySqlServer;
     }
+    // we the default collection is always enabled
+    else if( pluginName == QLatin1String("amarok_collection-mysqlcollection") )
+    {
+        return true;
+    }
     else
     {
         bool enabledByDefault = pluginInfo.isPluginEnabledByDefault();
diff --git a/src/PluginManager.h b/src/PluginManager.h
index 63d36be..8ec84dc 100644
--- a/src/PluginManager.h
+++ b/src/PluginManager.h
@@ -39,7 +39,8 @@ class AMAROK_EXPORT PluginManager : public QObject
         {
             Collection = 1, ///< the plugin implements a CollectionFactory
             Service = 2,    ///< this is a service plugin
-            Importer = 3    ///< this plugin implements importer functionity
+            Importer = 3,   ///< this plugin implements importer functionity
+            Storage = 4     ///< the plugin implements a StorageFactory
         };
 
         ~PluginManager();
diff --git a/src/core-impl/collections/audiocd/amarok_collection-audiocdcollection.desktop \
b/src/core-impl/collections/audiocd/amarok_collection-audiocdcollection.desktop index \
                516179a..dcbfdaa 100644
--- a/src/core-impl/collections/audiocd/amarok_collection-audiocdcollection.desktop
+++ b/src/core-impl/collections/audiocd/amarok_collection-audiocdcollection.desktop
@@ -108,7 +108,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Nikolaj Hald Nielsen
 X-KDE-Amarok-email=nhnFreespirit@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=audiocd-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/collections/daap/amarok_collection-daapcollection.desktop \
b/src/core-impl/collections/daap/amarok_collection-daapcollection.desktop index \
                fc225aa..3615d77 100644
--- a/src/core-impl/collections/daap/amarok_collection-daapcollection.desktop
+++ b/src/core-impl/collections/daap/amarok_collection-daapcollection.desktop
@@ -120,7 +120,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Maximilian Kossick
 X-KDE-Amarok-email=maximilian.kossick@googlemail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=daap-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/collections/db/sql/CMakeLists.txt \
b/src/core-impl/collections/db/sql/CMakeLists.txt index a5b8b28..a4ec08d 100644
--- a/src/core-impl/collections/db/sql/CMakeLists.txt
+++ b/src/core-impl/collections/db/sql/CMakeLists.txt
@@ -43,9 +43,4 @@ endif(APPLE)
 set_target_properties(amarok-sqlcollection PROPERTIES VERSION 1.0.0 SOVERSION 1 )
 install(TARGETS amarok-sqlcollection ${INSTALL_TARGETS_DEFAULT_ARGS} )
 
-if( BUILD_MYSQLE_COLLECTION )
-    add_subdirectory( mysqlecollection )
-endif( BUILD_MYSQLE_COLLECTION )
-if( MYSQL_FOUND )
-    add_subdirectory( mysqlservercollection )
-endif( MYSQL_FOUND )
+add_subdirectory( mysqlcollection )
diff --git a/src/core-impl/collections/db/sql/mysqlcollection/CMakeLists.txt \
b/src/core-impl/collections/db/sql/mysqlcollection/CMakeLists.txt new file mode \
100644 index 0000000..244cde1
--- /dev/null
+++ b/src/core-impl/collections/db/sql/mysqlcollection/CMakeLists.txt
@@ -0,0 +1,39 @@
+
+########### mysql ###############
+
+set( amarok_collection-mysqlcollection_PART_SRCS
+    MySqlCollectionFactory.cpp
+    MySqlQueryMaker.cpp
+)
+
+kde4_add_plugin(amarok_collection-mysqlcollection \
${amarok_collection-mysqlcollection_PART_SRCS}) +
+STRING(REPLACE "-Wl,--fatal-warnings" "" CMAKE_SHARED_LINKER_FLAGS_NOFATALWARN \
"${CMAKE_SHARED_LINKER_FLAGS}") +SET(CMAKE_SHARED_LINKER_FLAGS \
${CMAKE_SHARED_LINKER_FLAGS_NOFATALWARN} ) +
+STRING(REPLACE "-Wl,--fatal-warnings" "" CMAKE_MODULE_LINKER_FLAGS_NOFATALWARN \
"${CMAKE_MODULE_LINKER_FLAGS}") +SET(CMAKE_MODULE_LINKER_FLAGS \
${CMAKE_MODULE_LINKER_FLAGS_NOFATALWARN} ) +
+target_link_libraries(amarok_collection-mysqlcollection
+    amarok-sqlcollection
+    amarokcore
+    amaroklib
+    ${KDE4_KDECORE_LIBS}
+    ${QT_QTCORE_LIBRARY}
+    ${QT_QTGUI_LIBRARY}
+    ${MYSQL_EMBEDDED_LIBRARIES}
+    ${CMAKE_DL_LIBS}
+    ${ZLIB_LIBRARIES}
+)
+
+if(NOT WIN32 AND NOT APPLE)
+    target_link_libraries( amarok_collection-mysqlcollection crypt pthread )
+endif(NOT WIN32 AND NOT APPLE)
+
+if(APPLE)
+	SET_TARGET_PROPERTIES(amarok_collection-mysqlcollection PROPERTIES LINK_FLAGS \
"-undefined dynamic_lookup") +endif(APPLE)
+
+install(TARGETS amarok_collection-mysqlcollection DESTINATION ${PLUGIN_INSTALL_DIR} \
) +
+install(FILES amarok_collection-mysqlcollection.desktop DESTINATION \
                ${SERVICES_INSTALL_DIR})
diff --git a/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.cpp \
b/src/core-impl/collections/db/sql/mysqlcollection/MySqlCollectionFactory.cpp \
similarity index 84% rename from \
src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.cpp rename \
to src/core-impl/collections/db/sql/mysqlcollection/MySqlCollectionFactory.cpp index \
                86cbb90..e0e902c 100644
--- a/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.cpp
+++ b/src/core-impl/collections/db/sql/mysqlcollection/MySqlCollectionFactory.cpp
@@ -15,9 +15,9 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#include "MySqlEmbeddedCollection.h"
+#include "MySqlCollectionFactory.h"
 
-#include <core-impl/storage/MySqlEmbeddedStorage.h>
+#include <core-impl/storage/StorageManager.h>
 #include <core-impl/collections/db/sql/SqlCollection.h>
 #include <core-impl/collections/db/sql/SqlCollectionFactory.h>
 
@@ -25,21 +25,20 @@
 
 using namespace Collections;
 
-AMAROK_EXPORT_COLLECTION( MySqlEmbeddedCollectionFactory, mysqlecollection )
+AMAROK_EXPORT_COLLECTION( MySqlCollectionFactory, mysqlcollection )
 
 void
-MySqlEmbeddedCollectionFactory::init()
+MySqlCollectionFactory::init()
 {
     if( m_initialized )
         return;
 
     SqlCollectionFactory fac;
-    SqlStorage *storage = new MySqlEmbeddedStorage();
+    SqlStorage *storage = StorageManager::instance()->sqlStorage();
     SqlCollection *collection = fac.createSqlCollection( storage );
     m_initialized = true;
 
-    emit newStorage( storage );
     emit newCollection( collection );
 }
 
-#include "MySqlEmbeddedCollection.moc"
+#include "MySqlCollectionFactory.moc"
diff --git a/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h \
b/src/core-impl/collections/db/sql/mysqlcollection/MySqlCollectionFactory.h \
similarity index 80% copy from \
src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h copy \
to src/core-impl/collections/db/sql/mysqlcollection/MySqlCollectionFactory.h index \
                baedfe8..e97438b 100644
--- a/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h
+++ b/src/core-impl/collections/db/sql/mysqlcollection/MySqlCollectionFactory.h
@@ -15,24 +15,24 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#ifndef AMAROK_COLLECTION_MYSQLSERVERCOLLECTION_H
-#define AMAROK_COLLECTION_MYSQLSERVERCOLLECTION_H
+#ifndef AMAROK_COLLECTION_MYSQLCOLLECTION_FACTORY_H
+#define AMAROK_COLLECTION_MYSQLCOLLECTION_FACTORY_H
 
 #include "core/collections/Collection.h"
 
 namespace Collections {
 
-class MySqlServerCollectionFactory : public Collections::CollectionFactory
+class MySqlCollectionFactory : public Collections::CollectionFactory
 {
     Q_OBJECT
 
     public:
-        MySqlServerCollectionFactory( QObject *parent, const QVariantList &args )
+        MySqlCollectionFactory( QObject *parent, const QVariantList &args )
             : Collections::CollectionFactory( parent, args )
         {
-            m_info = KPluginInfo( "amarok_collection-mysqlservercollection.desktop", \
"services" ); +            m_info = KPluginInfo( \
"amarok_collection-mysqlcollection.desktop", "services" );  }
-        virtual ~MySqlServerCollectionFactory() {}
+        virtual ~MySqlCollectionFactory() {}
 
         virtual void init();
 };
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp \
b/src/core-impl/collections/db/sql/mysqlcollection/MySqlQueryMaker.cpp similarity \
index 89% copy from src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp
copy to src/core-impl/collections/db/sql/mysqlcollection/MySqlQueryMaker.cpp
index c8f47a1..d01bd59 100644
--- a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp
+++ b/src/core-impl/collections/db/sql/mysqlcollection/MySqlQueryMaker.cpp
@@ -16,19 +16,19 @@
 
 #include "MySqlQueryMaker.h"
 
-MySqlQueryMaker::MySqlQueryMaker( MySqlCollection *collection )
+Collections::MySqlQueryMaker::MySqlQueryMaker( SqlCollection *collection )
     : SqlQueryMaker( collection )
 {
     //nothing to do
 }
 
-MySqlQueryMaker::~MySqlQueryMaker()
+Collections::MySqlQueryMaker::~MySqlQueryMaker()
 {
     //nothing to do
 }
 
 QString
-MySqlQueryMaker::escape( QString text ) const               //krazy:exclude=constref
+Collections::MySqlQueryMaker::escape( QString text ) const // krazy:exclude=constref
 {
     return text.replace("\\", "\\\\").replace( '\'', "''" );
 }
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h \
b/src/core-impl/collections/db/sql/mysqlcollection/MySqlQueryMaker.h similarity index \
91% copy from src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h
copy to src/core-impl/collections/db/sql/mysqlcollection/MySqlQueryMaker.h
index 360ba94..a30df13 100644
--- a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h
+++ b/src/core-impl/collections/db/sql/mysqlcollection/MySqlQueryMaker.h
@@ -13,21 +13,26 @@
  * You should have received a copy of the GNU General Public License along with      \
                *
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
                
- 
+
 #ifndef AMAROK_COLLECTION_MYSQLQUERYMAKER_H
 #define AMAROK_COLLECTION_MYSQLQUERYMAKER_H
 
-#include "MySqlCollection.h"
-#include "SqlQueryMaker.h"
+#include "../SqlCollection.h"
+#include "../SqlQueryMaker.h"
+
+namespace Collections
+{
 
 class MySqlQueryMaker : public SqlQueryMaker
 {
     public:
-        MySqlQueryMaker( MySqlCollection* collection );
+        MySqlQueryMaker( SqlCollection* collection );
         virtual ~MySqlQueryMaker();
 
     protected:
         virtual QString escape( QString text ) const;
 };
 
+}
+
 #endif
diff --git a/src/core-impl/collections/db/sql/mysqlecollection/amarok_collection-mysqlecollection.desktop \
b/src/core-impl/collections/db/sql/mysqlcollection/amarok_collection-mysqlcollection.desktop
 similarity index 73%
rename from src/core-impl/collections/db/sql/mysqlecollection/amarok_collection-mysqlecollection.desktop
 rename to src/core-impl/collections/db/sql/mysqlcollection/amarok_collection-mysqlcollection.desktop
 index a3984f2..dc8fe5c 100644
--- a/src/core-impl/collections/db/sql/mysqlecollection/amarok_collection-mysqlecollection.desktop
                
+++ b/src/core-impl/collections/db/sql/mysqlcollection/amarok_collection-mysqlcollection.desktop
 @@ -1,56 +1,56 @@
 [Desktop Entry]
 Type=Service
 Icon=server-database
-Name=MySQLe Collection
-Name[bg]=Колекция MySQLe
-Name[bs]=MySQLe Zbirka
-Name[ca]=Col lecció MySQLe
-Name[ca@valencia]=Col lecció MySQLe
-Name[cs]=Sbírka MySQLe
+Name=MySQL Collection
+Name[bg]=Колекция MySQL
+Name[bs]=MySQL Zbirka
+Name[ca]=Col lecció MySQL
+Name[ca@valencia]=Col lecció MySQL
+Name[cs]=Sbírka MySQL
 Name[csb]=Kòlekcëjô MySQL
-Name[da]=MySQLe-samling
-Name[de]=MySQLe-Sammlung
-Name[el]=Συλλογή MySQLe
-Name[en_GB]=MySQLe Collection
-Name[es]=Colección MySQLe
-Name[et]=MySQLe kogu
+Name[da]=MySQL-samling
+Name[de]=MySQL-Sammlung
+Name[el]=Συλλογή MySQL
+Name[en_GB]=MySQL Collection
+Name[es]=Colección MySQL
+Name[et]=MySQL kogu
 Name[eu]=MySQL bilduma
-Name[fi]=MySQLe-kokoelma
+Name[fi]=MySQL-kokoelma
 Name[fr]=Collection MySQL
-Name[ga]=Bailiúchán MySQLe
-Name[gl]=Colección MySQLe
-Name[hu]=MySQLe-gyűjtemény
-Name[id]=Koleksi MySQLe
-Name[is]=MySQLe safn
-Name[it]=Collezione MySQLe
-Name[ja]=MySQLe コレクション
+Name[ga]=Bailiúchán MySQL
+Name[gl]=Colección MySQL
+Name[hu]=MySQL-gyűjtemény
+Name[id]=Koleksi MySQL
+Name[is]=MySQL safn
+Name[it]=Collezione MySQL
+Name[ja]=MySQL コレクション
 Name[km]=សម្រាំង MySQLe
-Name[ko]=MySQLe 모음집
-Name[lt]=MySQLe fonoteka
-Name[lv]=MySQLe kolekcija
-Name[nb]=MySQLe-samling
-Name[nds]=MySQLe-Sammeln
+Name[ko]=MySQL 모음집
+Name[lt]=MySQL fonoteka
+Name[lv]=MySQL kolekcija
+Name[nb]=MySQL-samling
+Name[nds]=MySQL-Sammeln
 Name[nl]=MySQL-verzameling
-Name[nn]=MySQLe-samling
-Name[pa]=MySQLe ਭੰਡਾਰ
-Name[pl]=Kolekcja MySQLe
-Name[pt]=Colecção de MySQLe
-Name[pt_BR]=Coleção MySQLe
-Name[ro]=Colecție MySQLe
-Name[ru]=Коллекция MySQLe
-Name[sk]=MySQLe kolekcia
-Name[sl]=Zbirka MySQLe
+Name[nn]=MySQL-samling
+Name[pa]=MySQL ਭੰਡਾਰ
+Name[pl]=Kolekcja MySQL
+Name[pt]=Colecção de MySQL
+Name[pt_BR]=Coleção MySQL
+Name[ro]=Colecție MySQL
+Name[ru]=Коллекция MySQL
+Name[sk]=MySQL kolekcia
+Name[sl]=Zbirka MySQL
 Name[sr]=Збирка на МајСКуЛe‑у
 Name[sr@ijekavian]=Збирка на МајСКуЛe‑у
-Name[sr@ijekavianlatin]=Zbirka na MySQLe‑u
-Name[sr@latin]=Zbirka na MySQLe‑u
+Name[sr@ijekavianlatin]=Zbirka na MySQL‑u
+Name[sr@latin]=Zbirka na MySQL‑u
 Name[sv]=MySQL-samling
-Name[th]=คลังสื่อแบบ MySQLe
-Name[tr]=MySQLe Koleksiyonu
-Name[uk]=Збірка MySQLe
-Name[x-test]=xxMySQLe Collectionxx
-Name[zh_CN]=MySQLe 收藏
-Name[zh_TW]=MySQLe 收藏
+Name[th]=คลังสื่อแบบ MySQL
+Name[tr]=MySQL Koleksiyonu
+Name[uk]=Збірка MySQL
+Name[x-test]=xxMySQL Collectionxx
+Name[zh_CN]=MySQL 收藏
+Name[zh_TW]=MySQL 收藏
 Comment=Collection plugin for Amarok
 Comment[be]=Утулка калекцыі для Amarok
 Comment[bg]=Приставка за колекция (Amarok)
@@ -114,8 +114,8 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Maximilian Kossick
 X-KDE-Amarok-email=maximilian.kossick@googlemail.com
-X-KDE-Amarok-framework-version=71
-X-KDE-Amarok-name=mysqle-collection
+X-KDE-Amarok-framework-version=72
+X-KDE-Amarok-name=mysql-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
 X-KDE-Amarok-version=1
@@ -126,5 +126,5 @@ X-KDE-PluginInfo-Version=1.0
 X-KDE-PluginInfo-Category=Collection
 X-KDE-PluginInfo-License=GPL
 X-KDE-PluginInfo-EnabledByDefault=true
-X-KDE-PluginInfo-Name=amarok_collection-mysqlecollection
-X-KDE-Library=amarok_collection-mysqlecollection
+X-KDE-PluginInfo-Name=amarok_collection-mysqlcollection
+X-KDE-Library=amarok_collection-mysqlcollection
diff --git a/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.cpp \
b/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.cpp \
deleted file mode 100644 index e168ce3..0000000
--- a/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.cpp
                
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************************
                
- * Copyright (c) 2008 Edward Toroshchin <edward.hades@gmail.com>                     \
                *
- * Copyright (c) 2009 Jeff Mitchell <mitchell@kde.org>                               \
                *
- * Copyright (c) 2012 Lachlan Dufton <dufton@gmail.com>                              \
                *
- *                                                                                   \
                *
- * This program is free software; you can redistribute it and/or modify it under     \
                *
- * the terms of the GNU General Public License as published by the Free Software     \
                *
- * Foundation; either version 2 of the License, or (at your option) any later        \
                *
- * version.                                                                          \
                *
- *                                                                                   \
                *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY   \
                *
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A   \
                *
- * PARTICULAR PURPOSE. See the GNU General Public License for more details.          \
                *
- *                                                                                   \
                *
- * You should have received a copy of the GNU General Public License along with      \
                *
- * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
- ****************************************************************************************/
                
-
-#include "MySqlServerCollection.h"
-#include "MySqlServerStorage.h"
-
-#include "amarokconfig.h"
-#include "core/support/Amarok.h"
-#include "core/support/Debug.h"
-#include "core-impl/collections/db/sql/SqlCollection.h"
-#include "core-impl/collections/db/sql/SqlCollectionFactory.h"
-
-using namespace Collections;
-
-AMAROK_EXPORT_COLLECTION( MySqlServerCollectionFactory, mysqlservercollection )
-
-void
-MySqlServerCollectionFactory::init()
-{
-    if( m_initialized )
-        return;
-
-    SqlCollectionFactory fac;
-    SqlStorage *storage = new MySqlServerStorage();
-    SqlCollection *collection = fac.createSqlCollection( storage );
-    m_initialized = true;
-
-    emit newStorage( storage );
-    emit newCollection( collection );
-}
-
-#include "MySqlServerCollection.moc"
-
diff --git a/src/core-impl/collections/db/sql/mysqlservercollection/amarok_collection-mysqlservercollection.desktop \
b/src/core-impl/collections/db/sql/mysqlservercollection/amarok_collection-mysqlservercollection.desktop
 deleted file mode 100644
index 57ae2d4..0000000
--- a/src/core-impl/collections/db/sql/mysqlservercollection/amarok_collection-mysqlservercollection.desktop
                
+++ /dev/null
@@ -1,130 +0,0 @@
-[Desktop Entry]
-Type=Service
-Icon=network-server-database
-Name=MySQLServer Collection
-Name[bg]=Колекция MySQLServer
-Name[bs]=Zbirka na serveru MySQL
-Name[ca]=Col lecció MySQLServer
-Name[ca@valencia]=Col lecció MySQLServer
-Name[cs]=Sbírka MySQLServer
-Name[csb]=Kòlekcëjô serwera MySQL
-Name[da]=MySQLServer-samling
-Name[de]=MySQLServer-Sammlung
-Name[el]=Συλλογή MySQLServer
-Name[en_GB]=MySQLServer Collection
-Name[es]=Colección MySQLServer
-Name[et]=MySQLServeri kogu
-Name[eu]=MySQLServer bilduma
-Name[fi]=MySQLServer-kokoelma
-Name[fr]=Collection MySQLServeur
-Name[ga]=Bailiúchán MySQLServer
-Name[gl]=Colección MySQLServer
-Name[hu]=MySQLServer-gyűjtemény
-Name[id]=Koleksi MySQLServer
-Name[is]=MySQL safn
-Name[it]=Collezione MySQLServer
-Name[ja]=MySQLServer コレクション
-Name[km]=សម្រាំង MySQLServer
-Name[ko]=MySQL 서버 모음집
-Name[lt]=MySQLServer fonoteka
-Name[lv]=MySQLServer kolekcija
-Name[nb]=MySQLServer-samling
-Name[nds]=MySQLServer-Sammeln
-Name[nl]=MySQL-serververzameling
-Name[nn]=MySQLServer-samling
-Name[pa]=MySQLServer ਭੰਡਾਰ
-Name[pl]=Kolekcja MySQLServer
-Name[pt]=Colecção de MySQL (Servidor)
-Name[pt_BR]=Coleção MySQLServer
-Name[ro]=Colecție MySQLServer
-Name[ru]=Коллекция MySQLServer
-Name[sk]=Kolekcia MySQLServer
-Name[sl]=Zbirka MySQLServer
-Name[sr]=Збирка на серверу МајСКуЛ‑а
-Name[sr@ijekavian]=Збирка на серверу МајСКуЛ‑а
-Name[sr@ijekavianlatin]=Zbirka na serveru MySQL‑a
-Name[sr@latin]=Zbirka na serveru MySQL‑a
-Name[sv]=MySQLServer-samling
-Name[th]=คลังสื่อแบบ MySQLServer
-Name[tr]=MySQL Sunucu Koleksiyonu
-Name[uk]=Збірка MySQLServer
-Name[x-test]=xxMySQLServer Collectionxx
-Name[zh_CN]=MySQLServer 收藏
-Name[zh_TW]=MySQLServer 收藏
-Comment=Collection plugin for Amarok
-Comment[be]=Утулка калекцыі для Amarok
-Comment[bg]=Приставка за колекция (Amarok)
-Comment[bs]=Priključak zbirke za Amarok
-Comment[ca]=Connector de col leccions per a l'Amarok
-Comment[ca@valencia]=Connector de col leccions per a l'Amarok
-Comment[cs]=Modul sbírky pro Amarok
-Comment[csb]=Wtëkôcz kòlekcëji dlô Amaroka
-Comment[da]=Samlings-plugin til Amarok
-Comment[de]=Sammlungsmodul für Amarok
-Comment[el]= ρόσθετο συλλογής για το AmaroK
-Comment[en_GB]=Collection plugin for Amarok
-Comment[eo]=Kolekta kromaĵo por Amarok
-Comment[es]=Complemento de colección para Amarok
-Comment[et]=Amaroki muusikakogu plugin
-Comment[eu]=Bildumen plugina Amarok-entzako
-Comment[fi]=Amarokin kokoelmaliitännäinen
-Comment[fr]=Module externe de collections pour Amarok
-Comment[ga]=Breiseán bailiúchán le haghaidh Amarok
-Comment[gl]=Extensión de colección para Amarok
-Comment[he]=תוסף אוסף ל־Amarok
-Comment[hne]=अमाराक बर संग्रह प्लगइन
-Comment[hu]=Gyűjtemény-bővítőmodul az Amarokhoz
-Comment[id]=Koleksi plugin untuk Amarok
-Comment[is]=Safníforrit fyrir Amarok
-Comment[it]=Estensione della collezione di Amarok
-Comment[ja]=Amarok のためのコレクションプラグイン
-Comment[km]=កម្មវិធី​ជំនួយ​សម្រាំង​សម្រាប់​ \
                Amarok
-Comment[ko]=Amarok의 모음집 플러그인
-Comment[ku]=Pêveka berhevokê ji bo Amarok
-Comment[lt]=Fonotekos Amarok papildinys
-Comment[lv]=Kolekciju Amarok spraudnis
-Comment[nb]=SQL-samling – programtillegg for Amarok
-Comment[nds]=Sammelnmoduul för Amarok
-Comment[ne]=अमारोकका लागि सङ्कलन \
                प्लगइन
-Comment[nl]=Collectie-plugin voor Amarok
-Comment[nn]=Amarok-samlingstillegg
-Comment[pa]=ਅਮਰੋਕ ਲਈ ਭੰਡਾਰ ਪਲੱਗਇਨ
-Comment[pl]=Wtyczka kolekcji dla Amaroka
-Comment[pt]=Um 'plugin' da colecção para o Amarok
-Comment[pt_BR]=Plugin de coleção para o Amarok
-Comment[ro]=Modul de colecție pentru Amarok
-Comment[ru]=Модуль коллекции для Amarok
-Comment[sk]=Modul kolekcia pre Amarok
-Comment[sl]=Vstavek za zbirko za Amarok
-Comment[sr]=Прикључак збирке за Амарок
-Comment[sr@ijekavian]=Прикључак збирке за Амарок
-Comment[sr@ijekavianlatin]=Priključak zbirke za Amarok
-Comment[sr@latin]=Priključak zbirke za Amarok
-Comment[sv]=Samlingsinsticksprogram för Amarok
-Comment[th]=ส่วนเสริมของแอมอะร็อก \
                สำหรับจัดการคลังสื่อ
-Comment[tr]=Amarok için Koleksiyon eklentisi
-Comment[uk]=Додаток збірки для Amarok
-Comment[wa]=Tchôke-divins di ramexhnêye pos Amarok
-Comment[x-test]=xxCollection plugin for Amarokxx
-Comment[zh_CN]=Amarok 的收藏插件
-Comment[zh_TW]=Amarok 的收藏外掛程式
-NoDisplay=true
-
-ServiceTypes=Amarok/Plugin
-
-X-KDE-Amarok-authors=Jeff Mitchell
-X-KDE-Amarok-email=mitchell@kde.org
-X-KDE-Amarok-framework-version=71
-X-KDE-Amarok-name=mysqlserver-collection
-X-KDE-Amarok-plugintype=collection
-X-KDE-Amarok-rank=100
-X-KDE-Amarok-version=1
-
-X-KDE-PluginInfo-Author=Jeff Mitchell
-X-KDE-PluginInfo-Email=mitchell@kde.org
-X-KDE-PluginInfo-Version=1.0
-X-KDE-PluginInfo-Category=Collection
-X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=true
-X-KDE-PluginInfo-Name=amarok_collection-mysqlservercollection
-X-KDE-Library=amarok_collection-mysqlservercollection
diff --git a/src/core-impl/collections/ipodcollection/amarok_collection-ipodcollection.desktop \
b/src/core-impl/collections/ipodcollection/amarok_collection-ipodcollection.desktop \
                index d1ed01d..2994376 100644
--- a/src/core-impl/collections/ipodcollection/amarok_collection-ipodcollection.desktop
                
+++ b/src/core-impl/collections/ipodcollection/amarok_collection-ipodcollection.desktop
 @@ -87,7 +87,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Matěj Laitl
 X-KDE-Amarok-email=matej@laitl.cz
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=ipod-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/collections/mediadevicecollection/amarok_collection-mediadevicecollection.desktop \
b/src/core-impl/collections/mediadevicecollection/amarok_collection-mediadevicecollection.desktop
 index a043635..6a224cc 100644
--- a/src/core-impl/collections/mediadevicecollection/amarok_collection-mediadevicecollection.desktop
                
+++ b/src/core-impl/collections/mediadevicecollection/amarok_collection-mediadevicecollection.desktop
 @@ -116,7 +116,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Alejandro Wainzinger
 X-KDE-Amarok-email=aikawarazuni@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=mediadevice-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/collections/mtpcollection/amarok_collection-mtpcollection.desktop \
b/src/core-impl/collections/mtpcollection/amarok_collection-mtpcollection.desktop \
                index 00caa42..2dd282e 100644
--- a/src/core-impl/collections/mtpcollection/amarok_collection-mtpcollection.desktop
+++ b/src/core-impl/collections/mtpcollection/amarok_collection-mtpcollection.desktop
@@ -116,7 +116,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Alejandro Wainzinger
 X-KDE-Amarok-email=aikawarazuni@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=mtp-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/collections/nepomukcollection/amarok_collection-nepomukcollection.desktop \
b/src/core-impl/collections/nepomukcollection/amarok_collection-nepomukcollection.desktop
 index 0852630..9ea9047 100644
--- a/src/core-impl/collections/nepomukcollection/amarok_collection-nepomukcollection.desktop
                
+++ b/src/core-impl/collections/nepomukcollection/amarok_collection-nepomukcollection.desktop
 @@ -70,7 +70,7 @@ X-KDE-PluginInfo-Name=amarok_collection-nepomukcollection
 X-KDE-Library=amarok_collection-nepomukcollection
 X-KDE-Amarok-authors=Phalgun Guduthur
 X-KDE-Amarok-email=me@phalgun.in
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=nepomuk-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/collections/playdarcollection/amarok_collection-playdarcollection.desktop \
b/src/core-impl/collections/playdarcollection/amarok_collection-playdarcollection.desktop
 index c278669..a0362f7 100644
--- a/src/core-impl/collections/playdarcollection/amarok_collection-playdarcollection.desktop
                
+++ b/src/core-impl/collections/playdarcollection/amarok_collection-playdarcollection.desktop
 @@ -94,7 +94,7 @@ ServiceTypes=Amarok/Plugin-disabled
 
 X-KDE-Amarok-authors=Andrew Coder
 X-KDE-Amarok-email=andrew.coder@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=playdar-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/collections/support/CollectionManager.cpp \
b/src/core-impl/collections/support/CollectionManager.cpp index 61c5675..a3d90ff \
                100644
--- a/src/core-impl/collections/support/CollectionManager.cpp
+++ b/src/core-impl/collections/support/CollectionManager.cpp
@@ -166,12 +166,7 @@ CollectionManager::setFactories( const \
QList<Plugins::PluginFactory*> &factories  
         // the sql collection is a core collection. It cannot be switched off
         // and should be first.
-        bool primaryCollection = false;
-        if( (useMySqlServer && (pluginName == \
                QLatin1String("amarok_collection-mysqlservercollection"))) ||
-            (!useMySqlServer && (pluginName == \
                QLatin1String("amarok_collection-mysqlecollection"))) )
-        {
-            primaryCollection = true;
-        }
+        bool primaryCollection = ( pluginName == \
QLatin1String("amarok_collection-mysqlcollection") );  
         connect( factory, SIGNAL(newCollection(Collections::Collection*)),
                  this, SLOT(slotNewCollection(Collections::Collection*)) );
diff --git a/src/core-impl/collections/umscollection/amarok_collection-umscollection.desktop \
b/src/core-impl/collections/umscollection/amarok_collection-umscollection.desktop \
                index fc3bbf5..9155e50 100644
--- a/src/core-impl/collections/umscollection/amarok_collection-umscollection.desktop
+++ b/src/core-impl/collections/umscollection/amarok_collection-umscollection.desktop
@@ -55,7 +55,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Alejandro Wainzinger
 X-KDE-Amarok-email=aikawarazuni@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=ums-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/collections/upnpcollection/amarok_collection-upnpcollection.desktop \
b/src/core-impl/collections/upnpcollection/amarok_collection-upnpcollection.desktop \
                index c5c58b0..22e202c 100644
--- a/src/core-impl/collections/upnpcollection/amarok_collection-upnpcollection.desktop
                
+++ b/src/core-impl/collections/upnpcollection/amarok_collection-upnpcollection.desktop
 @@ -116,7 +116,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Nikhil Marathe
 X-KDE-Amarok-email=nsm.nikhil@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=upnp-collection
 X-KDE-Amarok-plugintype=collection
 X-KDE-Amarok-rank=100
diff --git a/src/core-impl/storage/StorageManager.cpp \
b/src/core-impl/storage/StorageManager.cpp index 317d447..3e485f5 100644
--- a/src/core-impl/storage/StorageManager.cpp
+++ b/src/core-impl/storage/StorageManager.cpp
@@ -19,7 +19,7 @@
 #include "StorageManager.h"
 
 #include <core/storage/SqlStorage.h>
-#include <core/collections/Collection.h>
+#include <core/storage/StorageFactory.h>
 
 #include <core/support/Amarok.h>
 #include <core/support/Debug.h>
@@ -114,7 +114,8 @@ StorageManager::~StorageManager()
 {
     DEBUG_BLOCK
 
-    delete d->sqlDatabase;
+    if( d->sqlDatabase != &emptyStorage )
+        delete d->sqlDatabase;
     delete d;
 }
 
@@ -133,11 +134,9 @@ StorageManager::init()
 void
 StorageManager::setFactories( const QList<Plugins::PluginFactory*> &factories )
 {
-    using Collections::CollectionFactory;
-
     foreach( Plugins::PluginFactory* pFactory, factories )
     {
-        CollectionFactory *factory = qobject_cast<CollectionFactory*>( pFactory );
+        StorageFactory *factory = qobject_cast<StorageFactory*>( pFactory );
         if( !factory )
             continue;
 
@@ -153,14 +152,18 @@ StorageManager::slotNewStorage( SqlStorage* newStorage )
 
     if( !newStorage )
     {
-        debug() << "Warning, newStorage in slotNewStorage is 0";
+        warning() << "Warning, newStorage in slotNewStorage is 0";
         return;
     }
 
-    if( d->sqlDatabase )
+    if( d->sqlDatabase && d->sqlDatabase != &emptyStorage )
+    {
+        warning() << "Warning, newStorage when we already have a storage";
+        delete newStorage;
         return; // once we have the database set we can't change it since
         // plugins might have already created their tables in the old database
         // or caching data from it.
+    }
 
     d->sqlDatabase = newStorage;
 }
diff --git a/src/core-impl/storage/StorageManager.h \
b/src/core-impl/storage/StorageManager.h index 4d5fa34..6fa5a86 100644
--- a/src/core-impl/storage/StorageManager.h
+++ b/src/core-impl/storage/StorageManager.h
@@ -79,6 +79,9 @@ class AMAROK_EXPORT StorageManager : public QObject
          *
          *  The first factory to emit this signal will get it's storage
          *  registered as "the" storage.
+         *
+         *  StorageManager will take ownership of the pointer and free it
+         *  after all other plugins are done.
          */
         void slotNewStorage( SqlStorage* newStorage );
 
diff --git a/src/core-impl/storage/sql/CMakeLists.txt \
b/src/core-impl/storage/sql/CMakeLists.txt new file mode 100644
index 0000000..1e9008f
--- /dev/null
+++ b/src/core-impl/storage/sql/CMakeLists.txt
@@ -0,0 +1,6 @@
+if( BUILD_MYSQLE_COLLECTION )
+    add_subdirectory( mysqlestorage )
+endif( BUILD_MYSQLE_COLLECTION )
+if( MYSQL_FOUND )
+    add_subdirectory( mysqlserverstorage )
+endif( MYSQL_FOUND )
diff --git a/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h \
b/src/core-impl/storage/sql/amarok_sqlstorage_export.h similarity index 58%
copy from src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h
 copy to src/core-impl/storage/sql/amarok_sqlstorage_export.h
index baedfe8..c217126 100644
--- a/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h
+++ b/src/core-impl/storage/sql/amarok_sqlstorage_export.h
@@ -1,6 +1,5 @@
 /****************************************************************************************
                
- * Copyright (c) 2008 Edward Toroshchin <edward.hades@gmail.com>                     \
                *
- * Copyright (c) 2009 Jeff Mitchell <mitchell@kde.org>                               \
* + * Copyright (c) 2007 David Faure <faure@kde.org>                                  \
                *
  *                                                                                   \
                *
  * This program is free software; you can redistribute it and/or modify it under     \
                *
  * the terms of the GNU General Public License as published by the Free Software     \
* @@ -15,28 +14,34 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#ifndef AMAROK_COLLECTION_MYSQLSERVERCOLLECTION_H
-#define AMAROK_COLLECTION_MYSQLSERVERCOLLECTION_H
+#ifndef AMAROK_SQLSTORAGE_EXPORT_H
+#define AMAROK_SQLSTORAGE_EXPORT_H
 
-#include "core/collections/Collection.h"
+/* needed for KDE_EXPORT and KDE_IMPORT macros */
+#include <kdemacros.h>
 
-namespace Collections {
-
-class MySqlServerCollectionFactory : public Collections::CollectionFactory
-{
-    Q_OBJECT
-
-    public:
-        MySqlServerCollectionFactory( QObject *parent, const QVariantList &args )
-            : Collections::CollectionFactory( parent, args )
-        {
-            m_info = KPluginInfo( "amarok_collection-mysqlservercollection.desktop", \
                "services" );
-        }
-        virtual ~MySqlServerCollectionFactory() {}
+#ifndef AMAROK_SQLSTORAGE_EXPORT
+# if defined(MAKE_AMAROK_SQLSTORAGE_LIB)
+   /* We are building this library */
+#   define AMAROK_SQLSTORAGE_EXPORT KDE_EXPORT
+# else
+   /* We are using this library */
+#   define AMAROK_SQLSTORAGE_EXPORT KDE_IMPORT
+# endif
+#endif
 
-        virtual void init();
-};
+#ifndef AMAROK_SQLSTORAGE_MYSQLE_EXPORT
+# if defined(MAKE_AMAROK_STORAGE_MYSQLESTORAGE_LIB)
+   /* We are building this library */
+#   define AMAROK_SQLSTORAGE_MYSQLE_EXPORT KDE_EXPORT
+# else
+   /* We are using this library */
+#   define AMAROK_SQLSTORAGE_MYSQLE_EXPORT KDE_IMPORT
+# endif
+#endif
 
-} //namespace Collections
+# ifndef AMAROK_SQLSTORAGE_EXPORT_DEPRECATED
+#  define AMAROK_SQLSTORAGE_EXPORT_DEPRECATED KDE_DEPRECATED \
AMAROK_SQLSTORAGE_EXPORT +# endif
 
 #endif
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlStorage.cpp \
b/src/core-impl/storage/sql/mysql-shared/MySqlStorage.cpp similarity index 100%
rename from src/core-impl/collections/db/sql/mysql-shared/MySqlStorage.cpp
rename to src/core-impl/storage/sql/mysql-shared/MySqlStorage.cpp
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlStorage.h \
b/src/core-impl/storage/sql/mysql-shared/MySqlStorage.h similarity index 94%
rename from src/core-impl/collections/db/sql/mysql-shared/MySqlStorage.h
rename to src/core-impl/storage/sql/mysql-shared/MySqlStorage.h
index c0a6ade..1a6e798 100644
--- a/src/core-impl/collections/db/sql/mysql-shared/MySqlStorage.h
+++ b/src/core-impl/storage/sql/mysql-shared/MySqlStorage.h
@@ -15,10 +15,10 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#ifndef AMAROK_COLLECTION_MYSQLSTORAGE_H
-#define AMAROK_COLLECTION_MYSQLSTORAGE_H
+#ifndef AMAROK_STORAGE_MYSQLSTORAGE_H
+#define AMAROK_STORAGE_MYSQLSTORAGE_H
 
-#include "core/collections/support/SqlStorage.h"
+#include "core/storage/SqlStorage.h"
 
 
 #include <QMutex>
@@ -32,7 +32,7 @@ struct st_mysql;
 typedef struct st_mysql MYSQL;
 
 /**
- * Implements a SqlCollection using a MySQL backend
+ * Implements a SqlStorage using a MySQL backend
  */
 class MySqlStorage: public SqlStorage
 {
diff --git a/src/core-impl/collections/db/sql/mysqlecollection/CMakeLists.txt \
b/src/core-impl/storage/sql/mysqlestorage/CMakeLists.txt similarity index 55%
rename from src/core-impl/collections/db/sql/mysqlecollection/CMakeLists.txt
rename to src/core-impl/storage/sql/mysqlestorage/CMakeLists.txt
index e000d50..1b9e064 100644
--- a/src/core-impl/collections/db/sql/mysqlecollection/CMakeLists.txt
+++ b/src/core-impl/storage/sql/mysqlestorage/CMakeLists.txt
@@ -2,13 +2,13 @@ add_definitions(${MYSQL_EMBEDDED_CFLAGS})
 
 ########### mysqle ###############
 
-set( amarok_collection-mysqlecollection_PART_SRCS
+set( amarok_storage-mysqlestorage_PART_SRCS
      ../mysql-shared/MySqlStorage.cpp
-     MySqlEmbeddedCollection.cpp
      MySqlEmbeddedStorage.cpp
+     MySqlEmbeddedStorageFactory.cpp
 )
 
-kde4_add_plugin(amarok_collection-mysqlecollection \
${amarok_collection-mysqlecollection_PART_SRCS}) \
+kde4_add_plugin(amarok_storage-mysqlestorage \
${amarok_storage-mysqlestorage_PART_SRCS})  
 STRING(REPLACE "-Wl,--fatal-warnings" "" CMAKE_SHARED_LINKER_FLAGS_NOFATALWARN \
"${CMAKE_SHARED_LINKER_FLAGS}")  SET(CMAKE_SHARED_LINKER_FLAGS \
${CMAKE_SHARED_LINKER_FLAGS_NOFATALWARN} ) @@ -16,8 +16,8 @@ \
SET(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_NOFATALWARN} )  \
STRING(REPLACE "-Wl,--fatal-warnings" "" CMAKE_MODULE_LINKER_FLAGS_NOFATALWARN \
"${CMAKE_MODULE_LINKER_FLAGS}")  SET(CMAKE_MODULE_LINKER_FLAGS \
${CMAKE_MODULE_LINKER_FLAGS_NOFATALWARN} )  
-target_link_libraries(amarok_collection-mysqlecollection
-    amarok-sqlcollection
+target_link_libraries(amarok_storage-mysqlestorage
+    # amarok-sqlstorage
     amarokcore
     amaroklib
     ${KDE4_KDECORE_LIBS}
@@ -29,13 +29,13 @@ target_link_libraries(amarok_collection-mysqlecollection
 )
 
 if(NOT WIN32 AND NOT APPLE)
-    target_link_libraries( amarok_collection-mysqlecollection crypt pthread )
+    target_link_libraries( amarok_storage-mysqlestorage crypt pthread )
 endif(NOT WIN32 AND NOT APPLE)
 
 if(APPLE)
-	SET_TARGET_PROPERTIES(amarok_collection-mysqlecollection PROPERTIES LINK_FLAGS \
"-undefined dynamic_lookup") +	SET_TARGET_PROPERTIES(amarok_storage-mysqlestorage \
PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")  endif(APPLE)
 
-install(TARGETS amarok_collection-mysqlecollection DESTINATION ${PLUGIN_INSTALL_DIR} \
) +install(TARGETS amarok_storage-mysqlestorage DESTINATION ${PLUGIN_INSTALL_DIR} )
 
-install(FILES amarok_collection-mysqlecollection.desktop DESTINATION \
${SERVICES_INSTALL_DIR}) +install(FILES amarok_storage-mysqlestorage.desktop \
                DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.cpp \
b/src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.cpp similarity index \
100% rename from src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.cpp
 rename to src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.cpp
diff --git a/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.h \
b/src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h similarity index 87%
rename from src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.h
rename to src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h
index 44e333b..d4a9a82 100644
--- a/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedStorage.h
+++ b/src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h
@@ -18,15 +18,15 @@
 #ifndef MYSQLEMBEDDEDSTORAGE_H
 #define MYSQLEMBEDDEDSTORAGE_H
 
-#include "../amarok_sqlcollection_export.h"
-#include <core/collections/support/SqlStorage.h>
-#include <core-impl/collections/db/sql/mysql-shared/MySqlStorage.h>
+#include "../amarok_sqlstorage_export.h"
+#include <core/storage/SqlStorage.h>
+#include <core-impl/storage/sql/mysql-shared/MySqlStorage.h>
 
 /**
- * Implements a MySqlCollection using a MySQL Embedded Server
+ * Implements a MySqlStorage using a MySQL Embedded Server
  */
 
-class AMAROK_SQLCOLLECTION_MYSQLE_EXPORT MySqlEmbeddedStorage : public MySqlStorage
+class AMAROK_SQLSTORAGE_MYSQLE_EXPORT MySqlEmbeddedStorage : public MySqlStorage
 {
     public:
         /** Creates a new SqlStorage.
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp \
b/src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorageFactory.cpp similarity \
index 65% copy from src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp
copy to src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorageFactory.cpp
index c8f47a1..bb65e87 100644
--- a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp
+++ b/src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorageFactory.cpp
@@ -1,5 +1,5 @@
 /****************************************************************************************
                
- * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>         \
* + * Copyright (c) 2014 Ralf Engels <ralf-engels@gmx.de>                             \
                *
  *                                                                                   \
                *
  * This program is free software; you can redistribute it and/or modify it under     \
                *
  * the terms of the GNU General Public License as published by the Free Software     \
* @@ -14,21 +14,31 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#include "MySqlQueryMaker.h"
+#include "MySqlEmbeddedStorageFactory.h"
+#include "MySqlEmbeddedStorage.h"
 
-MySqlQueryMaker::MySqlQueryMaker( MySqlCollection *collection )
-    : SqlQueryMaker( collection )
+AMAROK_EXPORT_STORAGE( MySqleStorageFactory, mysqlestorage )
+
+MySqleStorageFactory::MySqleStorageFactory( QObject *parent, const QVariantList \
&args ) +    : StorageFactory( parent, args )
 {
-    //nothing to do
+    m_info = KPluginInfo( "amarok_storage-mysqlestorage.desktop", "services" );
 }
 
-MySqlQueryMaker::~MySqlQueryMaker()
+MySqleStorageFactory::~MySqleStorageFactory()
 {
-    //nothing to do
 }
 
-QString
-MySqlQueryMaker::escape( QString text ) const               //krazy:exclude=constref
+void
+MySqleStorageFactory::init()
 {
-    return text.replace("\\", "\\\\").replace( '\'', "''" );
+    if( m_initialized )
+        return;
+
+    m_initialized = true;
+
+    emit newStorage( new MySqlEmbeddedStorage() );
 }
+
+#include "MySqlEmbeddedStorageFactory.moc"
+
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h \
b/src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorageFactory.h similarity \
index 74% copy from src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h
copy to src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorageFactory.h
index 360ba94..9f648df 100644
--- a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h
+++ b/src/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorageFactory.h
@@ -1,5 +1,5 @@
 /****************************************************************************************
                
- * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>         \
* + * Copyright (c) 2014 Ralf Engels <ralf-engels@gmx.de>                             \
                *
  *                                                                                   \
                *
  * This program is free software; you can redistribute it and/or modify it under     \
                *
  * the terms of the GNU General Public License as published by the Free Software     \
* @@ -13,21 +13,22 @@
  * You should have received a copy of the GNU General Public License along with      \
                *
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
                
- 
-#ifndef AMAROK_COLLECTION_MYSQLQUERYMAKER_H
-#define AMAROK_COLLECTION_MYSQLQUERYMAKER_H
 
-#include "MySqlCollection.h"
-#include "SqlQueryMaker.h"
+#ifndef AMAROK_STORAGE_MYSQLEMBEDDEDFACTORY_H
+#define AMAROK_STORAGE_MYSQLEMBEDDEDFACTORY_H
 
-class MySqlQueryMaker : public SqlQueryMaker
+#include "core/storage/StorageFactory.h"
+
+class MySqleStorageFactory : public StorageFactory
 {
+    Q_OBJECT
+
     public:
-        MySqlQueryMaker( MySqlCollection* collection );
-        virtual ~MySqlQueryMaker();
+        MySqleStorageFactory( QObject *parent, const QVariantList &args );
+        virtual ~MySqleStorageFactory();
 
-    protected:
-        virtual QString escape( QString text ) const;
+        virtual void init();
 };
 
+
 #endif
diff --git a/src/core-impl/storage/sql/mysqlestorage/amarok_storage-mysqlestorage.desktop \
b/src/core-impl/storage/sql/mysqlestorage/amarok_storage-mysqlestorage.desktop new \
file mode 100644 index 0000000..515e036
--- /dev/null
+++ b/src/core-impl/storage/sql/mysqlestorage/amarok_storage-mysqlestorage.desktop
@@ -0,0 +1,27 @@
+[Desktop Entry]
+Type=Service
+Icon=server-database
+Name=MySQLe Storage
+Name[en_GB]=MySQLe Storage
+Comment=Storage plugin for Amarok
+Comment[en_GB]=Storage plugin for Amarok
+NoDisplay=true
+
+ServiceTypes=Amarok/Plugin
+
+X-KDE-Amarok-authors=Ralf Engels
+X-KDE-Amarok-email=ralf-engels@gmx.de
+X-KDE-Amarok-framework-version=72
+X-KDE-Amarok-name=mysqle-storage
+X-KDE-Amarok-plugintype=storage
+X-KDE-Amarok-rank=100
+X-KDE-Amarok-version=1
+
+X-KDE-PluginInfo-Author=Ralf Engels
+X-KDE-PluginInfo-Email=ralf.engels@gmx.de
+X-KDE-PluginInfo-Version=1.0
+X-KDE-PluginInfo-Category=Storage
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
+X-KDE-PluginInfo-Name=amarok_storage-mysqlestorage
+X-KDE-Library=amarok_storage-mysqlestorage
diff --git a/src/core-impl/collections/db/sql/mysqlservercollection/CMakeLists.txt \
b/src/core-impl/storage/sql/mysqlserverstorage/CMakeLists.txt similarity index 53%
rename from src/core-impl/collections/db/sql/mysqlservercollection/CMakeLists.txt
rename to src/core-impl/storage/sql/mysqlserverstorage/CMakeLists.txt
index d261217..e6e71f83 100644
--- a/src/core-impl/collections/db/sql/mysqlservercollection/CMakeLists.txt
+++ b/src/core-impl/storage/sql/mysqlserverstorage/CMakeLists.txt
@@ -2,13 +2,13 @@ add_definitions(${MYSQL_CFLAGS})
 
 ########### mysqlserver ###############
 
-set( amarok_collection-mysqlservercollection_PART_SRCS
+set( amarok_storage-mysqlserverstorage_PART_SRCS
      ../mysql-shared/MySqlStorage.cpp
      MySqlServerStorage.cpp
-     MySqlServerCollection.cpp
+     MySqlServerStorageFactory.cpp
 )
 
-kde4_add_plugin(amarok_collection-mysqlservercollection \
${amarok_collection-mysqlservercollection_PART_SRCS}) \
+kde4_add_plugin(amarok_storage-mysqlserverstorage \
${amarok_storage-mysqlserverstorage_PART_SRCS})  
 STRING(REPLACE "-Wl,--fatal-warnings" "" CMAKE_SHARED_LINKER_FLAGS_NOFATALWARN \
"${CMAKE_SHARED_LINKER_FLAGS}")  SET(CMAKE_SHARED_LINKER_FLAGS \
${CMAKE_SHARED_LINKER_FLAGS_NOFATALWARN} ) @@ -16,8 +16,8 @@ \
SET(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_NOFATALWARN} )  \
STRING(REPLACE "-Wl,--fatal-warnings" "" CMAKE_MODULE_LINKER_FLAGS_NOFATALWARN \
"${CMAKE_MODULE_LINKER_FLAGS}")  SET(CMAKE_MODULE_LINKER_FLAGS \
${CMAKE_MODULE_LINKER_FLAGS_NOFATALWARN} )  
-target_link_libraries(amarok_collection-mysqlservercollection
-    amarok-sqlcollection
+target_link_libraries(amarok_storage-mysqlserverstorage
+    # amarok-sqlstorage
     amarokcore
     amaroklib
     ${KDE4_KDECORE_LIBS}
@@ -29,13 +29,13 @@ target_link_libraries(amarok_collection-mysqlservercollection
 )
 
 if(NOT WIN32 AND NOT APPLE)
-    target_link_libraries( amarok_collection-mysqlservercollection crypt pthread )
+    target_link_libraries( amarok_storage-mysqlserverstorage crypt pthread )
 endif(NOT WIN32 AND NOT APPLE)
 
 if(APPLE)
-	SET_TARGET_PROPERTIES(amarok_collection-mysqlservercollection PROPERTIES LINK_FLAGS \
"-undefined dynamic_lookup") \
+	SET_TARGET_PROPERTIES(amarok_storage-mysqlserverstorage PROPERTIES LINK_FLAGS \
"-undefined dynamic_lookup")  endif(APPLE)
 
-install(TARGETS amarok_collection-mysqlservercollection DESTINATION \
${PLUGIN_INSTALL_DIR} ) +install(TARGETS amarok_storage-mysqlserverstorage \
DESTINATION ${PLUGIN_INSTALL_DIR} )  
-install(FILES amarok_collection-mysqlservercollection.desktop DESTINATION \
${SERVICES_INSTALL_DIR}) +install(FILES amarok_storage-mysqlserverstorage.desktop \
                DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorage.cpp \
b/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorage.cpp new file mode \
100644 index 0000000..c630490
--- /dev/null
+++ b/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorage.cpp
@@ -0,0 +1,140 @@
+/****************************************************************************************
 + * Copyright (c) 2008 Edward Toroshchin <edward.hades@gmail.com>                    \
* + * Copyright (c) 2009 Jeff Mitchell <mitchell@kde.org>                             \
* + * Copyright (c) 2012 Lachlan Dufton <dufton@gmail.com>                            \
* + *                                                                                 \
* + * This program is free software; you can redistribute it and/or modify it under   \
* + * the terms of the GNU General Public License as published by the Free Software   \
* + * Foundation; either version 2 of the License, or (at your option) any later      \
* + * version.                                                                        \
* + *                                                                                 \
* + * This program is distributed in the hope that it will be useful, but WITHOUT ANY \
* + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A \
* + * PARTICULAR PURPOSE. See the GNU General Public License for more details.        \
* + *                                                                                 \
* + * You should have received a copy of the GNU General Public License along with    \
* + * this program.  If not, see <http://www.gnu.org/licenses/>.                      \
* + ****************************************************************************************/
 +
+#define DEBUG_PREFIX "MySqlServerStorage"
+
+#include "MySqlServerStorage.h"
+
+#include <amarokconfig.h>
+#include <core/support/Amarok.h>
+#include <core/support/Debug.h>
+
+#include <QMutexLocker>
+
+#include <mysql.h>
+
+MySqlServerStorage::MySqlServerStorage()
+    : MySqlStorage()
+{
+    DEBUG_BLOCK
+
+    m_debugIdent = "MySQL-server";
+
+    if( mysql_library_init( 0, NULL, NULL ) )
+    {
+        error() << "MySQL library initialization failed!";
+        return;
+    }
+
+    m_db = mysql_init( NULL );
+
+    if( !m_db )
+    {
+        error() << "MySQL initialization failed";
+        mysql_library_end();
+        return;
+    }
+
+    //first here, the right way for >= 5.1.6
+
+    my_bool reconnect = true;
+    if( mysql_options( m_db, MYSQL_OPT_RECONNECT, &reconnect ) )
+        reportError( "Asking for automatic reconnect did not succeed!" );
+    else
+        debug() << "Automatic reconnect successfully activated";
+
+    if( !mysql_real_connect( m_db,
+                Amarok::config( "MySQL" ).readEntry( "Host", "localhost" ).toUtf8(),
+                Amarok::config( "MySQL" ).readEntry( "User", "amarokuser" \
).toUtf8(), +                Amarok::config( "MySQL" ).readEntry( "Password", \
"password" ).toUtf8(), +                NULL,
+                Amarok::config( "MySQL" ).readEntry( "Port", "3306" ).toInt(),
+                NULL,
+                CLIENT_COMPRESS )
+        )
+    {
+        debug() << "connection to mysql failed";
+        error() << "Could not connect to mysql!";
+        reportError( "na" );
+        mysql_close( m_db );
+        mysql_library_end();
+        m_db = 0;
+    }
+    else
+    {
+        //but in versions prior to 5.1.6, have to call it after every real_connect
+        my_bool reconnect = true;
+        if( mysql_options( m_db, MYSQL_OPT_RECONNECT, &reconnect ) )
+            reportError( "Asking for automatic reconnect did not succeed!" );
+        else
+            debug() << "Automatic reconnect successfully activated";
+
+        QString databaseName = Amarok::config( "MySQL" ).readEntry( "Database", \
"amarokdb" ); +        sharedInit( databaseName );
+        debug() << "Connected to MySQL server" << mysql_get_server_info( m_db );
+    }
+
+    MySqlServerStorage::initThreadInitializer();
+}
+
+MySqlServerStorage::~MySqlServerStorage()
+{
+    DEBUG_BLOCK
+}
+
+QString
+MySqlServerStorage::type() const
+{
+    return "MySQL";
+}
+
+QStringList
+MySqlServerStorage::query( const QString &query )
+{
+    MySqlStorage::initThreadInitializer();
+    QMutexLocker locker( &m_mutex );
+    if( !m_db )
+    {
+        error() << "Tried to query an uninitialized m_db!";
+        return QStringList();
+    }
+
+    unsigned long tid = mysql_thread_id( m_db );
+
+    int res = mysql_ping( m_db );
+    if( res )
+    {
+        reportError( "mysql_ping failed!" );
+        return QStringList();
+    }
+
+    if( tid != mysql_thread_id( m_db ) )
+    {
+        debug() << "NOTE: MySQL server had gone away, ping reconnected it";
+        QString databaseName = Amarok::config( "MySQL" ).readEntry( "Database", \
"amarokdb" ); +        if( mysql_query( m_db, QString( "SET NAMES 'utf8'" ).toUtf8() \
) ) +            reportError( "SET NAMES 'utf8' died" );
+        if( mysql_query( m_db, QString( "USE %1" ).arg( databaseName ).toUtf8() ) )
+            reportError( "Could not select database" );
+    }
+
+
+    return MySqlStorage::query( query );
+}
+
+
diff --git a/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.h \
b/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorage.h similarity index \
70% rename from src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.h
 rename to src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorage.h
index 4f80561..027b1f5 100644
--- a/src/core-impl/collections/db/sql/mysqlecollection/MySqlEmbeddedCollection.h
+++ b/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorage.h
@@ -15,28 +15,23 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#ifndef AMAROK_COLLECTION_MYSQLEMBEDDEDCOLLECTION_H
-#define AMAROK_COLLECTION_MYSQLEMBEDDEDCOLLECTION_H
+#ifndef AMAROK_STORAGE_MYSQLSERVERSTORAGE_H
+#define AMAROK_STORAGE_MYSQLSERVERSTORAGE_H
 
-#include "core/collections/Collection.h"
+#include "amarok_export.h"
+#include "../mysql-shared/MySqlStorage.h"
 
-namespace Collections {
-
-class MySqlEmbeddedCollectionFactory : public Collections::CollectionFactory
+/**
+ * Implements a MySqlStorage using a MySQL Server
+ */
+class AMAROK_EXPORT MySqlServerStorage: public MySqlStorage
 {
-    Q_OBJECT
-
     public:
-        MySqlEmbeddedCollectionFactory( QObject *parent, const QVariantList &args )
-            : Collections::CollectionFactory( parent, args )
-        {
-            m_info = KPluginInfo( "amarok_collection-mysqlecollection.desktop", \
                "services" );
-        }
-        virtual ~MySqlEmbeddedCollectionFactory() {}
+        MySqlServerStorage();
+        virtual ~MySqlServerStorage();
 
-        virtual void init();
+        virtual QString type() const;
+        virtual QStringList query( const QString &query );
 };
 
-} //namespace Collections
-
 #endif
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp \
b/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorageFactory.cpp \
similarity index 64% copy from \
src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp copy to \
src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorageFactory.cpp index \
                c8f47a1..5421763 100644
--- a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp
+++ b/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorageFactory.cpp
@@ -1,5 +1,5 @@
 /****************************************************************************************
                
- * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>         \
* + * Copyright (c) 2014 Ralf Engels <ralf-engels@gmx.de>                             \
                *
  *                                                                                   \
                *
  * This program is free software; you can redistribute it and/or modify it under     \
                *
  * the terms of the GNU General Public License as published by the Free Software     \
* @@ -14,21 +14,31 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#include "MySqlQueryMaker.h"
+#include "MySqlServerStorageFactory.h"
+#include "MySqlServerStorage.h"
 
-MySqlQueryMaker::MySqlQueryMaker( MySqlCollection *collection )
-    : SqlQueryMaker( collection )
+AMAROK_EXPORT_STORAGE( MySqlServerStorageFactory, mysqlserverstorage )
+
+MySqlServerStorageFactory::MySqlServerStorageFactory( QObject *parent, const \
QVariantList &args ) +    : StorageFactory( parent, args )
 {
-    //nothing to do
+    m_info = KPluginInfo( "amarok_storage-mysqlserverstorage.desktop", "services" );
 }
 
-MySqlQueryMaker::~MySqlQueryMaker()
+MySqlServerStorageFactory::~MySqlServerStorageFactory()
 {
-    //nothing to do
 }
 
-QString
-MySqlQueryMaker::escape( QString text ) const               //krazy:exclude=constref
+void
+MySqlServerStorageFactory::init()
 {
-    return text.replace("\\", "\\\\").replace( '\'', "''" );
+    if( m_initialized )
+        return;
+
+    m_initialized = true;
+
+    emit newStorage( new MySqlServerStorage() );
 }
+
+#include "MySqlServerStorageFactory.moc"
+
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h \
b/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorageFactory.h similarity \
index 73% rename from src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h
rename to src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorageFactory.h
index 360ba94..94015ae 100644
--- a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.h
+++ b/src/core-impl/storage/sql/mysqlserverstorage/MySqlServerStorageFactory.h
@@ -1,5 +1,5 @@
 /****************************************************************************************
                
- * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>         \
* + * Copyright (c) 2014 Ralf Engels <ralf-engels@gmx.de>                             \
                *
  *                                                                                   \
                *
  * This program is free software; you can redistribute it and/or modify it under     \
                *
  * the terms of the GNU General Public License as published by the Free Software     \
* @@ -13,21 +13,22 @@
  * You should have received a copy of the GNU General Public License along with      \
                *
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
                
- 
-#ifndef AMAROK_COLLECTION_MYSQLQUERYMAKER_H
-#define AMAROK_COLLECTION_MYSQLQUERYMAKER_H
 
-#include "MySqlCollection.h"
-#include "SqlQueryMaker.h"
+#ifndef AMAROK_STORAGE_MYSQLSERVERSTORAGEFACTORY_H
+#define AMAROK_STORAGE_MYSQLSERVERSTORAGEFACTORY_H
 
-class MySqlQueryMaker : public SqlQueryMaker
+#include "core/storage/StorageFactory.h"
+
+class MySqlServerStorageFactory : public StorageFactory
 {
+    Q_OBJECT
+
     public:
-        MySqlQueryMaker( MySqlCollection* collection );
-        virtual ~MySqlQueryMaker();
+        MySqlServerStorageFactory( QObject *parent, const QVariantList &args );
+        virtual ~MySqlServerStorageFactory();
 
-    protected:
-        virtual QString escape( QString text ) const;
+        virtual void init();
 };
 
+
 #endif
diff --git a/src/core-impl/storage/sql/mysqlserverstorage/amarok_storage-mysqlserverstorage.desktop \
b/src/core-impl/storage/sql/mysqlserverstorage/amarok_storage-mysqlserverstorage.desktop
 new file mode 100644
index 0000000..9272126
--- /dev/null
+++ b/src/core-impl/storage/sql/mysqlserverstorage/amarok_storage-mysqlserverstorage.desktop
 @@ -0,0 +1,27 @@
+[Desktop Entry]
+Type=Service
+Icon=network-server-database
+Name=MySQLServer Storage
+Name[en_GB]=MySQLServer Storage
+Comment=Storage plugin for Amarok
+Comment[en_GB]=Storage plugin for Amarok
+NoDisplay=true
+
+ServiceTypes=Amarok/Plugin
+
+X-KDE-Amarok-authors=Ralf Engels
+X-KDE-Amarok-email=ralf-engels@gmx.de
+X-KDE-Amarok-framework-version=72
+X-KDE-Amarok-name=mysqlserver-storage
+X-KDE-Amarok-plugintype=storage
+X-KDE-Amarok-rank=100
+X-KDE-Amarok-version=1
+
+X-KDE-PluginInfo-Author=Ralf Engels
+X-KDE-PluginInfo-Email=ralf.engels@gmx.de
+X-KDE-PluginInfo-Version=1.0
+X-KDE-PluginInfo-Category=Storage
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
+X-KDE-PluginInfo-Name=amarok_storage-mysqlserverstorage
+X-KDE-Library=amarok_storage-mysqlserverstorage
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index d00808c..f8ef338 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -54,6 +54,10 @@ set(libcore_collection_SRCS
     collections/support/TrackForUrlWorker.cpp
 )
 
+set(libcore_storage_SRCS
+    storage/StorageFactory.cpp
+)
+
 set(libcore_podcasts_SRCS
     podcasts/PodcastReader.cpp
     podcasts/PodcastMeta.cpp
@@ -91,6 +95,7 @@ set(libcore_LIB_SRCS
     ${libcore_podcasts_SRCS}
     ${libcore_interfaces_SRCS}
     ${libcore_collection_SRCS}
+    ${libcore_storage_SRCS}
     ${libcore_playlists_SRCS}
     ${libcore_meta_SRCS}
     ${libcore_capabilities_SRCS}
diff --git a/src/core/collections/Collection.h b/src/core/collections/Collection.h
index 7770ec6..79e85a8 100644
--- a/src/core/collections/Collection.h
+++ b/src/core/collections/Collection.h
@@ -21,7 +21,6 @@
 #include "core/amarokcore_export.h"
 #include "core/interfaces/MetaCapability.h"
 #include "core/support/PluginFactory.h"
-#include "core/storage/SqlStorage.h"
 
 #include <QObject>
 
@@ -56,17 +55,6 @@ namespace Collections
 
         signals:
             void newCollection( Collections::Collection *newCollection );
-
-            /** Emitted whenever the factory produces a new storage.
-             *
-             *  This should usually happen only once before the creation
-             *  of the first primary (local) collection.
-             *
-             *  This function will disapper as soon as we have dedictated
-             *  StorageFactories.
-             */
-            void newStorage( SqlStorage *newStorage );
-
     };
 
     /** A TrackProvider is a class that can lookup urls and return Track objects.
diff --git a/src/core/collections/support/SqlStorage.h \
b/src/core/collections/support/SqlStorage.h deleted file mode 100644
index e8a78ac..0000000
--- a/src/core/collections/support/SqlStorage.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************************
                
- * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>         \
                *
- *                                                                                   \
                *
- * This program is free software; you can redistribute it and/or modify it under     \
                *
- * the terms of the GNU General Public License as published by the Free Software     \
                *
- * Foundation; either version 2 of the License, or (at your option) any later        \
                *
- * version.                                                                          \
                *
- *                                                                                   \
                *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY   \
                *
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A   \
                *
- * PARTICULAR PURPOSE. See the GNU General Public License for more details.          \
                *
- *                                                                                   \
                *
- * You should have received a copy of the GNU General Public License along with      \
                *
- * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
- ****************************************************************************************/
                
-
-#ifndef AMAROK_SQLSTORAGE_H
-#define AMAROK_SQLSTORAGE_H
-
-#include "core/amarokcore_export.h"
-
-#include <QMetaType>
-#include <QString>
-#include <QStringList>
-
-/** The abstract SqlStorage engine
-    Only current implementations are in core-impl/collections/db/sql
-*/
-class SqlStorage
-{
-public:
-    SqlStorage() {}
-    virtual ~SqlStorage() {}
-
-    virtual QString type() const = 0;
-
-    virtual QString escape( const QString &text ) const = 0;
-
-    virtual QStringList query( const QString &query ) = 0;
-    virtual int insert( const QString &statement, const QString &table ) = 0;
-
-    virtual QString boolTrue() const = 0;
-    virtual QString boolFalse() const = 0;
-
-    /**
-        use this type for auto incrementing integer primary keys.
-    */
-    virtual QString idType() const = 0;
-
-    virtual QString textColumnType( int length = 255 ) const = 0;
-    virtual QString exactTextColumnType( int length = 1000 ) const = 0;
-    //the below value may have to be decreased even more for different indexes; only \
                time will tell
-    virtual QString exactIndexableTextColumnType( int length = 324 ) const = 0;
-    virtual QString longTextColumnType() const = 0;
-    virtual QString randomFunc() const = 0;
-
-    /** Returns a list of the last sql errors.
-      The list might not include every one error if the number
-      is beyond a sensible limit.
-      */
-    virtual QStringList getLastErrors() const = 0;
-
-    /** Clears the list of the last errors. */
-    virtual void clearLastErrors() = 0;
-
-};
-
-Q_DECLARE_METATYPE( SqlStorage * )
-
-#endif
diff --git a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp \
b/src/core/storage/StorageFactory.cpp similarity index 73%
rename from src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp
rename to src/core/storage/StorageFactory.cpp
index c8f47a1..fced9e6 100644
--- a/src/core-impl/collections/db/sql/mysql-shared/MySqlQueryMaker.cpp
+++ b/src/core/storage/StorageFactory.cpp
@@ -1,5 +1,5 @@
 /****************************************************************************************
                
- * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>         \
* + * Copyright (c) 2014 Ralf Engels <ralf-engels@gmx.de>                             \
                *
  *                                                                                   \
                *
  * This program is free software; you can redistribute it and/or modify it under     \
                *
  * the terms of the GNU General Public License as published by the Free Software     \
* @@ -14,21 +14,16 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#include "MySqlQueryMaker.h"
+#include "StorageFactory.h"
 
-MySqlQueryMaker::MySqlQueryMaker( MySqlCollection *collection )
-    : SqlQueryMaker( collection )
+StorageFactory::StorageFactory( QObject *parent, const QVariantList &args )
+    : Plugins::PluginFactory( parent, args )
 {
-    //nothing to do
 }
 
-MySqlQueryMaker::~MySqlQueryMaker()
+StorageFactory::~StorageFactory()
 {
-    //nothing to do
 }
 
-QString
-MySqlQueryMaker::escape( QString text ) const               //krazy:exclude=constref
-{
-    return text.replace("\\", "\\\\").replace( '\'', "''" );
-}
+
+#include "StorageFactory.moc"
diff --git a/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h \
b/src/core/storage/StorageFactory.h similarity index 55%
rename from src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h
 rename to src/core/storage/StorageFactory.h
index baedfe8..7bcf0ce 100644
--- a/src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.h
+++ b/src/core/storage/StorageFactory.h
@@ -1,6 +1,5 @@
 /****************************************************************************************
                
- * Copyright (c) 2008 Edward Toroshchin <edward.hades@gmail.com>                     \
                *
- * Copyright (c) 2009 Jeff Mitchell <mitchell@kde.org>                               \
* + * Copyright (c) 2014 Ralf Engels <ralf-engels@gmx.de>                             \
                *
  *                                                                                   \
                *
  * This program is free software; you can redistribute it and/or modify it under     \
                *
  * the terms of the GNU General Public License as published by the Free Software     \
* @@ -15,28 +14,43 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-#ifndef AMAROK_COLLECTION_MYSQLSERVERCOLLECTION_H
-#define AMAROK_COLLECTION_MYSQLSERVERCOLLECTION_H
+#ifndef AMAROK_STORAGE_FACTORY_H
+#define AMAROK_STORAGE_FACTORY_H
 
-#include "core/collections/Collection.h"
+#include "core/amarokcore_export.h"
+#include "core/support/PluginFactory.h"
 
-namespace Collections {
+#include <QObject>
 
-class MySqlServerCollectionFactory : public Collections::CollectionFactory
+class SqlStorage;
+
+/** A plugin that provides a Storage object.
+ *
+ *  The storage plugin is the only part of Amarok that actually needs to be
+ *  a plugin since we are linking two libraries (MySqlClient and MySqlEmbedded)
+ *  that have the same symbols.
+ *
+ */
+class AMAROK_CORE_EXPORT StorageFactory : public Plugins::PluginFactory
 {
     Q_OBJECT
 
-    public:
-        MySqlServerCollectionFactory( QObject *parent, const QVariantList &args )
-            : Collections::CollectionFactory( parent, args )
-        {
-            m_info = KPluginInfo( "amarok_collection-mysqlservercollection.desktop", \
                "services" );
-        }
-        virtual ~MySqlServerCollectionFactory() {}
+public:
+    StorageFactory( QObject *parent, const QVariantList &args );
+    virtual ~StorageFactory();
+
+    virtual void init() = 0;
 
-        virtual void init();
+signals:
+    /** Emitted whenever the factory produces a new storage.
+     *
+     */
+    void newStorage( SqlStorage *newStorage );
 };
 
-} //namespace Collections
 
-#endif
+#define AMAROK_EXPORT_STORAGE( classname, libname ) \
+    K_PLUGIN_FACTORY( factory, registerPlugin<classname>(); ) \
+            K_EXPORT_PLUGIN( factory( "amarok_storage-" #libname ) )
+
+#endif /* AMAROK_STORAGE_FACTORY_H */
diff --git a/src/importers/amarok/amarok_importer-amarok.desktop \
b/src/importers/amarok/amarok_importer-amarok.desktop index 9ed908d..4e6fef1 100644
--- a/src/importers/amarok/amarok_importer-amarok.desktop
+++ b/src/importers/amarok/amarok_importer-amarok.desktop
@@ -68,7 +68,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Konrad Zemek
 X-KDE-Amarok-email=konrad.zemek@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=AmarokImporter
 X-KDE-Amarok-plugintype=importer
 X-KDE-Amarok-rank=100
diff --git a/src/importers/banshee/amarok_importer-banshee.desktop \
b/src/importers/banshee/amarok_importer-banshee.desktop index 8991511..47a5c4d 100644
--- a/src/importers/banshee/amarok_importer-banshee.desktop
+++ b/src/importers/banshee/amarok_importer-banshee.desktop
@@ -68,7 +68,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Konrad Zemek
 X-KDE-Amarok-email=konrad.zemek@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=BansheeImporter
 X-KDE-Amarok-plugintype=importer
 X-KDE-Amarok-rank=100
diff --git a/src/importers/clementine/amarok_importer-clementine.desktop \
b/src/importers/clementine/amarok_importer-clementine.desktop index 5ea7b27..cad19cd \
                100644
--- a/src/importers/clementine/amarok_importer-clementine.desktop
+++ b/src/importers/clementine/amarok_importer-clementine.desktop
@@ -68,7 +68,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Konrad Zemek
 X-KDE-Amarok-email=konrad.zemek@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=ClementineImporter
 X-KDE-Amarok-plugintype=importer
 X-KDE-Amarok-rank=100
diff --git a/src/importers/fastforward/amarok_importer-fastforward.desktop \
b/src/importers/fastforward/amarok_importer-fastforward.desktop index \
                d8a7cfc..2f8ed3b 100644
--- a/src/importers/fastforward/amarok_importer-fastforward.desktop
+++ b/src/importers/fastforward/amarok_importer-fastforward.desktop
@@ -68,7 +68,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Konrad Zemek
 X-KDE-Amarok-email=konrad.zemek@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=FastForwardImporter
 X-KDE-Amarok-plugintype=importer
 X-KDE-Amarok-rank=100
diff --git a/src/importers/itunes/amarok_importer-itunes.desktop \
b/src/importers/itunes/amarok_importer-itunes.desktop index ecbaf01..eb88200 100644
--- a/src/importers/itunes/amarok_importer-itunes.desktop
+++ b/src/importers/itunes/amarok_importer-itunes.desktop
@@ -68,7 +68,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Konrad Zemek
 X-KDE-Amarok-email=konrad.zemek@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=iTunesImporter
 X-KDE-Amarok-plugintype=importer
 X-KDE-Amarok-rank=100
diff --git a/src/importers/rhythmbox/amarok_importer-rhythmbox.desktop \
b/src/importers/rhythmbox/amarok_importer-rhythmbox.desktop index 7f4a89f..3f2a52e \
                100644
--- a/src/importers/rhythmbox/amarok_importer-rhythmbox.desktop
+++ b/src/importers/rhythmbox/amarok_importer-rhythmbox.desktop
@@ -68,7 +68,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Konrad Zemek
 X-KDE-Amarok-email=konrad.zemek@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=RhythmboxImporter
 X-KDE-Amarok-plugintype=importer
 X-KDE-Amarok-rank=100
diff --git a/src/services/amazon/amarok_service_amazonstore.desktop \
b/src/services/amazon/amarok_service_amazonstore.desktop index 3081d77..b765ca5 \
                100644
--- a/src/services/amazon/amarok_service_amazonstore.desktop
+++ b/src/services/amazon/amarok_service_amazonstore.desktop
@@ -92,7 +92,7 @@ X-KDE-Library=amarok_service_amazonstore
 
 X-KDE-Amarok-authors=Sven Krohlas
 X-KDE-Amarok-email=sven@asbest-online.de
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=AmazonStore
 X-KDE-Amarok-plugintype=service
 X-KDE-Amarok-rank=100
diff --git a/src/services/ampache/amarok_service_ampache.desktop \
b/src/services/ampache/amarok_service_ampache.desktop index a7d4856..8f053ae 100644
--- a/src/services/ampache/amarok_service_ampache.desktop
+++ b/src/services/ampache/amarok_service_ampache.desktop
@@ -112,7 +112,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Nikolaj Hald Nielsen
 X-KDE-Amarok-email=nhnFreespirit@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=AmpacheService
 X-KDE-Amarok-plugintype=service
 X-KDE-Amarok-rank=100
diff --git a/src/services/gpodder/amarok_service_gpodder.desktop \
b/src/services/gpodder/amarok_service_gpodder.desktop index 6565d82..3ce0ee7 100644
--- a/src/services/gpodder/amarok_service_gpodder.desktop
+++ b/src/services/gpodder/amarok_service_gpodder.desktop
@@ -97,7 +97,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Stefan Derkits, Christian Wagner, Felix Winter, Lucas Lira \
Gomes  X-KDE-Amarok-email=stefan@derkits.at, christian.wagner86@gmx.at, \
                ixos01@gmail.com, x8lucas8x@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=gpodderService
 X-KDE-Amarok-plugintype=service
 X-KDE-Amarok-rank=100
diff --git a/src/services/jamendo/amarok_service_jamendo.desktop \
b/src/services/jamendo/amarok_service_jamendo.desktop index fe2a065..c5e24c7 100644
--- a/src/services/jamendo/amarok_service_jamendo.desktop
+++ b/src/services/jamendo/amarok_service_jamendo.desktop
@@ -114,7 +114,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Nikolaj Hald Nielsen
 X-KDE-Amarok-email=nhnFreespirit@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=JamendoService
 X-KDE-Amarok-plugintype=service
 X-KDE-Amarok-rank=100
diff --git a/src/services/lastfm/amarok_service_lastfm.desktop \
b/src/services/lastfm/amarok_service_lastfm.desktop index 0592c5e..5f6a2d6 100644
--- a/src/services/lastfm/amarok_service_lastfm.desktop
+++ b/src/services/lastfm/amarok_service_lastfm.desktop
@@ -110,7 +110,7 @@ X-KDE-Library=amarok_service_lastfm
 
 X-KDE-Amarok-authors=Shane King
 X-KDE-Amarok-email=kde@dontletsstart.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=LastFmService
 X-KDE-Amarok-plugintype=service
 X-KDE-Amarok-rank=100
diff --git a/src/services/magnatune/amarok_service_magnatunestore.desktop \
b/src/services/magnatune/amarok_service_magnatunestore.desktop index 3abb101..540dcc0 \
                100644
--- a/src/services/magnatune/amarok_service_magnatunestore.desktop
+++ b/src/services/magnatune/amarok_service_magnatunestore.desktop
@@ -117,7 +117,7 @@ X-KDE-Library=amarok_service_magnatunestore
 
 X-KDE-Amarok-authors=Nikolaj Hald Nielsen
 X-KDE-Amarok-email=nhnFreespirit@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=MagnatuneStore
 X-KDE-Amarok-plugintype=service
 X-KDE-Amarok-rank=100
diff --git a/src/services/mp3tunes/amarok_service_mp3tunes.desktop \
b/src/services/mp3tunes/amarok_service_mp3tunes.desktop index f453c7a..49cd8a0 100644
--- a/src/services/mp3tunes/amarok_service_mp3tunes.desktop
+++ b/src/services/mp3tunes/amarok_service_mp3tunes.desktop
@@ -100,7 +100,7 @@ ServiceTypes=Amarok/Plugin
 
 X-KDE-Amarok-authors=Nikolaj Hald Nielsen
 X-KDE-Amarok-email=nhnFreespirit@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=Mp3tunesService
 X-KDE-Amarok-plugintype=service
 X-KDE-Amarok-rank=100
diff --git a/src/services/opmldirectory/amarok_service_opmldirectory.desktop \
b/src/services/opmldirectory/amarok_service_opmldirectory.desktop index \
                9eefe65..93db90d 100644
--- a/src/services/opmldirectory/amarok_service_opmldirectory.desktop
+++ b/src/services/opmldirectory/amarok_service_opmldirectory.desktop
@@ -111,7 +111,7 @@ X-KDE-Library=amarok_service_opmldirectory
 
 X-KDE-Amarok-authors=Nikolaj Hald Nielsen
 X-KDE-Amarok-email=nhnFreespirit@gmail.com
-X-KDE-Amarok-framework-version=71
+X-KDE-Amarok-framework-version=72
 X-KDE-Amarok-name=JamendoService
 X-KDE-Amarok-plugintype=service
 X-KDE-Amarok-rank=100
diff --git a/tests/core-impl/collections/db/sql/CMakeLists.txt \
b/tests/core-impl/collections/db/sql/CMakeLists.txt index 8b3b465..213b11d 100644
--- a/tests/core-impl/collections/db/sql/CMakeLists.txt
+++ b/tests/core-impl/collections/db/sql/CMakeLists.txt
@@ -1,3 +1,7 @@
+
+# macro function to build a test target.
+#
+# we are linking agains the mysql collection and mysql embedded storage plugin \
(except on OSX where this is not possible)  macro(add_database_test test_target \
test_sources)  add_definitions(${MYSQL_CFLAGS})
 
@@ -5,8 +9,8 @@ macro(add_database_test test_target test_sources)
     #one cannot link to plugins on OS X. As a workaround, add anything relevant that \
goes into the mysqle plugin to each test  set( test_sources_internal
                 ${test_sources}
-                ${AMAROK_SOURCE_TREE}/core-impl/storage/MySqlStorage.cpp
-                ${AMAROK_SOURCE_TREE}/core-impl/storage/MySqlEmbeddedStorage.cpp )
+                ${AMAROK_SOURCE_TREE}/core-impl/storage/sql/MySqlStorage.cpp
+                ${AMAROK_SOURCE_TREE}/core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.cpp \
)  endif(APPLE)
 
 
@@ -16,12 +20,13 @@ macro(add_database_test test_target test_sources)
         SET_TARGET_PROPERTIES(${test_target} PROPERTIES LINK_FLAGS "-undefined \
dynamic_lookup")  endif(APPLE)
 
+    # TODO: I don't think that we need to manually add dependencies here (Ralf)
     add_dependencies( ${test_target} amarokconfig_h )
     add_dependencies( ${test_target} amarokcore )
     add_dependencies( ${test_target} amaroklib)
     add_dependencies( ${test_target} amarok-sqlcollection)
     if(NOT APPLE)
-        add_dependencies( ${test_target} amarok_collection-mysqlecollection )
+        add_dependencies( ${test_target} amarok_collection-mysqlcollection \
amarok_storage-mysqlestorage )  endif(NOT APPLE)
 
     target_link_libraries(${test_target}
@@ -41,7 +46,7 @@ macro(add_database_test test_target test_sources)
         ${GOOGLEMOCK_LIBRARIES})
 
     if(NOT APPLE)
-        target_link_libraries( ${test_target} amarok_collection-mysqlecollection )
+        target_link_libraries( ${test_target} amarok_collection-mysqlcollection \
amarok_storage-mysqlestorage )  endif(NOT APPLE)
 
 endmacro(add_database_test)
diff --git a/tests/core-impl/collections/db/sql/TestDatabaseUpdater.cpp \
b/tests/core-impl/collections/db/sql/TestDatabaseUpdater.cpp index c1339a1..0d0928c \
                100644
--- a/tests/core-impl/collections/db/sql/TestDatabaseUpdater.cpp
+++ b/tests/core-impl/collections/db/sql/TestDatabaseUpdater.cpp
@@ -18,7 +18,7 @@
 
 #include "SqlCollection.h"
 #include "DatabaseUpdater.h"
-#include "core-impl/storage/MySqlEmbeddedStorage.h"
+#include "core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h"
 
 #include <KTempDir>
 
diff --git a/tests/core-impl/collections/db/sql/TestSqlAlbum.cpp \
b/tests/core-impl/collections/db/sql/TestSqlAlbum.cpp index 84ed57e..d12d2b9 100644
--- a/tests/core-impl/collections/db/sql/TestSqlAlbum.cpp
+++ b/tests/core-impl/collections/db/sql/TestSqlAlbum.cpp
@@ -18,7 +18,7 @@
 #include "TestSqlAlbum.h"
 
 #include "core/meta/Meta.h"
-#include "core-impl/storage/MySqlEmbeddedStorage.h"
+#include "core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h"
 #include "SqlCollection.h"
 #include "SqlMountPointManagerMock.h"
 
diff --git a/tests/core-impl/collections/db/sql/TestSqlArtist.cpp \
b/tests/core-impl/collections/db/sql/TestSqlArtist.cpp index aee6444..2571187 100644
--- a/tests/core-impl/collections/db/sql/TestSqlArtist.cpp
+++ b/tests/core-impl/collections/db/sql/TestSqlArtist.cpp
@@ -18,7 +18,7 @@
 
 #include "DefaultSqlQueryMakerFactory.h"
 #include "core/meta/Meta.h"
-#include "core-impl/storage/MySqlEmbeddedStorage.h"
+#include "core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h"
 #include "SqlCollection.h"
 #include "SqlMountPointManagerMock.h"
 
diff --git a/tests/core-impl/collections/db/sql/TestSqlCollection.cpp \
b/tests/core-impl/collections/db/sql/TestSqlCollection.cpp index 9a353eb..9039875 \
                100644
--- a/tests/core-impl/collections/db/sql/TestSqlCollection.cpp
+++ b/tests/core-impl/collections/db/sql/TestSqlCollection.cpp
@@ -19,7 +19,7 @@
 #include <core/collections/Collection.h>
 #include <core-impl/collections/db/sql/SqlCollection.h>
 #include <core-impl/collections/db/sql/DatabaseUpdater.h>
-#include <core-impl/storage/MySqlEmbeddedStorage.h>
+#include <core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h>
 
 #include "SqlMountPointManagerMock.h"
 
diff --git a/tests/core-impl/collections/db/sql/TestSqlCollectionLocation.cpp \
b/tests/core-impl/collections/db/sql/TestSqlCollectionLocation.cpp index \
                e565d3e..a21deaa 100644
--- a/tests/core-impl/collections/db/sql/TestSqlCollectionLocation.cpp
+++ b/tests/core-impl/collections/db/sql/TestSqlCollectionLocation.cpp
@@ -22,7 +22,7 @@
 #include "core-impl/logger/ProxyLogger.h"
 #include "DefaultSqlQueryMakerFactory.h"
 #include "core/meta/Meta.h"
-#include "core-impl/storage/MySqlEmbeddedStorage.h"
+#include "core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h"
 #include "SqlCollection.h"
 #include "SqlCollectionLocation.h"
 #include "SqlRegistry.h"
diff --git a/tests/core-impl/collections/db/sql/TestSqlQueryMaker.cpp \
b/tests/core-impl/collections/db/sql/TestSqlQueryMaker.cpp index bb0cbba..b0f69b9 \
                100644
--- a/tests/core-impl/collections/db/sql/TestSqlQueryMaker.cpp
+++ b/tests/core-impl/collections/db/sql/TestSqlQueryMaker.cpp
@@ -22,7 +22,7 @@
 #include "SqlCollection.h"
 #include "SqlQueryMaker.h"
 #include "SqlRegistry.h"
-#include "core-impl/storage/MySqlEmbeddedStorage.h"
+#include "core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h"
 
 #include "SqlMountPointManagerMock.h"
 
diff --git a/tests/core-impl/collections/db/sql/TestSqlScanManager.cpp \
b/tests/core-impl/collections/db/sql/TestSqlScanManager.cpp index 7b81868..d0e4437 \
                100644
--- a/tests/core-impl/collections/db/sql/TestSqlScanManager.cpp
+++ b/tests/core-impl/collections/db/sql/TestSqlScanManager.cpp
@@ -23,7 +23,7 @@
 #include "core-impl/collections/db/sql/SqlCollection.h"
 #include "core-impl/collections/db/sql/SqlQueryMaker.h"
 #include "core-impl/collections/db/sql/SqlRegistry.h"
-#include "core-impl/storage/MySqlEmbeddedStorage.h"
+#include "core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h"
 
 #include "config-amarok-test.h"
 #include "SqlMountPointManagerMock.h"
diff --git a/tests/core-impl/collections/db/sql/TestSqlTrack.cpp \
b/tests/core-impl/collections/db/sql/TestSqlTrack.cpp index e6b1160..d94af9e 100644
--- a/tests/core-impl/collections/db/sql/TestSqlTrack.cpp
+++ b/tests/core-impl/collections/db/sql/TestSqlTrack.cpp
@@ -18,7 +18,7 @@
 
 #include "DefaultSqlQueryMakerFactory.h"
 #include "core/meta/Meta.h"
-#include "core-impl/storage/MySqlEmbeddedStorage.h"
+#include "core-impl/storage/sql/mysqlestorage/MySqlEmbeddedStorage.h"
 
 #include "SqlCollection.h"
 #include "SqlMeta.h"
diff --git a/tests/importers/TestImporterManager.cpp \
b/tests/importers/TestImporterManager.cpp index cea5082..c66e7a2 100644
--- a/tests/importers/TestImporterManager.cpp
+++ b/tests/importers/TestImporterManager.cpp
@@ -28,19 +28,6 @@ QTEST_KDEMAIN_CORE( TestImporterManager )
 using namespace ::testing;
 
 void
-TestImporterManager::constructorShouldSetPluginType()
-{
-    QCOMPARE( m_mockManager->pluginType(), Plugins::PluginFactory::Importer );
-}
-
-void
-TestImporterManager::initShouldSetInitialized()
-{
-    m_mockManager->init();
-    QVERIFY( m_mockManager->isInitialized() );
-}
-
-void
 TestImporterManager::initShouldSetInfo()
 {
     KPluginInfo expectedInfo( "testinfo", "services" );
diff --git a/tests/importers/TestImporterManager.h \
b/tests/importers/TestImporterManager.h index 061646f..ef87d07 100644
--- a/tests/importers/TestImporterManager.h
+++ b/tests/importers/TestImporterManager.h
@@ -24,8 +24,6 @@ class TestImporterManager : public ImporterMocks
     Q_OBJECT
 
 private slots:
-    void constructorShouldSetPluginType();
-    void initShouldSetInitialized();
     void initShouldSetInfo();
     void initShouldLoadSettings();
     void creatingProviderShouldSetConfigAndParent();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic