From f1e5502d5084218dee6420b84871e21893defa27 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Thu, 12 Jun 2014 19:54:09 +0200 Subject: [PATCH] Fix bug in filter function when havin multiple filters Since commit 707323067d62d7177a96418c8e1201297fc70d13 there has been a bug in the SqliteTableModel::setQuery method which rendered the filters useless when using them on multiple columns: Because this method is called whenever a filter value is changed and because it deleted the internal representation of the filters all filters except the one last modified were deleted but still shown in the UI. --- src/sqlitetablemodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sqlitetablemodel.cpp b/src/sqlitetablemodel.cpp index 9ad94994..c5aecea2 100644 --- a/src/sqlitetablemodel.cpp +++ b/src/sqlitetablemodel.cpp @@ -83,9 +83,11 @@ QString removeComments(QString s) void SqliteTableModel::setQuery(const QString& sQuery, bool dontClearHeaders) { // clear - m_mWhere.clear(); if(!dontClearHeaders) + { + m_mWhere.clear(); m_headers.clear(); + } if(!m_db->isOpen()) return;