Skip to content

Commit

Permalink
Address review: rename method to be more API compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
gacarrillor committed Oct 17, 2024
1 parent e696fae commit 3fa61a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/gui/vector/qgsdiagramproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ std::unique_ptr< QgsDiagram > QgsDiagramProperties::createDiagramObject()
std::unique_ptr<QgsDiagramSettings> QgsDiagramProperties::createDiagramSettings()
{
std::unique_ptr< QgsDiagramSettings > ds = std::make_unique< QgsDiagramSettings>();
ds->enabled = enabledDiagram();
ds->enabled = isDiagramEnabled();
ds->font = mDiagramFontButton->currentFont();
ds->opacity = mOpacityWidget->opacity();

Expand Down Expand Up @@ -1046,7 +1046,7 @@ void QgsDiagramProperties::apply()
QgsSettings settings;
if ( !dockMode() || !settings.value( QStringLiteral( "UI/autoApplyStyling" ), true ).toBool() )
{
if ( enabledDiagram() && 0 == mDiagramAttributesTreeWidget->topLevelItemCount() )
if ( isDiagramEnabled() && 0 == mDiagramAttributesTreeWidget->topLevelItemCount() )
{
QMessageBox::warning( this, tr( "Diagrams: No attributes added." ),
tr( "You did not add any attributes to this diagram layer. Please specify the attributes to visualize on the diagrams or disable diagrams." ) );
Expand Down Expand Up @@ -1325,7 +1325,7 @@ void QgsDiagramProperties::setDiagramEnabled( bool enabled )
mEnableDiagramCheckBox->setChecked( enabled );
}

bool QgsDiagramProperties::enabledDiagram() const
bool QgsDiagramProperties::isDiagramEnabled() const
{
return mEnableDiagramCheckBox->isChecked();
}
4 changes: 2 additions & 2 deletions src/gui/vector/qgsdiagramproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ class GUI_EXPORT QgsDiagramProperties : public QgsPanelWidget, private Ui::QgsDi

/**
* Sets widgets to reflect the \a enabled status of the diagram.
* @param enabled Whether the diagram is enabled or not.
* \param enabled Whether the diagram is enabled or not.
*/
void setDiagramEnabled( const bool enabled );

/**
* Returns whether the current diagram should be enabled or not,
* according to changes in the corresponding widgets.
*/
bool enabledDiagram() const;
bool isDiagramEnabled() const;

friend class QgsStackedDiagramProperties;
friend class QgsStackedDiagramPropertiesDialog;
Expand Down

0 comments on commit 3fa61a0

Please sign in to comment.