Sequence and Function pages are now properly filtered on namespace.

This commit is contained in:
eelke 2019-02-09 20:37:34 +01:00
parent 7ca671a078
commit f2808de613
17 changed files with 136 additions and 48 deletions

View file

@ -56,17 +56,19 @@ void CatalogInspector::setCatalog(std::shared_ptr<PgDatabaseCatalog> cat)
m_sequencesPage->setCatalog(cat);
}
void CatalogInspector::setNamespaceFilter(TablesTableModel::NamespaceFilter filter)
void CatalogInspector::setNamespaceFilter(NamespaceFilter filter)
{
m_tablesPage->setNamespaceFilter(filter);
m_functionsPage->setNamespaceFilter(filter);
m_sequencesPage->setNamespaceFilter(filter);
QString hint = "Catalog instpector";
QString caption = "Inspector";
switch (filter) {
case TablesTableModel::PgCatalog:
case NamespaceFilter::PgCatalog:
hint += " - pg_catalog";
caption = "pg_catalog";
break;
case TablesTableModel::InformationSchema:
case NamespaceFilter::InformationSchema:
hint += " - information_schema";
caption = "information_schema";
break;
@ -94,9 +96,9 @@ void CatalogInspectorModule::moduleAction_open(
auto ct = new CatalogInspector(context, nullptr);
context->addContentWidget(this, ct);
auto nsf = params.at("namespace-filter").toString();
TablesTableModel::NamespaceFilter filter = TablesTableModel::User;
if (nsf == "pg_catalog") filter = TablesTableModel::PgCatalog;
else if (nsf == "information_schema") filter = TablesTableModel::InformationSchema;
NamespaceFilter filter = NamespaceFilter::User;
if (nsf == "pg_catalog") filter = NamespaceFilter::PgCatalog;
else if (nsf == "information_schema") filter = NamespaceFilter::InformationSchema;
ct->setNamespaceFilter(filter);
}