digiKam
Digikam::DbEngineParameters Class Reference

Public Member Functions

 DbEngineParameters ()
 
 DbEngineParameters (const QString &_type, const QString &_databaseNameCore, const QString &_connectOptions=QString(), const QString &_hostName=QString(), int _port=-1, bool _internalServer=false, const QString &_userName=QString(), const QString &_password=QString(), const QString &_databaseNameThumbnails=QString(), const QString &_databaseNameFace=QString(), const QString &_databaseNameSimilarity=QString(), const QString &_internalServerDBPath=QString(), const QString &_internalServerMysqlAdminCmd=QString(), const QString &_internalServerMysqlServCmd=QString(), const QString &_internalServerMysqlInitCmd=QString())
 
 DbEngineParameters (const QUrl &url)
 
DbEngineParameters faceParameters () const
 
QString getCoreDatabaseNameOrDir () const
 
QString getFaceDatabaseNameOrDir () const
 
QString getSimilarityDatabaseNameOrDir () const
 
QString getThumbsDatabaseNameOrDir () const
 
QByteArray hash () const
 
void insertInUrl (QUrl &url) const
 
QString internalServerPath () const
 
bool isMySQL () const
 
bool isSQLite () const
 
bool isValid () const
 
void legacyAndDefaultChecks (const QString &suggestedPath=QString())
 
bool operator!= (const DbEngineParameters &other) const
 
bool operator== (const DbEngineParameters &other) const
 
void readFromConfig (const QString &configGroup=QString())
 
void removeLegacyConfig ()
 
void setCoreDatabasePath (const QString &folderOrFileOrName)
 
void setFaceDatabasePath (const QString &folderOrFileOrName)
 
void setInternalServerPath (const QString &path)
 
void setSimilarityDatabasePath (const QString &folderOrFileOrName)
 
void setThumbsDatabasePath (const QString &folderOrFileOrName)
 
DbEngineParameters similarityParameters () const
 
QString SQLiteDatabaseFile () const
 
DbEngineParameters thumbnailParameters () const
 
void writeToConfig (const QString &configGroup=QString()) const
 

Static Public Member Functions

static QString coreDatabaseDirectorySQLite (const QString &path)
 
static QString coreDatabaseFileSQLite (const QString &folderOrFile)
 
static QString defaultMysqlAdminCmd ()
 
static QString defaultMysqlInitCmd ()
 
static QString defaultMysqlServerCmd ()
 
static DbEngineParameters defaultParameters (const QString &databaseType)
 
static QString faceDatabaseDirectorySQLite (const QString &path)
 
static QString faceDatabaseFileSQLite (const QString &folderOrFile)
 
static QString internalServerPrivatePath ()
 
static QString MySQLDatabaseType ()
 
static DbEngineParameters parametersForSQLite (const QString &databaseFile)
 
static DbEngineParameters parametersForSQLiteDefaultFile (const QString &directory)
 
static DbEngineParameters parametersFromConfig (const QString &configGroup=QString())
 
static void removeFromUrl (QUrl &url)
 
static QString similarityDatabaseDirectorySQLite (const QString &path)
 
static QString similarityDatabaseFileSQLite (const QString &folderOrFile)
 
static QString SQLiteDatabaseType ()
 
static QString thumbnailDatabaseDirectorySQLite (const QString &path)
 
static QString thumbnailDatabaseFileSQLite (const QString &folderOrFile)
 

Public Attributes

QString connectOptions
 
QString databaseNameCore
 
QString databaseNameFace
 
QString databaseNameSimilarity
 
QString databaseNameThumbnails
 
QString databaseType
 
QString hostName
 
bool internalServer
 
QString internalServerDBPath
 
QString internalServerMysqlAdminCmd
 
QString internalServerMysqlInitCmd
 
QString internalServerMysqlServCmd
 
QString password
 
int port
 
QString userName
 

Detailed Description

This class encapsulates all parameters needed to establish a connection to a database (inspired by the API of Qt::Sql). The values can be read from and written to a QUrl.

Constructor & Destructor Documentation

◆ DbEngineParameters() [1/3]

Digikam::DbEngineParameters::DbEngineParameters ( const QString &  _type,
const QString &  _databaseNameCore,
const QString &  _connectOptions = QString(),
const QString &  _hostName = QString(),
int  _port = -1,
bool  _internalServer = false,
const QString &  _userName = QString(),
const QString &  _password = QString(),
const QString &  _databaseNameThumbnails = QString(),
const QString &  _databaseNameFace = QString(),
const QString &  _databaseNameSimilarity = QString(),
const QString &  _internalServerDBPath = QString(),
const QString &  _internalServerMysqlAdminCmd = QString(),
const QString &  _internalServerMysqlServCmd = QString(),
const QString &  _internalServerMysqlInitCmd = QString() 
)

