Catalog refresh working for functions page.
This commit is contained in:
parent
23899b6bb6
commit
211d937c16
3 changed files with 12 additions and 6 deletions
|
|
@ -28,17 +28,21 @@ QVariant ProcTableModel::headerData(int section, Qt::Orientation orientation, in
|
||||||
|
|
||||||
void ProcTableModel::setCatalog(std::shared_ptr<const PgDatabaseCatalog> cat)
|
void ProcTableModel::setCatalog(std::shared_ptr<const PgDatabaseCatalog> cat)
|
||||||
{
|
{
|
||||||
m_catalog = cat;
|
if (cat != m_catalog) {
|
||||||
reloadData();
|
m_catalog = cat;
|
||||||
|
refreshConnection = connect(m_catalog.get(), &PgDatabaseCatalog::refreshed,
|
||||||
|
this, &ProcTableModel::refresh);
|
||||||
|
}
|
||||||
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcTableModel::setNamespaceFilter(NamespaceFilter filter)
|
void ProcTableModel::setNamespaceFilter(NamespaceFilter filter)
|
||||||
{
|
{
|
||||||
m_namespaceFilter = filter;
|
m_namespaceFilter = filter;
|
||||||
reloadData();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcTableModel::reloadData()
|
void ProcTableModel::refresh()
|
||||||
{
|
{
|
||||||
if (!m_catalog)
|
if (!m_catalog)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -48,11 +48,12 @@ private:
|
||||||
std::shared_ptr<const PgDatabaseCatalog> m_catalog;
|
std::shared_ptr<const PgDatabaseCatalog> m_catalog;
|
||||||
NamespaceFilter m_namespaceFilter = NamespaceFilter::User;
|
NamespaceFilter m_namespaceFilter = NamespaceFilter::User;
|
||||||
std::vector<PgProc> m_procs;
|
std::vector<PgProc> m_procs;
|
||||||
|
QMetaObject::Connection refreshConnection;
|
||||||
|
|
||||||
void reloadData();
|
|
||||||
Oid getType(int column) const;
|
Oid getType(int column) const;
|
||||||
QVariant getData(const QModelIndex &index) const;
|
QVariant getData(const QModelIndex &index) const;
|
||||||
|
private slots:
|
||||||
|
void refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ CatalogFunctionsPage::CatalogFunctionsPage(QWidget *parent)
|
||||||
|
|
||||||
connect(m_functionTable->selectionModel(), &QItemSelectionModel::currentRowChanged, this,
|
connect(m_functionTable->selectionModel(), &QItemSelectionModel::currentRowChanged, this,
|
||||||
&CatalogFunctionsPage::functionTable_currentRowChanged);
|
&CatalogFunctionsPage::functionTable_currentRowChanged);
|
||||||
|
connect(m_model, &ProcTableModel::modelReset, m_definitionView, &SqlCodePreview::clear);
|
||||||
|
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue