ASyncDBConnection uses Qt signals now for reporting state changes and notices
This commit is contained in:
parent
90d0a14b63
commit
3befef2464
7 changed files with 30 additions and 73 deletions
|
|
@ -11,21 +11,13 @@ DatabaseWindow::DatabaseWindow(QWidget *parent) :
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_dbConnection.setStateCallback([this](ASyncDBConnection::State st)
|
||||
{
|
||||
QueueTask([this, st]() { connectionStateChanged(st); });
|
||||
});
|
||||
|
||||
m_dbConnection.setNoticeCallback([this](Pgsql::ErrorDetails details)
|
||||
{
|
||||
QueueTask([this, details]() { receiveNotice(details); });
|
||||
});
|
||||
connect(&m_dbConnection, &ASyncDBConnection::onStateChanged, this, &DatabaseWindow::connectionStateChanged);
|
||||
connect(&m_dbConnection, &ASyncDBConnection::onNotice, this, &DatabaseWindow::receiveNotice);
|
||||
}
|
||||
|
||||
DatabaseWindow::~DatabaseWindow()
|
||||
{
|
||||
m_dbConnection.closeConnection();
|
||||
m_dbConnection.setStateCallback(nullptr);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue