Skip to content

Commit

Permalink
Avoid deprecated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 27, 2015
1 parent ca362df commit a0405b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/qgslegacyhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

const QString QgsLegacyHelpers::convertEditType( QgsVectorLayer::EditType editType, QgsEditorWidgetConfig& cfg, QgsVectorLayer* vl, const QString& name, const QDomElement &editTypeElement )
{
Q_NOWARN_DEPRECATED_PUSH

This comment has been minimized.

Copy link
@jef-n

jef-n Nov 27, 2015

Member

shouldn't this be better ported to the new API?

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Nov 29, 2015

Author Collaborator

Well, convertEditType is deprecated too, so I usually don't bother porting stuff inside a method when the method itself will be removed at the same time as the deprecated call.

QString widgetType = "TextEdit"; // Fallback

switch ( editType )
Expand Down Expand Up @@ -202,10 +203,13 @@ const QString QgsLegacyHelpers::convertEditType( QgsVectorLayer::EditType editTy
}

return widgetType;
Q_NOWARN_DEPRECATED_POP
}

QgsVectorLayer::EditType QgsLegacyHelpers::convertEditType( const QString& editType, const QgsEditorWidgetConfig& cfg, QgsVectorLayer* vl, const QString& name )
{
Q_NOWARN_DEPRECATED_PUSH

int idx = vl->fieldNameIndex( name );

if ( !vl->fieldEditable( idx ) )
Expand Down Expand Up @@ -310,4 +314,5 @@ QgsVectorLayer::EditType QgsLegacyHelpers::convertEditType( const QString& editT
}

return QgsVectorLayer::EditorWidgetV2;
Q_NOWARN_DEPRECATED_POP
}

0 comments on commit a0405b8

Please sign in to comment.