Skip to content

Commit

Permalink
fix leftover and missging SIP_THROW and better dox
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 17, 2023
1 parent dd99bb0 commit 0529d60
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 113 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/settings/qgssettings.sip.in
Expand Up @@ -66,7 +66,7 @@ static bool setGlobalSettingsPath( QString path );
};


static QgsSettingsTreeElement *createPluginTreeElement( const QString &pluginName ) throw( QgsSettingsException );
static QgsSettingsTreeElement *createPluginTreeElement( const QString &pluginName );
%Docstring
Creates a settings tree element for the given ``pluginName``

Expand Down
112 changes: 59 additions & 53 deletions python/core/auto_generated/settings/qgssettingsentry.sip.in
Expand Up @@ -64,26 +64,28 @@ Transforms a dynamic key part string to list
%Docstring
Constructor for QgsSettingsEntryBase.

The ``key`` argument specifies the key of the settings.
The ``section`` argument specifies the section.
The ``defaultValue`` argument specifies the default value for the settings entry.
The ``description`` argument specifies a description for the settings entry.
The ``options`` argument specifies the options for the settings entry.
\arg key specifies the key of the settings.
\arg section specifies the section.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg options specifies the options for the settings entry.
%End

QgsSettingsEntryBase( const QString &key,
QgsSettingsTreeElement *parentTreeElement,
const QVariant &defaultValue = QVariant(),
const QString &description = QString(),
Qgis::SettingsOptions options = Qgis::SettingsOptions() );
Qgis::SettingsOptions options = Qgis::SettingsOptions() ) throw( QgsSettingsException );
%Docstring
Constructor for QgsSettingsEntryBase.

The ``key`` argument specifies the key of the settings.
The ``parent`` argument specifies the parent in the tree of settings.
The ``defaultValue`` argument specifies the default value for the settings entry.
The ``description`` argument specifies a description for the settings entry.
The ``options`` argument specifies the options for the settings entry.
\arg key specifies the key of the settings.
\arg parent specifies the parent in the tree of settings.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg options specifies the options for the settings entry.

:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End

virtual ~QgsSettingsEntryBase();
Expand All @@ -92,14 +94,14 @@ The ``options`` argument specifies the options for the settings entry.
%Docstring
Returns settings entry key.

The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End

QString key( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns settings entry key.

The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End

bool keyIsValid( const QString &key ) const;
Expand All @@ -110,7 +112,7 @@ This is useful for settings with dynamic keys. For example this permits one to c
the settings key "NewsFeed/httpsfeedqgisorg/27/content" is valid for the settings entry
defined with the key "NewsFeed/%1/%2/content"

The ``key`` to check
\arg key to check
%End

QString definitionKey() const;
Expand All @@ -136,14 +138,14 @@ Returns the settings options
%Docstring
Returns ``True`` if the settings is contained in the underlying QSettings.

The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End

bool exists( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns ``True`` if the settings is contained in the underlying QSettings.

The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End

Qgis::SettingsOrigin origin( const QStringList &dynamicKeyPartList ) const;
Expand All @@ -161,14 +163,14 @@ Returns the origin of the setting if it exists
%Docstring
Removes the settings from the underlying QSettings.

The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End

void remove( const QStringList &dynamicKeyPartList ) const;
%Docstring
Removes the settings from the underlying QSettings.

The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End

QgsSettings::Section section() const;
Expand All @@ -184,7 +186,7 @@ Returns settings section. The settings section of the parent group is returned i
Set settings value.

The ``value`` to set.
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
\arg dynamicKeyPart specifies the dynamic part of the settings key.

.. deprecated:: QGIS 3.26
use setVariantValuePrivate or an implementation setValue instead
Expand All @@ -195,20 +197,20 @@ The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
Set settings value.

The ``value`` to set.
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.

.. deprecated:: QGIS 3.26
use setVariantValuePrivate or an implementation setValue instead
%End

QVariant valueAsVariant( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns settings value with the ``dynamicKeyPart`` argument specifying the dynamic part of the settings key.
Returns settings value with \arg dynamicKeyPart specifying the dynamic part of the settings key.
%End

QVariant valueAsVariant( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns settings value with the ``dynamicKeyPart`` argument specifying the dynamic part of the settings key.
Returns settings value with \arg dynamicKeyPart specifying the dynamic part of the settings key.
%End

QVariant valueAsVariantWithDefaultOverride( const QVariant &defaultValueOverride, const QString &dynamicKeyPart = QString() ) const;
Expand All @@ -222,8 +224,8 @@ Returns settings value with a ``defaultValueOverride``
%Docstring
Returns settings value.

The ``dynamicKeyPartList`` argument specifies the list of dynamic parts of the settings key.
The ``defaultValueOverride`` argument if valid is used instead of the normal default value.
\arg dynamicKeyPartList specifies the list of dynamic parts of the settings key.
\arg defaultValueOverride if valid is used instead of the normal default value.

.. versionadded:: 3.26
%End
Expand Down Expand Up @@ -358,11 +360,13 @@ Base abstract class for settings entry which are passed by reference
%Docstring
Constructor for QgsSettingsEntryByReference.

The ``key`` argument specifies the key of the settings.
The ``parent`` argument specifies the parent in the tree of settings.
The ``defaultValue`` argument specifies the default value for the settings entry.
The ``description`` argument specifies a description for the settings entry.
The ``options`` arguments specifies the options for the settings entry.
\arg key specifies the key of the settings.
\arg parent specifies the parent in the tree of settings.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg optionss specifies the options for the settings entry.

:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End

QgsSettingsEntryByReference( const QString &key,
Expand All @@ -373,11 +377,11 @@ The ``options`` arguments specifies the options for the settings entry.
%Docstring
Constructor for QgsSettingsEntryByReference.

The ``key`` argument specifies the key of the settings.
The ``section`` argument specifies the section.
The ``defaultValue`` argument specifies the default value for the settings entry.
The ``description`` argument specifies a description for the settings entry.
The ``options`` arguments specifies the options for the settings entry.
\arg key specifies the key of the settings.
\arg section specifies the section.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg optionss specifies the options for the settings entry.
%End


Expand Down Expand Up @@ -429,15 +433,15 @@ Returns the settings value for the ``dynamicKeyPartList`` and with a ``defaultV
Set settings value.

The ``value`` to set.
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End

bool setValue( const T &value, const QStringList &dynamicKeyPartList ) const;
%Docstring
Set settings value.

The ``value`` to set.
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End

T defaultValue() const;
Expand Down Expand Up @@ -503,23 +507,25 @@ Base abstract class for settings entry which are passed by value
%Docstring
Constructor for QgsSettingsEntryByValue.

The ``key`` argument specifies the key of the settings.
The ``parent`` argument specifies the parent in the tree of settings.
The ``section`` argument specifies the section.
The ``defaultValue`` argument specifies the default value for the settings entry.
The ``description`` argument specifies a description for the settings entry.
The ``options`` arguments specifies the options for the settings entry.
\arg key specifies the key of the settings.
\arg parent specifies the parent in the tree of settings.
\arg section specifies the section.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg optionss specifies the options for the settings entry.

:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End

QgsSettingsEntryByValue( const QString &key, const QString &section, QVariant defaultValue, const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() );
%Docstring
Constructor for QgsSettingsEntryByValue.

The ``key`` argument specifies the key of the settings.
The ``section`` argument specifies the section.
The ``defaultValue`` argument specifies the default value for the settings entry.
The ``description`` argument specifies a description for the settings entry.
The ``options`` arguments specifies the options for the settings entry.
\arg key specifies the key of the settings.
\arg section specifies the section.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg optionss specifies the options for the settings entry.
%End

virtual Qgis::SettingsType settingsType() const = 0;
Expand All @@ -528,16 +534,16 @@ The ``options`` arguments specifies the options for the settings entry.
%Docstring
Returns settings value.

The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
The ``defaultValueOverride`` argument if valid is used instead of the normal default value.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
\arg defaultValueOverride if valid is used instead of the normal default value.
%End

T value( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns settings value.

The ``dynamicKeyPartList`` argument specifies the list of dynamic parts of the settings key.
The ``defaultValueOverride`` argument if valid is used instead of the normal default value.
\arg dynamicKeyPartList specifies the list of dynamic parts of the settings key.
\arg defaultValueOverride if valid is used instead of the normal default value.
%End

T valueWithDefaultOverride( T defaultValueOverride, const QString &dynamicKeyPart = QString() ) const;
Expand Down Expand Up @@ -571,15 +577,15 @@ Returns the settings value for the ``dynamicKeyPartList`` and with a ``defaultV
Set settings value.

The ``value`` to set.
The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End

bool setValue( T value, const QStringList &dynamicKeyPartList ) const;
%Docstring
Set settings value.

The ``value`` to set.
The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End

T defaultValue() const;
Expand Down
19 changes: 17 additions & 2 deletions python/core/auto_generated/settings/qgssettingstreeelement.sip.in
Expand Up @@ -64,6 +64,9 @@ to automatically register a settings entry on its creation when a parent is prov
QgsSettingsTreeElement *createChildElement( const QString &key ) throw( QgsSettingsException ) /KeepReference/;
%Docstring
Creates a normal tree element
It will return the existing child element if it exists at the given key

:raises QgsSettingsException: if a setting exists with the same key
%End

QgsSettingsTreeNamedListElement *createNamedListElement( const QString &key, const QgsSettingsTreeElement::Options &options = QgsSettingsTreeElement::Options() ) throw( QgsSettingsException ) /KeepReference/;
Expand Down Expand Up @@ -91,7 +94,9 @@ Registers a child setting

.. note::

This is automatically done when calling the setting's constructor with the parent argument
The registration is automatically done when calling the setting's constructor with the parent argument signature

:raises QgsSettingsException: if a setting exists with the same key
%End

void unregisterChildSetting( const QgsSettingsEntryBase *setting, bool deleteSettingValues = false, const QStringList &parentsNamedItems = QStringList() );
Expand Down Expand Up @@ -157,7 +162,7 @@ Returns the number of named elements in the complete key
%End

protected:
void registerChildElement( QgsSettingsTreeElement *element ) throw( QgsSettingsException );
void registerChildElement( QgsSettingsTreeElement *element );
%Docstring
Registers a child elements
%End
Expand Down Expand Up @@ -206,6 +211,8 @@ the named list element is used to store a group of settings under a dynamically
Returns the list of items

:param parentsNamedItems: the list of named items in the parent named list (if any)

:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End

QStringList items( Qgis::SettingsOrigin origin, const QStringList &parentsNamedItems = QStringList() ) const throw( QgsSettingsException );
Expand All @@ -214,6 +221,8 @@ Returns the list of items

:param origin: can be used to restrict the origin of the setting (local or global)
:param parentsNamedItems: the list of named items in the parent named list (if any)

:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End


Expand All @@ -223,13 +232,17 @@ Sets the selected named item from the named list element

:param item: the item to set as selected
:param parentsNamedItems: the list of named items in the parent named list (if any)

:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End

QString selectedItem( const QStringList &parentsNamedItems = QStringList() ) throw( QgsSettingsException );
%Docstring
Returns the selected named item from the named list element

:param parentsNamedItems: the list of named items in the parent named list (if any)

:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End

void deleteItem( const QString &item, const QStringList &parentsNamedItems = QStringList() ) throw( QgsSettingsException );
Expand All @@ -238,6 +251,8 @@ Deletes a named item from the named list element

:param item: the item to delete
:param parentsNamedItems: the list of named items in the parent named list (if any)

:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End

const QgsSettingsEntryString *selectedItemSetting() const;
Expand Down
2 changes: 1 addition & 1 deletion src/core/settings/qgssettings.h
Expand Up @@ -117,7 +117,7 @@ class CORE_EXPORT QgsSettings : public QObject
* Creates a settings tree element for the given \a pluginName
* \since QGIS 3.30
*/
static QgsSettingsTreeElement *createPluginTreeElement( const QString &pluginName ) SIP_THROW( QgsSettingsException );
static QgsSettingsTreeElement *createPluginTreeElement( const QString &pluginName );


/**
Expand Down

0 comments on commit 0529d60

Please sign in to comment.