Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #5229 from m-kuhn/cleanCode
Clean code
  • Loading branch information
m-kuhn committed Sep 21, 2017
2 parents 6e5324b + 846fef2 commit 06dc966
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
2 changes: 2 additions & 0 deletions python/gui/qgsmaplayerconfigwidgetfactory.sip
Expand Up @@ -69,6 +69,7 @@ Constructor
virtual bool supportsStyleDock() const;
%Docstring
Flag if widget is supported for use in style dock.
The default implementation returns false.
:return: True if supported
:rtype: bool
%End
Expand All @@ -82,6 +83,7 @@ Constructor
virtual bool supportLayerPropertiesDialog() const;
%Docstring
Flag if widget is supported for use in layer properties dialog.
The default implementation returns false.
:return: True if supported
:rtype: bool
%End
Expand Down
31 changes: 19 additions & 12 deletions src/app/qgsvectorlayerproperties.h
Expand Up @@ -59,17 +59,27 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
QgsVectorLayerProperties( QgsVectorLayer *lyr = nullptr, QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );

//! Returns the display name entered in the dialog
QString displayName();
void setRendererDirty( bool ) {}
QString displayName()
{
return txtDisplayName->text();
}

/** Adds an attribute to the table (but does not commit it yet)
\param field the field to add
\returns false in case of a name conflict, true in case of success */
/**
* Adds an attribute to the layer.
* The layer will need to be in edit mode. It will only be added to the provider when the edit buffer
* is committed.
* \param field the field to add
* \returns false in case of a name conflict, true in case of success
*/
bool addAttribute( const QgsField &field );

/** Deletes an attribute (but does not commit it)
\param name attribute name
\returns false in case of a non-existing attribute.*/
/**
* Deletes an attribute.
* The layer will need to be in edit mode. It will only be added to the provider when the edit buffer
* is committed.
* \param name attribute name
* \returns false in case of a non-existing attribute.
*/
bool deleteAttribute( int attr );

//! Adds a properties page factory to the vector layer properties dialog.
Expand Down Expand Up @@ -206,8 +216,5 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
void openPanel( QgsPanelWidget *panel );
};

inline QString QgsVectorLayerProperties::displayName()
{
return txtDisplayName->text();
}

#endif
2 changes: 2 additions & 0 deletions src/gui/qgsmaplayerconfigwidgetfactory.h
Expand Up @@ -70,6 +70,7 @@ class GUI_EXPORT QgsMapLayerConfigWidgetFactory

/**
* Flag if widget is supported for use in style dock.
* The default implementation returns false.
* \returns True if supported
*/
virtual bool supportsStyleDock() const { return false; }
Expand All @@ -82,6 +83,7 @@ class GUI_EXPORT QgsMapLayerConfigWidgetFactory

/**
* Flag if widget is supported for use in layer properties dialog.
* The default implementation returns false.
* \returns True if supported
*/
virtual bool supportLayerPropertiesDialog() const { return false; }
Expand Down

0 comments on commit 06dc966

Please sign in to comment.