Skip to content

Commit a2a10e9

Browse files
committedDec 6, 2015
more precise fixes (followup be81716)
1 parent 91f7918 commit a2a10e9

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed
 

‎src/app/qgsfieldsproperties.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,11 @@ void QgsFieldsProperties::on_mMoveUpItem_clicked()
465465
void QgsFieldsProperties::on_mInitCodeSourceComboBox_currentIndexChanged( int codeSource )
466466
{
467467
// Show or hide ui elements as needed
468-
mInitFunctionContainer->setVisible( codeSource != QgsEditFormConfig::PythonInitCodeSource::CodeSourceNone );
469-
mPythonInitCodeGroupBox->setVisible( codeSource == QgsEditFormConfig::PythonInitCodeSource::CodeSourceDialog );
470-
mInitFilePathLineEdit->setVisible( codeSource == QgsEditFormConfig::PythonInitCodeSource::CodeSourceFile );
471-
mInitFilePathLabel->setVisible( codeSource == QgsEditFormConfig::PythonInitCodeSource::CodeSourceFile );
472-
pbtnSelectInitFilePath->setVisible( codeSource == QgsEditFormConfig::PythonInitCodeSource::CodeSourceFile );
468+
mInitFunctionContainer->setVisible( codeSource != QgsEditFormConfig::CodeSourceNone );
469+
mPythonInitCodeGroupBox->setVisible( codeSource == QgsEditFormConfig::CodeSourceDialog );
470+
mInitFilePathLineEdit->setVisible( codeSource == QgsEditFormConfig::CodeSourceFile );
471+
mInitFilePathLabel->setVisible( codeSource == QgsEditFormConfig::CodeSourceFile );
472+
pbtnSelectInitFilePath->setVisible( codeSource == QgsEditFormConfig::CodeSourceFile );
473473
}
474474

475475
void QgsFieldsProperties::attributeTypeDialog()

‎src/app/qgsvectorlayerproperties.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,10 @@ void QgsVectorLayerProperties::loadDefaultStyle_clicked()
730730

731731
switch ( askToUser.exec() )
732732
{
733-
case( 0 ):
733+
case 0:
734734
return;
735735
break;
736-
case( 2 ):
736+
case 2:
737737
msg = layer->loadNamedStyle( layer->styleURI(), defaultLoadedFlag );
738738
if ( !defaultLoadedFlag )
739739
{
@@ -787,10 +787,10 @@ void QgsVectorLayerProperties::saveDefaultStyle_clicked()
787787

788788
switch ( askToUser.exec() )
789789
{
790-
case( 0 ):
790+
case 0:
791791
return;
792792
break;
793-
case( 2 ):
793+
case 2:
794794
layer->saveStyleToDatabase( "", "", true, "", errorMsg );
795795
if ( errorMsg.isNull() )
796796
{

‎src/core/qgsvectorlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage
18011801
int dotPos = initFunction.lastIndexOf( '.' );
18021802
if ( dotPos >= 0 ) // It's a module
18031803
{
1804-
mEditFormConfig->setInitCodeSource( QgsEditFormConfig::PythonInitCodeSource::CodeSourceDialog );
1804+
mEditFormConfig->setInitCodeSource( QgsEditFormConfig::CodeSourceDialog );
18051805
mEditFormConfig->setInitFunction( initFunction.mid( dotPos + 1 ) );
18061806
mEditFormConfig->setInitCode( QString( "from %1 import %2\n" ).arg( initFunction.left( dotPos ), initFunction.mid( dotPos + 1 ) ) );
18071807
}

‎src/gui/qgsattributeform.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ void QgsAttributeForm::initPython()
580580
// Init Python, if init function is not empty and the combo indicates
581581
// the source for the function code
582582
if ( !mLayer->editFormConfig()->initFunction().isEmpty()
583-
&& mLayer->editFormConfig()->initCodeSource() != QgsEditFormConfig::PythonInitCodeSource::CodeSourceNone )
583+
&& mLayer->editFormConfig()->initCodeSource() != QgsEditFormConfig::CodeSourceNone )
584584
{
585585

586586
QString initFunction = mLayer->editFormConfig()->initFunction();
@@ -589,7 +589,7 @@ void QgsAttributeForm::initPython()
589589

590590
switch ( mLayer->editFormConfig()->initCodeSource() )
591591
{
592-
case QgsEditFormConfig::PythonInitCodeSource::CodeSourceFile:
592+
case QgsEditFormConfig::CodeSourceFile:
593593
if ( ! initFilePath.isEmpty() )
594594
{
595595
QFile inputFile( initFilePath );
@@ -612,16 +612,16 @@ void QgsAttributeForm::initPython()
612612
}
613613
break;
614614

615-
case( QgsEditFormConfig::PythonInitCodeSource::CodeSourceDialog ):
615+
case QgsEditFormConfig::CodeSourceDialog:
616616
initCode = mLayer->editFormConfig()->initCode();
617617
if ( initCode.isEmpty() )
618618
{
619619
QgsLogger::warning( QString( "The python code provided in the dialog is empty!" ) );
620620
}
621621
break;
622622

623-
case( QgsEditFormConfig::PythonInitCodeSource::CodeSourceEnvironment ):
624-
case( QgsEditFormConfig::PythonInitCodeSource::CodeSourceNone ):
623+
case QgsEditFormConfig::CodeSourceEnvironment:
624+
case QgsEditFormConfig::CodeSourceNone:
625625
default:
626626
// Nothing to do: the function code should be already in the environment
627627
break;

0 commit comments

Comments
 (0)
Please sign in to comment.