Skip to content

Commit

Permalink
add settings registry to app
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 28, 2022
1 parent 8ec0dc5 commit 2c13d72
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/app/qgssettingsregistryapp.cpp
@@ -0,0 +1,38 @@
/***************************************************************************
qgssettingsregistryapp.h
----------------------
begin : January 2022
copyright : (C) 2022 by Denis Rouzaud
email : denis@opengis.ch
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgssettingsregistrycore.h"
#include "qgssettingsregistryapp.h"
#include "qgsapplication.h"

#include "qgsmaptoolsdigitizingtechniquemanager.h"


QgsSettingsRegistryApp::QgsSettingsRegistryApp()
: QgsSettingsRegistry()
{
addSettingsEntry( &QgsMapToolsDigitizingTechniqueManager::settingsDigitizingTechnique );
addSettingsEntry( &QgsMapToolsDigitizingTechniqueManager::settingMapToolShapeDefaultForShape );
addSettingsEntry( &QgsMapToolsDigitizingTechniqueManager::settingMapToolShapeCurrent );

QgsApplication::settingsRegistryCore()->addSubRegistry( this );
}

QgsSettingsRegistryApp::~QgsSettingsRegistryApp()
{
QgsApplication::settingsRegistryCore()->removeSubRegistry( this );
}
32 changes: 32 additions & 0 deletions src/app/qgssettingsregistryapp.h
@@ -0,0 +1,32 @@
/***************************************************************************
qgssettingsregistryapp.cpp
----------------------
begin : January 2022
copyright : (C) 2022 by Denis Rouzaud
email : denis@opengis.ch
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSSETTINGSREGISTRYAPP_H
#define QGSSETTINGSREGISTRYAPP_H

#include "qgisapp.h"
#include "qgis_sip.h"
#include "qgssettingsregistry.h"

class APP_EXPORT QgsSettingsRegistryApp : public QgsSettingsRegistry
{
public:
QgsSettingsRegistryApp();
~QgsSettingsRegistryApp();
};

#endif // QGSSETTINGSREGISTRYAPP_H

0 comments on commit 2c13d72

Please sign in to comment.