Skip to content

Commit

Permalink
Fixed uninitialized issue
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinux committed May 22, 2015
1 parent 43d5198 commit e015a7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -431,9 +431,9 @@ void QgsAttributeTableDialog::filterColumnChanged( QObject* filterAction )
return;
const QString widgetType = mLayer->editorWidgetV2( fldIdx );
const QgsEditorWidgetConfig widgetConfig = mLayer->editorWidgetV2Config( fldIdx );
//replace with createSearch or so
//go to registry and create a create Search method
mCurrentSearchWidgetWrapper= QgsEditorWidgetRegistry::instance()->createSearch( widgetType, mLayer, fldIdx, widgetConfig, mFilterContainer);
mCurrentSearchWidgetWrapper= QgsEditorWidgetRegistry::instance()->
createSearchWidget(widgetType, mLayer, fldIdx, widgetConfig, mFilterContainer);

replaceSearchWidget(mFilterQuery, mCurrentSearchWidgetWrapper->widget());

mApplyFilterButton->setVisible( true );
Expand Down Expand Up @@ -746,7 +746,8 @@ void QgsAttributeTableDialog::filterQueryChanged( const QString& query )
void QgsAttributeTableDialog::filterQueryAccepted()
{
if ( (mFilterQuery->isVisible() && mFilterQuery->text().isEmpty()) ||
(mCurrentSearchWidgetWrapper->widget()->isVisible() && mCurrentSearchWidgetWrapper->value().toString().isEmpty() ))
(mCurrentSearchWidgetWrapper!=0 && mCurrentSearchWidgetWrapper->widget()->isVisible()
&& mCurrentSearchWidgetWrapper->value().toString().isEmpty() ))
{
filterShowAll();
return;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp
Expand Up @@ -100,7 +100,7 @@ QgsEditorWidgetWrapper* QgsEditorWidgetRegistry::create( const QString& widgetId
return 0;
}

QgsEditorWidgetWrapper* QgsEditorWidgetRegistry::createSearch( const QString& widgetId, QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, QWidget* parent, const QgsAttributeEditorContext &context )
QgsEditorWidgetWrapper* QgsEditorWidgetRegistry::createSearchWidget( const QString& widgetId, QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, QWidget* parent, const QgsAttributeEditorContext &context )
{
if ( mWidgetFactories.contains( widgetId ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgseditorwidgetregistry.h
Expand Up @@ -83,7 +83,7 @@ class GUI_EXPORT QgsEditorWidgetRegistry : public QObject
QWidget* parent,
const QgsAttributeEditorContext& context = QgsAttributeEditorContext() );

QgsEditorWidgetWrapper* createSearch( const QString& widgetId,
QgsEditorWidgetWrapper* createSearchWidget( const QString& widgetId,
QgsVectorLayer* vl,
int fieldIdx,
const QgsEditorWidgetConfig& config,
Expand Down

0 comments on commit e015a7e

Please sign in to comment.