diff --git a/pglab/DatabaseWindow.cpp b/pglab/DatabaseWindow.cpp index c8e86b7..6ce4cf6 100644 --- a/pglab/DatabaseWindow.cpp +++ b/pglab/DatabaseWindow.cpp @@ -389,7 +389,7 @@ void DatabaseWindow::on_actionCopy_triggered() } else { const QMetaObject *meta = w->metaObject(); - int i = meta->indexOfSlot("copy"); + int i = meta->indexOfMethod("copy()"); if (i != -1) { QMetaMethod method = meta->method(i); method.invoke(w, Qt::AutoConnection); diff --git a/pglab/widgets/CatalogConstraintPage.cpp b/pglab/widgets/CatalogConstraintPage.cpp index 26d12a9..752be3a 100644 --- a/pglab/widgets/CatalogConstraintPage.cpp +++ b/pglab/widgets/CatalogConstraintPage.cpp @@ -26,6 +26,7 @@ void CatalogConstraintPage::setFilter(const std::optional &cls) { m_constraintModel->setData(m_catalog, cls); m_tableView->resizeColumnsToContents(); + m_definitionView->setPlainText({}); } void CatalogConstraintPage::tableView_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) diff --git a/pglab/widgets/CatalogIndexPage.cpp b/pglab/widgets/CatalogIndexPage.cpp index 99bc789..25cafec 100644 --- a/pglab/widgets/CatalogIndexPage.cpp +++ b/pglab/widgets/CatalogIndexPage.cpp @@ -26,6 +26,7 @@ void CatalogIndexPage::setFilter(const std::optional &cls) { m_indexModel->setData(m_catalog, cls); m_tableView->resizeColumnsToContents(); + m_definitionView->setPlainText({}); } void CatalogIndexPage::tableView_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) diff --git a/pglablib/catalog/PgTrigger.cpp b/pglablib/catalog/PgTrigger.cpp index ba1ef9c..920a612 100644 --- a/pglablib/catalog/PgTrigger.cpp +++ b/pglablib/catalog/PgTrigger.cpp @@ -91,12 +91,18 @@ QString PgTrigger::event() const QString event; if (type & TriggerTypeInsert) event += "INSERT "; - if (type & TriggerTypeUpdate) + if (type & TriggerTypeUpdate) { + if (!event.isEmpty()) event += "OR "; event += "UPDATE "; - if (type & TriggerTypeDelete) + } + if (type & TriggerTypeDelete) { + if (!event.isEmpty()) event += "OR "; event += "DELETE "; - if (type & TriggerTypeTruncate) + } + if (type & TriggerTypeTruncate) { + if (!event.isEmpty()) event += "OR "; event += "TRUNCATE"; + } return event.trimmed(); }