Database connections have been refactored

keepDbCredentials property has been added to Connection
setPassPharse(QString& passPharse) method has been added to ReportEngine
IDbCredentialsProvider interface has been added
registerDbCredentialsProvider(IDbCredentialsProvider *provider) has been
added to IDataSourceManager
This commit is contained in:
Arin Alexander
2017-02-16 04:11:39 +03:00
parent fa985d7fb7
commit ce3a905c55
22 changed files with 257 additions and 64 deletions

View File

@@ -351,13 +351,13 @@ void ModelToDataSource::slotModelDestroed()
ConnectionDesc::ConnectionDesc(QSqlDatabase db, QObject *parent)
: QObject(parent), m_connectionName(db.connectionName()), m_connectionHost(db.hostName()), m_connectionDriver(db.driverName()),
m_databaseName(db.databaseName()), m_user(db.userName()), m_password(db.password()), m_autoconnect(false),
m_internal(false)
m_internal(false), m_keepDBCredentials(true)
{}
ConnectionDesc::ConnectionDesc(QObject *parent)
:QObject(parent),m_connectionName(""),m_connectionHost(""),m_connectionDriver(""),
m_databaseName(""), m_user(""), m_password(""), m_autoconnect(false),
m_internal(false)
m_internal(false), m_keepDBCredentials(true)
{}
ConnectionDesc::Ptr ConnectionDesc::create(QSqlDatabase db, QObject *parent)
@@ -391,6 +391,16 @@ QString ConnectionDesc::connectionNameForReport(const QString &connectionName)
return connectionName.compare(tr("defaultConnection")) == 0 ? QSqlDatabase::defaultConnection : connectionName;
}
bool ConnectionDesc::keepDBCredentials() const
{
return m_keepDBCredentials;
}
void ConnectionDesc::setKeepDBCredentials(bool keepDBCredentals)
{
m_keepDBCredentials = keepDBCredentals;
}
QueryDesc::QueryDesc(QString queryName, QString queryText, QString connection)
:m_queryName(queryName), m_queryText(queryText), m_connectionName(connection)
{}