Skip to content

Commit fd83fc0

Browse files
committed
fixup
1 parent 77ae82d commit fd83fc0

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

python/PyQt6/core/auto_additions/qgsattributetableconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
QgsAttributeTableConfig.ButtonList = QgsAttributeTableConfig.ActionWidgetStyle.ButtonList
55
QgsAttributeTableConfig.DropDown = QgsAttributeTableConfig.ActionWidgetStyle.DropDown
66
# monkey patching scoped based enum
7-
QgsAttributeTableConfig.AddFeatureMethod.None.__doc__ = "No mod e set yet in the current layer"
7+
QgsAttributeTableConfig.AddFeatureMethod.Unset.__doc__ = "No method set for current layer"
88
QgsAttributeTableConfig.AddFeatureMethod.Form.__doc__ = "Opens a new Attributeform-Dialog"
99
QgsAttributeTableConfig.AddFeatureMethod.Table.__doc__ = "Adds a new row (or a form embedded in the attribute table depending on the view)"
1010
QgsAttributeTableConfig.AddFeatureMethod.__doc__ = """The way how to add features in the attribute table
1111
12-
* ``None``: No mod e set yet in the current layer
12+
* ``Unset``: No method set for current layer
1313
* ``Form``: Opens a new Attributeform-Dialog
1414
* ``Table``: Adds a new row (or a form embedded in the attribute table depending on the view)
1515

python/PyQt6/core/auto_generated/qgsattributetableconfig.sip.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The configuration is specific for one vector layer.
5050

5151
enum class AddFeatureMethod /BaseType=IntEnum/
5252
{
53-
None,
53+
Unset,
5454
Form,
5555
Table
5656
};
@@ -148,8 +148,8 @@ Set the sort expression used for sorting.
148148

149149
AddFeatureMethod addFeatureMethod() const;
150150
%Docstring
151-
Gets the addFeatureMethod that defines how features are added (single
152-
form or embedded in a table).
151+
Returns the method that defines how features are added (single form or
152+
embedded in a table).
153153

154154
.. seealso:: :py:func:`setAddFeatureMethod`
155155

src/app/qgsattributetabledialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QgsAttr
168168
mAddFeatureButton->addAction( mActionAddFeatureViaAttributeForm );
169169

170170
//set the add feature method according to the layer settings or as fall back use the last one
171-
QgsAttributeTableConfig::AddFeatureMethod method = QgsAttributeTableConfig::AddFeatureMethod::None;
171+
QgsAttributeTableConfig::AddFeatureMethod method = QgsAttributeTableConfig::AddFeatureMethod::Unset;
172172
if ( mLayer )
173173
method = mLayer->attributeTableConfig().addFeatureMethod();
174-
if ( method == QgsAttributeTableConfig::AddFeatureMethod::None )
174+
if ( method == QgsAttributeTableConfig::AddFeatureMethod::Unset )
175175
{
176176
const QString lastMethod = settings.value( u"/qgis/attributeTableLastAddFeatureMethod"_s ).toString();
177177
method = ( lastMethod == "attributeForm"_L1 ) ? QgsAttributeTableConfig::AddFeatureMethod::Form : QgsAttributeTableConfig::AddFeatureMethod::Table;

src/core/qgsattributetableconfig.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ void QgsAttributeTableConfig::writeXml( QDomNode &node ) const
288288

289289
configElement.setAttribute( u"sortOrder"_s, mSortOrder );
290290

291-
configElement.setAttribute( u"addFeatureMethod"_s, mAddFeatureMethod == AddFeatureMethod::Form ? "form" : "table" );
291+
if ( mAddFeatureMethod != AddFeatureMethod::Unset )
292+
configElement.setAttribute( u"addFeatureMethod"_s, mAddFeatureMethod == AddFeatureMethod::Form ? "form" : "table" );
292293

293294
QDomElement columnsElement = doc.createElement( u"columns"_s );
294295

src/core/qgsattributetableconfig.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ class CORE_EXPORT QgsAttributeTableConfig
8282
*/
8383
enum class AddFeatureMethod : int
8484
{
85-
None, //!< No mod e set yet in the current layer
86-
Form, //!< Opens a new Attributeform-Dialog
87-
Table //!< Adds a new row (or a form embedded in the attribute table depending on the view)
85+
Unset, //!< No method set for current layer
86+
Form, //!< Opens a new Attributeform-Dialog
87+
Table //!< Adds a new row (or a form embedded in the attribute table depending on the view)
8888
};
8989

9090
QgsAttributeTableConfig() = default;
@@ -178,7 +178,7 @@ class CORE_EXPORT QgsAttributeTableConfig
178178
void setSortExpression( const QString &sortExpression );
179179

180180
/**
181-
* Gets the addFeatureMethod that defines how features are added (single form or embedded in a table).
181+
* Returns the method that defines how features are added (single form or embedded in a table).
182182
* \see setAddFeatureMethod()
183183
* \since QGIS 4.2
184184
*/
@@ -342,7 +342,7 @@ class CORE_EXPORT QgsAttributeTableConfig
342342
ActionWidgetStyle mActionWidgetStyle = DropDown;
343343
QString mSortExpression;
344344
Qt::SortOrder mSortOrder = Qt::AscendingOrder;
345-
AddFeatureMethod mAddFeatureMethod = AddFeatureMethod::None;
345+
AddFeatureMethod mAddFeatureMethod = AddFeatureMethod::Unset;
346346

347347
};
348348

0 commit comments

Comments
 (0)