[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kexi/3.1] src/widget/tableview: Fix validation of values in default input box of table view
From:       Jaroslaw Staniek <null () kde ! org>
Date:       2018-06-15 21:14:17
Message-ID: E1fTw2z-0008Pf-ET () code ! kde ! org
[Download RAW message or body]

Git commit 16076668cb67b174c734f9eee3a974689a186a1a by Jaroslaw Staniek.
Committed on 15/06/2018 at 21:14.
Pushed by staniek into branch '3.1'.

Fix validation of values in default input box of table view

Summary:
BUG:395225
FIXED-IN:3.1.1

Test Plan: See https://bugs.kde.org/show_bug.cgi?id=395225#c1

Reviewers: piggz

Reviewed By: piggz

Subscribers: Kexi-Devel-list

Tags: #kexi

Differential Revision: https://phabricator.kde.org/D13473

M  +6    -0    src/widget/tableview/kexiinputtableedit.cpp
M  +3    -0    src/widget/tableview/kexiinputtableedit.h

https://commits.kde.org/kexi/16076668cb67b174c734f9eee3a974689a186a1a

diff --git a/src/widget/tableview/kexiinputtableedit.cpp b/src/widget/tableview/kexiinputtableedit.cpp
index 3496fe576..bc009d8ca 100644
--- a/src/widget/tableview/kexiinputtableedit.cpp
+++ b/src/widget/tableview/kexiinputtableedit.cpp
@@ -186,6 +186,12 @@ bool KexiInputTableEdit::valueIsEmpty()
     return !m_lineedit->text().isNull() && m_lineedit->text().isEmpty();
 }
 
+bool KexiInputTableEdit::valueIsValid()
+{
+    return m_textFormatter.valueIsValid(m_lineedit->text())
+           && m_lineedit->hasAcceptableInput();
+}
+
 QVariant KexiInputTableEdit::value()
 {
     return m_textFormatter.fromString(m_lineedit->text());
diff --git a/src/widget/tableview/kexiinputtableedit.h b/src/widget/tableview/kexiinputtableedit.h
index 4e2202e42..335b8da01 100644
--- a/src/widget/tableview/kexiinputtableedit.h
+++ b/src/widget/tableview/kexiinputtableedit.h
@@ -51,6 +51,9 @@ public:
     //! (check this with KDbField::hasEmptyProperty()),
     virtual bool valueIsEmpty();
 
+    //! \return true if the value is valid
+    bool valueIsValid() override;
+
     virtual QVariant value();
 
     virtual bool cursorAtStart();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic