From a3b936fcd0c5c933af6af49d18939d18c459e03c Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 6 Dec 2015 20:27:09 +0100 Subject: [PATCH] Coding style fixes. --- src/gui/DatabaseWidget.cpp | 5 +++-- src/gui/DatabaseWidget.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 088f83af9..8de842f3a 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -990,6 +990,7 @@ bool DatabaseWidget::eventFilter(QObject* object, QEvent* event) if (object == m_searchUi->searchEdit) { if (event->type() == QEvent::KeyPress) { QKeyEvent* keyEvent = static_cast(event); + if (keyEvent->matches(QKeySequence::Copy)) { // If Control+C is pressed in the search edit when no // text is selected, copy the password of the current @@ -1003,8 +1004,8 @@ bool DatabaseWidget::eventFilter(QObject* object, QEvent* event) else if (keyEvent->matches(QKeySequence::MoveToNextLine)) { // If Down is pressed at EOL in the search edit, move // the focus to the entry view. - if (!m_searchUi->searchEdit->hasSelectedText() && - m_searchUi->searchEdit->cursorPosition() == m_searchUi->searchEdit->text().length()) { + if (!m_searchUi->searchEdit->hasSelectedText() + && m_searchUi->searchEdit->cursorPosition() == m_searchUi->searchEdit->text().size()) { m_entryView->setFocus(); return true; } diff --git a/src/gui/DatabaseWidget.h b/src/gui/DatabaseWidget.h index 653c1fcae..a925606a7 100644 --- a/src/gui/DatabaseWidget.h +++ b/src/gui/DatabaseWidget.h @@ -103,7 +103,7 @@ Q_SIGNALS: void entryColumnSizesChanged(); protected: - bool eventFilter(QObject* object, QEvent* event); + bool eventFilter(QObject* object, QEvent* event) Q_DECL_OVERRIDE; public Q_SLOTS: void createEntry();