This repository has been archived on 2019-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
copr-dani-qgis/qgis-1.4.0-fieldcalc.patch

36 lines
1.1 KiB
Diff

Index: /trunk/qgis/src/app/qgsfieldcalculator.cpp
===================================================================
--- qgis-1.4.0/src/app/qgsfieldcalculator.cpp (revision 12551)
+++ /trunk/qgis/src/app/qgsfieldcalculator.cpp (revision 13046)
@@ -25,4 +25,9 @@
setupUi( this );
+ if ( !vl )
+ {
+ return;
+ }
+
populateFields();
populateOutputFieldTypes();
@@ -32,5 +37,5 @@
mOutputFieldPrecisionSpinBox->setValue( 3 );
- mUpdateExistingFieldCheckBox->setCheckState( Qt::Checked );
+
//disable ok button until there is text for output field and expression
@@ -40,7 +45,13 @@
if ( !( vl->dataProvider()->capabilities() & QgsVectorDataProvider::AddAttributes ) )
{
+ mUpdateExistingFieldCheckBox->setCheckState( Qt::Checked );
mUpdateExistingFieldCheckBox->setEnabled( false ); // must stay checked
mNewFieldGroupBox->setEnabled( false );
mNewFieldGroupBox->setTitle( mNewFieldGroupBox->title() + tr( " (not supported by provider)" ) );
+ }
+
+ if ( vl->selectedFeaturesIds().size() > 0 )
+ {
+ mOnlyUpdateSelectedCheckBox->setChecked( true );
}