◆ DbEngineParameters() [2/3]

Digikam::DbEngineParameters::DbEngineParameters ( )

◆ DbEngineParameters() [3/3]

Digikam::DbEngineParameters::DbEngineParameters ( const QUrl &  url)
explicit

Member Function Documentation

◆ coreDatabaseDirectorySQLite()

QString Digikam::DbEngineParameters::coreDatabaseDirectorySQLite ( const QString &  path)
static

◆ coreDatabaseFileSQLite()

QString Digikam::DbEngineParameters::coreDatabaseFileSQLite ( const QString &  folderOrFile)
static

◆ defaultMysqlAdminCmd()

QString Digikam::DbEngineParameters::defaultMysqlAdminCmd ( )
static

Return the default Mysql server administration name (Internal server only).

Referenced by defaultParameters(), and readFromConfig().

◆ defaultMysqlInitCmd()

QString Digikam::DbEngineParameters::defaultMysqlInitCmd ( )
static

Return the default Mysql initialization command name (Internal server only).

Referenced by defaultParameters(), and readFromConfig().

◆ defaultMysqlServerCmd()

QString Digikam::DbEngineParameters::defaultMysqlServerCmd ( )
static

Return the default Mysql server command name (Internal server only).

Referenced by defaultParameters(), and readFromConfig().

◆ defaultParameters()

◆ faceDatabaseDirectorySQLite()

QString Digikam::DbEngineParameters::faceDatabaseDirectorySQLite ( const QString &  path)
static

◆ faceDatabaseFileSQLite()

QString Digikam::DbEngineParameters::faceDatabaseFileSQLite ( const QString &  folderOrFile)
static

Referenced by setFaceDatabasePath().

◆ faceParameters()

DbEngineParameters Digikam::DbEngineParameters::faceParameters ( ) const

Replaces databaseName with databaseNameFace.

References databaseNameCore, and databaseNameFace.

Referenced by Digikam::FacialRecognitionWrapper::Private::Private().

◆ getCoreDatabaseNameOrDir()

QString Digikam::DbEngineParameters::getCoreDatabaseNameOrDir ( ) const

NOTE: In case of SQLite, the database name typically is a file. For non-SQLite, this simply handle the database name.

References coreDatabaseDirectorySQLite(), databaseNameCore, and isSQLite().

Referenced by Digikam::AlbumManager::changeDatabase(), Digikam::DBStatDlg::DBStatDlg(), main(), parametersForSQLite(), Digikam::DatabaseSettingsWidget::setParametersFromSettings(), and writeToConfig().

◆ getFaceDatabaseNameOrDir()

QString Digikam::DbEngineParameters::getFaceDatabaseNameOrDir ( ) const

◆ getSimilarityDatabaseNameOrDir()

QString Digikam::DbEngineParameters::getSimilarityDatabaseNameOrDir ( ) const

◆ getThumbsDatabaseNameOrDir()

QString Digikam::DbEngineParameters::getThumbsDatabaseNameOrDir ( ) const

◆ hash()

QByteArray Digikam::DbEngineParameters::hash ( ) const

◆ insertInUrl()

◆ internalServerPath()

QString Digikam::DbEngineParameters::internalServerPath ( ) const

◆ internalServerPrivatePath()

QString Digikam::DbEngineParameters::internalServerPrivatePath ( )
static

Return the hidden path from home directory to store private data used by internal Mysql server.

Referenced by Digikam::DatabaseServer::DatabaseServer(), DbEngineParameters(), defaultParameters(), legacyAndDefaultChecks(), and readFromConfig().

◆ isMySQL()

bool Digikam::DbEngineParameters::isMySQL ( ) const

◆ isSQLite()

◆ isValid()

bool Digikam::DbEngineParameters::isValid ( ) const

Performs basic checks that the parameters are not empty and have the information required for the databaseType.

References databaseNameCore, and isSQLite().

◆ legacyAndDefaultChecks()

void Digikam::DbEngineParameters::legacyAndDefaultChecks ( const QString &  suggestedPath = QString())

◆ MySQLDatabaseType()

◆ operator!=()

bool Digikam::DbEngineParameters::operator!= ( const DbEngineParameters other) const

◆ operator==()

◆ parametersForSQLite()

DbEngineParameters Digikam::DbEngineParameters::parametersForSQLite ( const QString &  databaseFile)
static

Convenience methods to create a DbEngineParameters object for an SQLITE database specified by the local file path.

References getCoreDatabaseNameOrDir(), setCoreDatabasePath(), setFaceDatabasePath(), setSimilarityDatabasePath(), and setThumbsDatabasePath().

Referenced by legacyAndDefaultChecks(), and parametersForSQLiteDefaultFile().

◆ parametersForSQLiteDefaultFile()

DbEngineParameters Digikam::DbEngineParameters::parametersForSQLiteDefaultFile ( const QString &  directory)
static

◆ parametersFromConfig()

DbEngineParameters Digikam::DbEngineParameters::parametersFromConfig ( const QString &  configGroup = QString())
static

◆ readFromConfig()

◆ removeFromUrl()

void Digikam::DbEngineParameters::removeFromUrl ( QUrl &  url)
static

Referenced by insertInUrl().

◆ removeLegacyConfig()

void Digikam::DbEngineParameters::removeLegacyConfig ( )

◆ setCoreDatabasePath()

void Digikam::DbEngineParameters::setCoreDatabasePath ( const QString &  folderOrFileOrName)

Use these methods if you set a file or a folder.

References coreDatabaseFileSQLite(), databaseNameCore, and isSQLite().

Referenced by parametersForSQLite(), and readFromConfig().

◆ setFaceDatabasePath()

void Digikam::DbEngineParameters::setFaceDatabasePath ( const QString &  folderOrFileOrName)

◆ setInternalServerPath()

void Digikam::DbEngineParameters::setInternalServerPath ( const QString &  path)

For Mysql internal server: manage the database path to store database files.

References internalServerDBPath.

Referenced by Digikam::DatabaseSettingsWidget::getDbEngineParameters().

◆ setSimilarityDatabasePath()

void Digikam::DbEngineParameters::setSimilarityDatabasePath ( const QString &  folderOrFileOrName)

◆ setThumbsDatabasePath()

void Digikam::DbEngineParameters::setThumbsDatabasePath ( const QString &  folderOrFileOrName)

◆ similarityDatabaseDirectorySQLite()

QString Digikam::DbEngineParameters::similarityDatabaseDirectorySQLite ( const QString &  path)
static

◆ similarityDatabaseFileSQLite()

QString Digikam::DbEngineParameters::similarityDatabaseFileSQLite ( const QString &  folderOrFile)
static

◆ similarityParameters()

DbEngineParameters Digikam::DbEngineParameters::similarityParameters ( ) const

Replaces databaseName with databaseNameFace.

References databaseNameCore, and databaseNameSimilarity.

Referenced by Digikam::AlbumManager::setDatabase().

◆ SQLiteDatabaseFile()

QString Digikam::DbEngineParameters::SQLiteDatabaseFile ( ) const

◆ SQLiteDatabaseType()

QString Digikam::DbEngineParameters::SQLiteDatabaseType ( )
static

Returns the databaseType designating the said database. If you have a DbEngineParameters object already, you can use isSQLite() as well. These strings are identical to the driver identifiers in the Qt SQL module.

Referenced by Digikam::DbEngineAccess::checkReadyForUse(), Digikam::DatabaseSettingsWidget::databaseBackend(), and Digikam::DatabaseSettingsWidget::setParametersFromSettings().

◆ thumbnailDatabaseDirectorySQLite()

QString Digikam::DbEngineParameters::thumbnailDatabaseDirectorySQLite ( const QString &  path)
static

◆ thumbnailDatabaseFileSQLite()

QString Digikam::DbEngineParameters::thumbnailDatabaseFileSQLite ( const QString &  folderOrFile)
static

◆ thumbnailParameters()

DbEngineParameters Digikam::DbEngineParameters::thumbnailParameters ( ) const

Replaces databaseName with databaseNameThumbnails.

References databaseNameCore, and databaseNameThumbnails.

◆ writeToConfig()

Member Data Documentation

◆ connectOptions

◆ databaseNameCore

◆ databaseNameFace

◆ databaseNameSimilarity

◆ databaseNameThumbnails

◆ databaseType

◆ hostName

◆ internalServer

◆ internalServerDBPath

◆ internalServerMysqlAdminCmd

QString Digikam::DbEngineParameters::internalServerMysqlAdminCmd

◆ internalServerMysqlInitCmd

◆ internalServerMysqlServCmd

◆ password

◆ port

◆ userName


The documentation for this class was generated from the following files: