// This file is generated by kconfig_compiler_kf6 from portfoliosettings.kcfg.
// All changes you do to this file will be lost.

#include "portfoliosettings.h"

#include <qglobal.h>
#include <QFile>

class PortfolioSettingsHelper
{
  public:
    PortfolioSettingsHelper() : q(nullptr) {}
    ~PortfolioSettingsHelper() { delete q; q = nullptr; }
    PortfolioSettingsHelper(const PortfolioSettingsHelper&) = delete;
    PortfolioSettingsHelper& operator=(const PortfolioSettingsHelper&) = delete;
    PortfolioSettings *q;
};
Q_GLOBAL_STATIC(PortfolioSettingsHelper, s_globalPortfolioSettings)
PortfolioSettings *PortfolioSettings::self()
{
  if (!s_globalPortfolioSettings()->q) {
    new PortfolioSettings;
    s_globalPortfolioSettings()->q->read();
  }

  return s_globalPortfolioSettings()->q;
}

PortfolioSettings::PortfolioSettings( )
  : ConfigSkeleton()
{
  Q_ASSERT(!s_globalPortfolioSettings()->q);
  s_globalPortfolioSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Documentation" ) );

  ConfigSkeleton::ItemString  *itemDocumentationPath;
  itemDocumentationPath = new ConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "DocumentationPath" ), mDocumentationPath, QStringLiteral( "help:" ) );
  addItem( itemDocumentationPath, QStringLiteral( "DocumentationPath" ) );
  ConfigSkeleton::ItemString  *itemContextPath;
  itemContextPath = new ConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "ContextPath" ), mContextPath, QStringLiteral( "help:" ) );
  addItem( itemContextPath, QStringLiteral( "ContextPath" ) );
  ConfigSkeleton::ItemString  *itemContextLanguage;
  itemContextLanguage = new ConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "ContextLanguage" ), mContextLanguage );
  addItem( itemContextLanguage, QStringLiteral( "ContextLanguage" ) );

  setCurrentGroup( QStringLiteral( "Interface" ) );

  ConfigSkeleton::ItemInt  *itemAutoSave;
  itemAutoSave = new ConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "AutoSave" ), mAutoSave, 5 );
  addItem( itemAutoSave, QStringLiteral( "AutoSave" ) );
  ConfigSkeleton::ItemBool  *itemCreateBackupFile;
  itemCreateBackupFile = new ConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "CreateBackupFile" ), mCreateBackupFile, true );
  addItem( itemCreateBackupFile, QStringLiteral( "CreateBackupFile" ) );
}

PortfolioSettings::~PortfolioSettings()
{
  if (s_globalPortfolioSettings.exists() && !s_globalPortfolioSettings.isDestroyed()) {
    s_globalPortfolioSettings()->q = nullptr;
  }
}

