diff --git a/pglab/CrudModel.cpp b/pglab/CrudModel.cpp index d4c5222..18eda02 100644 --- a/pglab/CrudModel.cpp +++ b/pglab/CrudModel.cpp @@ -172,8 +172,8 @@ void CrudModel::loadData() if (res.valid()) { auto dbres = res.get(); if (dbres && *dbres) { -/// \todo Use ControllableTask instead with QFUtureWatcher -// m_asyncWindow->QueueTask([this, dbres]() { loadIntoModel(dbres); }); + QMetaObject::invokeMethod(this, "loadIntoModel", Qt::QueuedConnection, + Q_ARG(std::shared_ptr, dbres)); } } else { @@ -197,7 +197,7 @@ void CrudModel::loadIntoModel(std::shared_ptr data) void CrudModel::initRowMapping() { - m_rowMapping.resize(m_rowCount); + m_rowMapping.resize(static_cast(m_rowCount)); for (int i = 0; i < m_rowCount; ++i) m_rowMapping[i] = RowMapping{ i }; } diff --git a/pglab/CrudModel.h b/pglab/CrudModel.h index ac071e4..19482bb 100644 --- a/pglab/CrudModel.h +++ b/pglab/CrudModel.h @@ -263,13 +263,6 @@ private: /// call on initial load to fill in the mappings void initRowMapping(); -// using RedirectVec = std::vector; -// /// In sync with the actual table, used to efficiently find the correct row in the result -// RedirectVec m_redirectVector; - - - void loadIntoModel(std::shared_ptr data); - Value getData(const QModelIndex &index) const; Oid getType(int column) const; @@ -317,11 +310,8 @@ private: int attNumToCol(int attnum) const { return attnum - 1; } private slots: + void loadIntoModel(std::shared_ptr data); void connectionStateChanged(ASyncDBConnection::State state); -// void queryResult(std::shared_ptr result); -// void queryError(); - -// void dataProcessingFutureFinished(); }; #endif // CRUDMODEL_H