The previous async method's are being updated to the ASyncDBConnection class. Connecting is working.
This commit is contained in:
parent
2d420c0525
commit
fce51a7b7e
7 changed files with 363 additions and 215 deletions
38
mainwindow.h
38
mainwindow.h
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include "asyncdbconnection.h"
|
||||
#include "tsqueue.h"
|
||||
#include <QMainWindow>
|
||||
#include <QSocketNotifier>
|
||||
|
|
@ -52,36 +53,35 @@ private:
|
|||
std::unique_ptr<Ui::MainWindow> ui;
|
||||
std::unique_ptr<SqlHighlighter> highlighter;
|
||||
|
||||
std::unique_ptr<Pgsql::Connection> connection;
|
||||
std::unique_ptr<QueryResultModel> resultModel;
|
||||
std::unique_ptr<QueryExplainModel> explainModel;
|
||||
ASyncDBConnection m_dbConnection;
|
||||
|
||||
Pgsql::Canceller queryCancel;
|
||||
void connectionStateChanged(ASyncDBConnection::State state);
|
||||
|
||||
// std::unique_ptr<Pgsql::Connection> connection;
|
||||
// std::unique_ptr<QueryResultModel> resultModel;
|
||||
// std::unique_ptr<QueryExplainModel> explainModel;
|
||||
|
||||
// Pgsql::Canceller queryCancel;
|
||||
|
||||
struct {
|
||||
std::unique_ptr<QSocketNotifier> notifier;
|
||||
PostgresPollingStatusType poll_state;
|
||||
} connectingState;
|
||||
|
||||
// struct {
|
||||
// std::unique_ptr<QSocketNotifier> notifierRead;
|
||||
// std::unique_ptr<QSocketNotifier> notifierWrite;
|
||||
// } queryState;
|
||||
// std::unique_ptr<QSocketNotifier> notifier;
|
||||
// PostgresPollingStatusType poll_state;
|
||||
// } connectingState;
|
||||
|
||||
void processNotice(const PGresult *result);
|
||||
void query_ready(Pgsql::Result res);
|
||||
void explain_ready(std::shared_ptr<ExplainRoot> explain);
|
||||
// void processNotice(const PGresult *result);
|
||||
// void query_ready(Pgsql::Result res);
|
||||
// void explain_ready(std::shared_ptr<ExplainRoot> explain);
|
||||
private slots:
|
||||
|
||||
void startConnect();
|
||||
|
||||
void performQuery();
|
||||
void performExplain();
|
||||
void socket_activate_connect(int socket);
|
||||
// void performQuery();
|
||||
// void performExplain();
|
||||
// void socket_activate_connect(int socket);
|
||||
|
||||
void cancel_query();
|
||||
void receiveNotice(Pgsql::ErrorDetails notice);
|
||||
// void cancel_query();
|
||||
// void receiveNotice(Pgsql::ErrorDetails notice);
|
||||
|
||||
void processCallableQueue();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue