mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 21:40:03 +00:00
If table dont use any filter, filter update now dont cause a reapply of empty filter
This commit is contained in:
parent
7e7215b3b3
commit
33e12a99fa
@ -7,7 +7,7 @@
|
|||||||
#include "../../model/world/data.hpp"
|
#include "../../model/world/data.hpp"
|
||||||
|
|
||||||
CSVFilter::EditWidget::EditWidget (CSMWorld::Data& data, QWidget *parent)
|
CSVFilter::EditWidget::EditWidget (CSMWorld::Data& data, QWidget *parent)
|
||||||
: QLineEdit (parent), mParser (data)
|
: QLineEdit (parent), mParser (data), mIsEmpty(true)
|
||||||
{
|
{
|
||||||
mPalette = palette();
|
mPalette = palette();
|
||||||
connect (this, SIGNAL (textChanged (const QString&)), this, SLOT (textChanged (const QString&)));
|
connect (this, SIGNAL (textChanged (const QString&)), this, SLOT (textChanged (const QString&)));
|
||||||
@ -27,6 +27,16 @@ CSVFilter::EditWidget::EditWidget (CSMWorld::Data& data, QWidget *parent)
|
|||||||
|
|
||||||
void CSVFilter::EditWidget::textChanged (const QString& text)
|
void CSVFilter::EditWidget::textChanged (const QString& text)
|
||||||
{
|
{
|
||||||
|
//no need to parse and apply filter if it was empty and now is empty too.
|
||||||
|
//e.g. - we modifiing content of filter with already opened some other (big) tables.
|
||||||
|
if (text.length() == 0){
|
||||||
|
if (mIsEmpty)
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
mIsEmpty = true;
|
||||||
|
}else
|
||||||
|
mIsEmpty = false;
|
||||||
|
|
||||||
if (mParser.parse (text.toUtf8().constData()))
|
if (mParser.parse (text.toUtf8().constData()))
|
||||||
{
|
{
|
||||||
setPalette (mPalette);
|
setPalette (mPalette);
|
||||||
|
@ -25,6 +25,7 @@ namespace CSVFilter
|
|||||||
|
|
||||||
CSMFilter::Parser mParser;
|
CSMFilter::Parser mParser;
|
||||||
QPalette mPalette;
|
QPalette mPalette;
|
||||||
|
bool mIsEmpty;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user