Query is now executed using std::async
This commit is contained in:
parent
3a8cc3d7f0
commit
0d30dc9080
4 changed files with 58 additions and 12 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <QMainWindow>
|
||||
#include <QSocketNotifier>
|
||||
#include <memory>
|
||||
#include <future>
|
||||
#include "PgsqlConn.h"
|
||||
|
||||
class QueryResultModel;
|
||||
|
|
@ -34,17 +35,25 @@ private:
|
|||
std::unique_ptr<Pgsql::Connection> connection;
|
||||
std::unique_ptr<QueryResultModel> resultModel;
|
||||
|
||||
std::future<Pgsql::Result> queryFuture;
|
||||
|
||||
struct {
|
||||
std::unique_ptr<QSocketNotifier> notifier;
|
||||
PostgresPollingStatusType poll_state;
|
||||
} connectingState;
|
||||
|
||||
// struct {
|
||||
// std::unique_ptr<QSocketNotifier> notifierRead;
|
||||
// std::unique_ptr<QSocketNotifier> notifierWrite;
|
||||
// } queryState;
|
||||
|
||||
private slots:
|
||||
|
||||
void startConnect();
|
||||
|
||||
void performQuery();
|
||||
void socket_activate_connect(int socket);
|
||||
void query_ready();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue