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

List:       kde-commits
Subject:    [kexi] src/widget/fields: Field selection combo box (in data source tab): make it work (regression)
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2016-02-29 23:12:17
Message-ID: E1aaWzB-0000sv-1n () scm ! kde ! org
[Download RAW message or body]

Git commit 642fcf75f5ff648269506056ff4eee393d9525d4 by Jaroslaw Staniek.
Committed on 29/02/2016 at 23:07.
Pushed by staniek into branch 'master'.

Field selection combo box (in data source tab): make it work (regression)

M  +4    -13   src/widget/fields/KexiFieldComboBox.cpp

http://commits.kde.org/kexi/642fcf75f5ff648269506056ff4eee393d9525d4

diff --git a/src/widget/fields/KexiFieldComboBox.cpp b/src/widget/fields/KexiFieldComboBox.cpp
index af3e9ae..33bf461 100644
--- a/src/widget/fields/KexiFieldComboBox.cpp
+++ b/src/widget/fields/KexiFieldComboBox.cpp
@@ -139,8 +139,7 @@ void KexiFieldComboBox::setFieldOrExpression(const QString& string)
         QString objectName = name.left(pos);
         if (d->tableOrQueryName != objectName) {
             d->fieldOrExpression = name;
-            setCurrentIndex(0);
-            lineEdit()->setText(name);
+            setEditText(name);
 //! @todo show error
             qWarning() << "invalid table/query name in" << name;
             return;
@@ -148,17 +147,9 @@ void KexiFieldComboBox::setFieldOrExpression(const QString& string)
         d->fieldOrExpression = name.mid(pos + 1);
     }
 
-    const int index = findText(d->fieldOrExpression);
-    if (index == -1) {
-        setCurrentIndex(0);
-        lineEdit()->setText(d->fieldOrExpression);
-//! @todo show 'the item doesn't match' info?
-        return;
-    }
-
-    setCurrentIndex(index);
-    lineEdit()->setText(d->fieldOrExpression);
-    qDebug() << index << currentText() << currentIndex() << lineEdit()->text();
+    //! @todo show 'the item doesn't match' info?
+    setEditText(d->fieldOrExpression);
+    qDebug() << currentText() << currentIndex() << lineEdit()->text();
 }
 
 void KexiFieldComboBox::setFieldOrExpression(int index)

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

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