Use QtConcurrent::run.then chain in DatabaseWindow too.
This commit is contained in:
parent
521e5d7370
commit
badd46ea8f
2 changed files with 13 additions and 34 deletions
|
|
@ -7,7 +7,6 @@
|
|||
#include "Pgsql_Connection.h"
|
||||
#include "ControllableTask.h"
|
||||
#include "IDatabaseWindow.h"
|
||||
#include <QFutureWatcher>
|
||||
#include <QMainWindow>
|
||||
#include <memory>
|
||||
|
||||
|
|
@ -100,24 +99,6 @@ private:
|
|||
QMenu *menuCrud = nullptr;
|
||||
QMenu *menuWindow = nullptr;
|
||||
|
||||
|
||||
class LoadCatalog: public ControllableTask<OpenDatabase::OpenDatabaseSPtr> {
|
||||
public:
|
||||
LoadCatalog(ConnectionConfig config)
|
||||
: m_config(config)
|
||||
{}
|
||||
|
||||
OpenDatabase::OpenDatabaseSPtr run(TaskControl& ) override
|
||||
{
|
||||
return OpenDatabase::createOpenDatabase(m_config);
|
||||
}
|
||||
|
||||
private:
|
||||
ConnectionConfig m_config;
|
||||
};
|
||||
|
||||
QFutureWatcher<LoadCatalog::Result> loadWatcher;
|
||||
|
||||
void createActions();
|
||||
void initMenus();
|
||||
|
||||
|
|
@ -139,10 +120,8 @@ private:
|
|||
QAction* createAction(QString caption, void (DatabaseWindow::*func)());
|
||||
|
||||
private slots:
|
||||
void catalogLoaded();
|
||||
void catalogLoaded(OpenDatabase::OpenDatabaseSPtr db);
|
||||
void tableSelected(Oid tableoid);
|
||||
// void tabWidget_tabCloseRequested(int index);
|
||||
// void tabWidget_currentChanged(int index);
|
||||
|
||||
void actionAbout_triggered();
|
||||
void actionCancelQuery_triggered();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue