From 2826e7b98963e395e0199e7165ae8d448d4c8565 Mon Sep 17 00:00:00 2001 From: mgrojo Date: Fri, 12 Mar 2021 20:28:42 +0100 Subject: [PATCH] Save as view: allow any state in the table This check was supposed to help the user understand what this operation was for, but it was actually preventing to save as view table states that had global filter, display formats or custom order and not column filters. It's better to give the user the freedom, even to create maybe useless vies as: `CREATE VIEW "example_view" AS SELECT * FROM "main"."example"` See issue #2615 --- src/TableBrowser.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/TableBrowser.cpp b/src/TableBrowser.cpp index 97d80167..ef5d7f05 100644 --- a/src/TableBrowser.cpp +++ b/src/TableBrowser.cpp @@ -1411,11 +1411,8 @@ void TableBrowser::exportFilteredTable() void TableBrowser::saveFilterAsView() { - if (m_model->filterCount() > 0) - // Save as view a custom query without rowid - emit createView(m_model->customQuery(false)); - else - QMessageBox::information(this, qApp->applicationName(), tr("There is no filter set for this table. View will not be created.")); + // Save as view a custom query without rowid + emit createView(m_model->customQuery(false)); } void TableBrowser::setTableEncoding(bool forAllTables)