From kde-commits Wed Oct 06 10:20:05 2010 From: =?utf-8?q?Jaros=C5=82aw=20Staniek?= Date: Wed, 06 Oct 2010 10:20:05 +0000 To: kde-commits Subject: koffice/kexi Message-Id: <20101006102005.746C2AC892 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128636044610171 SVN commit 1183126 by staniek: Forms *clearing form data source selection in the combo box properly resets assignment, so selecting the same datasource later works properly M +2 -2 plugins/forms/kexidatasourcepage.cpp M +10 -1 widget/kexidatasourcecombobox.cpp M +2 -1 widget/kexidatasourcecombobox.h --- trunk/koffice/kexi/plugins/forms/kexidatasourcepage.cpp #1183125:1183126 @@ -291,11 +291,11 @@ void KexiDataSourcePage::clearWidgetDataSourceSelection() { - if (!m_widgetDataSourceCombo->currentText().isEmpty()) { +// if (!m_widgetDataSourceCombo->currentText().isEmpty()) { //2.0 m_widgetDataSourceCombo->setEditText(QString()); m_widgetDataSourceCombo->setFieldOrExpression(QString()); slotFieldSelected(); - } +// } /*2.0: clear button is available in the combobox itself m_clearWidgetDSButton->setEnabled(false);*/ } --- trunk/koffice/kexi/widget/kexidatasourcecombobox.cpp #1183125:1183126 @@ -1,5 +1,5 @@ /* This file is part of the KDE project - Copyright (C) 2005-2006 Jarosław Staniek + Copyright (C) 2005-2010 Jarosław Staniek This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -20,6 +20,8 @@ #include "kexidatasourcecombobox.h" #include +#include + #include #include @@ -77,6 +79,7 @@ connect(this, SIGNAL(activated(int)), this, SLOT(slotActivated(int))); connect(this, SIGNAL(returnPressed(const QString &)), this, SLOT(slotReturnPressed(const QString &))); + connect(lineEdit(), SIGNAL(clearButtonClicked()), this, SLOT(slotClearButtonClicked())); d->tableIcon = SmallIcon("table"); d->queryIcon = SmallIcon("query"); @@ -272,6 +275,12 @@ } } +void KexiDataSourceComboBox::slotClearButtonClicked() +{ + setCurrentIndex(0); + slotActivated(0); +} + QString KexiDataSourceComboBox::selectedPartClass() const { if (selectedName().isEmpty()) --- trunk/koffice/kexi/widget/kexidatasourcecombobox.h #1183125:1183126 @@ -1,5 +1,5 @@ /* This file is part of the KDE project - Copyright (C) 2005-2006 Jarosław Staniek + Copyright (C) 2005-2010 Jarosław Staniek This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -79,6 +79,7 @@ void slotItemRenamed(const KexiPart::Item& item, const QString& oldName); void slotActivated(int index); void slotReturnPressed(const QString & text); + void slotClearButtonClicked(); protected: virtual void focusOutEvent(QFocusEvent *e);