From 6f4b5fc71a964695ec724c46001d2488c2d121de Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Sun, 28 May 2017 10:11:11 +0300 Subject: [PATCH 1/2] :lock: Fix search information leak --- src/gui/DatabaseWidget.cpp | 1 + src/gui/MainWindow.cpp | 4 +++- src/gui/SearchWidget.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 946757e40..eb3a32e2b 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -1064,6 +1064,7 @@ void DatabaseWidget::lock() m_entryBeforeLock = m_entryView->currentEntry()->uuid(); } + endSearch(); clearAllWidgets(); m_unlockDatabaseWidget->load(m_filename); setCurrentWidget(m_unlockDatabaseWidget); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 51d40dc57..450618719 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -219,9 +219,11 @@ MainWindow::MainWindow() m_actionMultiplexer.connect(SIGNAL(entryContextMenuRequested(QPoint)), this, SLOT(showEntryContextMenu(QPoint))); - // Notify search when the active database changes + // Notify search when the active database changes or gets locked connect(m_ui->tabWidget, SIGNAL(activateDatabaseChanged(DatabaseWidget*)), search, SLOT(databaseChanged(DatabaseWidget*))); + connect(m_ui->tabWidget, SIGNAL(databaseLocked(DatabaseWidget*)), + search, SLOT(databaseChanged())); connect(m_ui->tabWidget, SIGNAL(tabNameChanged()), SLOT(updateWindowTitle())); diff --git a/src/gui/SearchWidget.h b/src/gui/SearchWidget.h index e87701814..5a33b451f 100644 --- a/src/gui/SearchWidget.h +++ b/src/gui/SearchWidget.h @@ -51,7 +51,7 @@ signals: void enterPressed(); public slots: - void databaseChanged(DatabaseWidget* dbWidget); + void databaseChanged(DatabaseWidget* dbWidget = 0); private slots: void startSearchTimer(); From 2b6059dee3a95591d787e8b8c931cd68c059d43f Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Fri, 2 Jun 2017 01:28:39 +0800 Subject: [PATCH 2/2] :bug: Fix building with Qt 5.9 (closes #528) --- tests/modeltest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/modeltest.cpp b/tests/modeltest.cpp index 360a7bef1..6bf8124cf 100644 --- a/tests/modeltest.cpp +++ b/tests/modeltest.cpp @@ -448,7 +448,8 @@ void ModelTest::data() QVariant textAlignmentVariant = model->data ( model->index ( 0, 0 ), Qt::TextAlignmentRole ); if ( textAlignmentVariant.isValid() ) { int alignment = textAlignmentVariant.toInt(); - QCOMPARE( alignment, ( alignment & ( Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask ) ) ); + QCOMPARE( alignment, static_cast( alignment & ( Qt::AlignHorizontal_Mask + | Qt::AlignVertical_Mask ) ) ); } // General Purpose roles that should return a QColor