Miscellaneous changes. Including a copy action.
This commit is contained in:
parent
242f5464df
commit
4a2c6cc396
19 changed files with 147 additions and 43 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#include "opendatabase.h"
|
||||
#include "OpenDatabase.h"
|
||||
#include "pgsqldatabasecatalogue.h"
|
||||
#include "PgsqlConn.h"
|
||||
#include "typeselectionitemmodel.h"
|
||||
|
||||
Expected<OpenDatabase*> OpenDatabase::createOpenDatabase(const ConnectionConfig &cfg)
|
||||
{
|
||||
|
|
@ -26,6 +28,26 @@ OpenDatabase::~OpenDatabase()
|
|||
|
||||
bool OpenDatabase::Init()
|
||||
{
|
||||
// m_catalogue->load(m_config);
|
||||
Pgsql::Connection conn;
|
||||
auto kw = m_config.getKeywords();
|
||||
auto vals = m_config.getValues();
|
||||
if (conn.connect(kw, vals, 0)) {
|
||||
m_catalogue->loadAll(conn);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
PgsqlDatabaseCatalogue* OpenDatabase::getCatalogue()
|
||||
{
|
||||
return m_catalogue;
|
||||
}
|
||||
|
||||
|
||||
TypeSelectionItemModel* OpenDatabase::getTypeSelectionModel()
|
||||
{
|
||||
if (m_typeSelectionModel == nullptr) {
|
||||
m_typeSelectionModel = new TypeSelectionItemModel(nullptr);
|
||||
m_typeSelectionModel->setTypeList(m_catalogue->getTypes());
|
||||
}
|
||||
return m_typeSelectionModel;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue