summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Caulier <[email protected]>2015-10-22 13:50:56 +0200
committerGilles Caulier <[email protected]>2015-10-22 13:50:56 +0200
commit0b1c97dc68b649c009066597562672e35bc31d6a (patch)
tree35a712eca401adbb0c9340bd9bfae90e2cad62cd
parentbf6e91f8345bb4b11e28fead4b88bfcbc63a5383 (diff)
rename class
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/database/databaseaccess.cpp4
-rw-r--r--src/database/databasecorebackend.cpp4
-rw-r--r--src/database/databasecorebackend.h4
-rw-r--r--src/database/databasefaceschemaupdater.cpp (renamed from src/database/schemaupdater.cpp)32
-rw-r--r--src/database/databasefaceschemaupdater.h (renamed from src/database/schemaupdater.h)14
-rw-r--r--src/database/dbconfig.xml2
7 files changed, 31 insertions, 31 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4c1e69c..8261784 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -37,9 +37,9 @@ set(kface_database_LIB_SRCS database/databaseaccess.cpp
database/databaseconfigelement.cpp
database/databaseoperationgroup.cpp
database/databasefacecontainers.cpp
+ database/databasefaceschemaupdater.cpp
database/trainingdb.cpp
database/dbactiontype.cpp
- database/schemaupdater.cpp
database/sqlquery.cpp
)
diff --git a/src/database/databaseaccess.cpp b/src/database/databaseaccess.cpp
index 12b5cbd..42ec239 100644
--- a/src/database/databaseaccess.cpp
+++ b/src/database/databaseaccess.cpp
@@ -33,7 +33,7 @@
#include "libkface_debug.h"
#include "databasecorebackend.h"
#include "trainingdb.h"
-#include "schemaupdater.h"
+#include "databasefaceschemaupdater.h"
namespace KFaceIface
{
@@ -234,7 +234,7 @@ bool DatabaseAccess::checkReadyForUse(DatabaseAccessData* const d, DatabaseFaceI
d->initializing = true;
// update schema
- SchemaUpdater updater(&access);
+ DatabaseFaceSchemaUpdater updater(&access);
updater.setObserver(observer);
if (!d->backend->initSchema(&updater))
diff --git a/src/database/databasecorebackend.cpp b/src/database/databasecorebackend.cpp
index c4fcfe9..4e525cf 100644
--- a/src/database/databasecorebackend.cpp
+++ b/src/database/databasecorebackend.cpp
@@ -40,7 +40,7 @@
#include "libkface_debug.h"
#include "dbactiontype.h"
-#include "schemaupdater.h"
+#include "databasefaceschemaupdater.h"
namespace KFaceIface
{
@@ -785,7 +785,7 @@ bool DatabaseCoreBackend::open(const DatabaseParameters& parameters)
return true;
}
-bool DatabaseCoreBackend::initSchema(SchemaUpdater* const updater)
+bool DatabaseCoreBackend::initSchema(DatabaseFaceSchemaUpdater* const updater)
{
Q_D(DatabaseCoreBackend);
diff --git a/src/database/databasecorebackend.h b/src/database/databasecorebackend.h
index 9296176..13b8981 100644
--- a/src/database/databasecorebackend.h
+++ b/src/database/databasecorebackend.h
@@ -46,7 +46,7 @@ namespace KFaceIface
class DatabaseCoreBackendPrivate;
class DatabaseErrorHandler;
-class SchemaUpdater;
+class DatabaseFaceSchemaUpdater;
class DatabaseLocking
{
@@ -141,7 +141,7 @@ public:
* carry out upgrades if necessary.
* Shall only be called from the thread that called open().
*/
- bool initSchema(SchemaUpdater* const updater);
+ bool initSchema(DatabaseFaceSchemaUpdater* const updater);
/**
* Close the database connection.
diff --git a/src/database/schemaupdater.cpp b/src/database/databasefaceschemaupdater.cpp
index b6d3d6e..cc6a0a2 100644
--- a/src/database/schemaupdater.cpp
+++ b/src/database/databasefaceschemaupdater.cpp
@@ -4,7 +4,7 @@
* http://www.digikam.org
*
* Date : 2007-04-16
- * Description : Schema update
+ * Description : Face database schema update
*
* Copyright (C) 2007-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
@@ -21,7 +21,7 @@
*
* ============================================================ */
-#include "schemaupdater.h"
+#include "databasefaceschemaupdater.h"
// Local includes
@@ -34,7 +34,7 @@
namespace KFaceIface
{
-class SchemaUpdater::Private
+class DatabaseFaceSchemaUpdater::Private
{
public:
@@ -57,28 +57,28 @@ public:
DatabaseFaceInitObserver* observer;
};
-SchemaUpdater::SchemaUpdater(DatabaseAccess* const access)
+DatabaseFaceSchemaUpdater::DatabaseFaceSchemaUpdater(DatabaseAccess* const access)
: d(new Private)
{
d->access = access;
}
-SchemaUpdater::~SchemaUpdater()
+DatabaseFaceSchemaUpdater::~DatabaseFaceSchemaUpdater()
{
delete d;
}
-int SchemaUpdater::schemaVersion()
+int DatabaseFaceSchemaUpdater::schemaVersion()
{
return 2;
}
-void SchemaUpdater::setObserver(DatabaseFaceInitObserver* const observer)
+void DatabaseFaceSchemaUpdater::setObserver(DatabaseFaceInitObserver* const observer)
{
d->observer = observer;
}
-bool SchemaUpdater::update()
+bool DatabaseFaceSchemaUpdater::update()
{
bool success = startUpdates();
@@ -96,7 +96,7 @@ bool SchemaUpdater::update()
return success;
}
-bool SchemaUpdater::startUpdates()
+bool DatabaseFaceSchemaUpdater::startUpdates()
{
// First step: do we have an empty database?
QStringList tables = d->access->backend()->tables();
@@ -140,7 +140,7 @@ bool SchemaUpdater::startUpdates()
if (d->currentVersion > schemaVersion())
{
- // trying to open a database with a more advanced than this SchemaUpdater supports
+ // trying to open a database with a more advanced than this DatabaseFaceSchemaUpdater supports
if (!versionRequired.isEmpty() && versionRequired.toInt() <= schemaVersion())
{
// version required may be less than current version
@@ -194,7 +194,7 @@ bool SchemaUpdater::startUpdates()
}
}
-bool SchemaUpdater::makeUpdates()
+bool DatabaseFaceSchemaUpdater::makeUpdates()
{
if (d->currentVersion < schemaVersion())
{
@@ -208,7 +208,7 @@ bool SchemaUpdater::makeUpdates()
}
-bool SchemaUpdater::createDatabase()
+bool DatabaseFaceSchemaUpdater::createDatabase()
{
if ( createTables() && createIndices() && createTriggers())
{
@@ -222,23 +222,23 @@ bool SchemaUpdater::createDatabase()
}
}
-bool SchemaUpdater::createTables()
+bool DatabaseFaceSchemaUpdater::createTables()
{
return d->access->backend()->execDBAction(d->access->backend()->getDBAction(QString::fromLatin1("CreateDB"))) &&
d->access->backend()->execDBAction(d->access->backend()->getDBAction(QString::fromLatin1("CreateDBOpenCVLBPH")));
}
-bool SchemaUpdater::createIndices()
+bool DatabaseFaceSchemaUpdater::createIndices()
{
return d->access->backend()->execDBAction(d->access->backend()->getDBAction(QString::fromLatin1("CreateIndices")));
}
-bool SchemaUpdater::createTriggers()
+bool DatabaseFaceSchemaUpdater::createTriggers()
{
return d->access->backend()->execDBAction(d->access->backend()->getDBAction(QString::fromLatin1("CreateTriggers")));
}
-bool SchemaUpdater::updateV1ToV2()
+bool DatabaseFaceSchemaUpdater::updateV1ToV2()
{
/*
if (!d->access->backend()->execDBAction(d->access->backend()->getDBAction("UpdateDBSchemaFromV1ToV2")))
diff --git a/src/database/schemaupdater.h b/src/database/databasefaceschemaupdater.h
index dc893c0..852abdb 100644
--- a/src/database/schemaupdater.h
+++ b/src/database/databasefaceschemaupdater.h
@@ -4,7 +4,7 @@
* http://www.digikam.org
*
* Date : 2009-05-29
- * Description : Thumbnail DB schema update
+ * Description : Face database schema update
*
* Copyright (C) 2007-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
@@ -21,8 +21,8 @@
*
* ============================================================ */
-#ifndef SCHEMA_UPDATER_H
-#define SCHEMA_UPDATER_H
+#ifndef DATABASE_FACE_SCHEMA_UPDATER_H
+#define DATABASE_FACE_SCHEMA_UPDATER_H
namespace KFaceIface
{
@@ -30,12 +30,12 @@ namespace KFaceIface
class DatabaseAccess;
class DatabaseFaceInitObserver;
-class SchemaUpdater
+class DatabaseFaceSchemaUpdater
{
public:
- SchemaUpdater(DatabaseAccess* const access);
- ~SchemaUpdater();
+ DatabaseFaceSchemaUpdater(DatabaseAccess* const access);
+ ~DatabaseFaceSchemaUpdater();
bool update();
void setObserver(DatabaseFaceInitObserver* const observer);
@@ -60,4 +60,4 @@ private:
} // namespace KFaceIface
-#endif // SCHEMA_UPDATER_H
+#endif // DATABASE_FACE_SCHEMA_UPDATER_H
diff --git a/src/database/dbconfig.xml b/src/database/dbconfig.xml
index 6e3b3f2..6f76987 100644
--- a/src/database/dbconfig.xml
+++ b/src/database/dbconfig.xml
@@ -31,7 +31,7 @@
<!-- Increment this version number whenever you change this file.
On version mismatch, users will be warned.
- Don't forget to update SchemaUpdater::schemaVersion()
+ Don't forget to update DatabaseFaceSchemaUpdater::schemaVersion()
-->
<version>2</version>