Fix problems with reconnects where dialog keeps popping up.

This commit is contained in:
eelke 2025-04-01 20:26:44 +02:00
parent a6be979f8e
commit 581e92723d
6 changed files with 11 additions and 10 deletions

View file

@ -247,9 +247,9 @@ void CrudModel::initRowMapping()
m_rowMapping.emplace_back(i);
}
void CrudModel::connectionStateChanged(ASyncDBConnection::StateData state)
void CrudModel::connectionStateChanged()
{
switch (state.State) {
switch (m_dbConn.state()) {
case ASyncDBConnection::State::NotConnected:
break;
case ASyncDBConnection::State::Connecting:

View file

@ -264,7 +264,7 @@ private:
private slots:
void loadIntoModel(std::shared_ptr<Pgsql::Result> data);
void connectionStateChanged(ASyncDBConnection::StateData state);
void connectionStateChanged();
};
#endif // CRUDMODEL_H

View file

@ -322,13 +322,14 @@ void QueryTool::queryTextChanged()
setQueryTextChanged(true);
}
void QueryTool::connectionStateChanged(ASyncDBConnection::StateData state)
void QueryTool::connectionStateChanged()
{
QString iconname;
switch (state.State) {
switch (m_dbConnection.state()) {
case ASyncDBConnection::State::NotConnected:
QMessageBox::warning(this, "pglab", tr("Warning connection and any of its session state has been lost"));
startConnect();
//startConnect();
iconname = "red.png";
break;
case ASyncDBConnection::State::Connecting:

View file

@ -113,7 +113,7 @@ private slots:
void query_ready(std::shared_ptr<Pgsql::Result>, qint64 elapsedms);
void queryTextChanged();
void connectionStateChanged(ASyncDBConnection::StateData state);
void connectionStateChanged();
void receiveNotice(Pgsql::ErrorDetails notice);
void startConnect();