From 2193c28e7e6ae9ea304f9f11d4272b2e12f67f34 Mon Sep 17 00:00:00 2001 From: mkossick Date: Tue, 9 Oct 2007 14:06:11 +0000 Subject: [PATCH] added getter for the databaseupdater instance git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/extragear/multimedia/amarok@723391 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/collection/sqlcollection/sqlcollection.cpp | 18 +++++++++++++++--- src/collection/sqlcollection/sqlcollection.h | 5 +++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/collection/sqlcollection/sqlcollection.cpp b/src/collection/sqlcollection/sqlcollection.cpp index 2c22d5254..c99f25fc9 100644 --- a/src/collection/sqlcollection/sqlcollection.cpp +++ b/src/collection/sqlcollection/sqlcollection.cpp @@ -59,14 +59,14 @@ SqlCollectionFactory::init() SqlCollection::SqlCollection( const QString &id, const QString &prettyName ) : Collection() , m_registry( new SqlRegistry( this ) ) + , m_updater( new DatabaseUpdater( this ) ) , m_collectionId( id ) , m_prettyName( prettyName ) , m_xesamBuilder( 0 ) { QTimer::singleShot( 0, this, SLOT( initXesam() ) ); - DatabaseUpdater updater( this ); - if( updater.needsUpdate() ) - updater.update(); + if( m_updater->needsUpdate() ) + m_updater->update(); } SqlCollection::~SqlCollection() @@ -98,6 +98,12 @@ SqlCollection::registry() const return m_registry; } +DatabaseUpdater* +SqlCollection::dbUpdater() const +{ + return m_updater; +} + void SqlCollection::removeCollection() { @@ -184,6 +190,12 @@ SqlCollection::randomFunc() const } void +SqlCollection::vacuum() const +{ + //implement in subclasses if necessary +} + +void SqlCollection::initXesam() { m_xesamBuilder = new XesamCollectionBuilder( this ); diff --git a/src/collection/sqlcollection/sqlcollection.h b/src/collection/sqlcollection/sqlcollection.h index 992f432a4..b6c7040eb 100644 --- a/src/collection/sqlcollection/sqlcollection.h +++ b/src/collection/sqlcollection/sqlcollection.h @@ -20,6 +20,7 @@ #include "amarok_export.h" #include "Collection.h" +#include "DatabaseUpdater.h" #include "sqlregistry.h" #include "SqlStorage.h" @@ -52,6 +53,7 @@ class AMAROK_EXPORT SqlCollection : public Collection, public SqlStorage virtual QString prettyName() const; SqlRegistry* registry() const; + DatabaseUpdater* dbUpdater() const; void removeCollection(); //testing, remove later @@ -78,12 +80,15 @@ class AMAROK_EXPORT SqlCollection : public Collection, public SqlStorage virtual QString longTextColumnType() const; virtual QString randomFunc() const; + virtual void vacuum() const; + private slots: void initXesam(); private: SqlRegistry* const m_registry; + DatabaseUpdater * const m_updater; QString m_collectionId; QString m_prettyName; -- 2.11.4.GIT