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

#include "settings.h"

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

class SettingsHelper
{
  public:
    SettingsHelper() noexcept : q(nullptr) {}
    ~SettingsHelper() noexcept { delete q; q = nullptr; }
    SettingsHelper(const SettingsHelper&) = delete;
    SettingsHelper& operator=(const SettingsHelper&) = delete;
    Settings *q;
};
Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings()->q) {
    new Settings;
    s_globalSettings()->q->read();
  }

  return s_globalSettings()->q;
}

Settings::Settings( )
  : KConfigSkeleton( QStringLiteral( "steprc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemBool  *itemShowCreationTips;
  itemShowCreationTips = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showCreationTips" ), mShowCreationTips, true );
  addItem( itemShowCreationTips, QStringLiteral( "showCreationTips" ) );
  KConfigSkeleton::ItemBool  *itemShowAxes;
  itemShowAxes = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showAxes" ), mShowAxes, true );
  addItem( itemShowAxes, QStringLiteral( "showAxes" ) );
  KConfigSkeleton::ItemInt  *itemFloatDisplayPrecision;
  itemFloatDisplayPrecision = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "floatDisplayPrecision" ), mFloatDisplayPrecision, 4 );
  itemFloatDisplayPrecision->setMinValue(1);
  itemFloatDisplayPrecision->setMaxValue(15);
  addItem( itemFloatDisplayPrecision, QStringLiteral( "floatDisplayPrecision" ) );
  KConfigSkeleton::ItemBool  *itemEnableOpenGL;
  itemEnableOpenGL = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "enableOpenGL" ), mEnableOpenGL, false );
  addItem( itemEnableOpenGL, QStringLiteral( "enableOpenGL" ) );

  setCurrentGroup( QStringLiteral( "InfoBrowser" ) );

  KConfigSkeleton::ItemBool  *itemWikiExternal;
  itemWikiExternal = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "wikiExternal" ), mWikiExternal, false );
  addItem( itemWikiExternal, QStringLiteral( "wikiExternal" ) );

  setCurrentGroup( QStringLiteral( "ItemPalette" ) );

  KConfigSkeleton::ItemBool  *itemShowButtonText;
  itemShowButtonText = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showButtonText" ), mShowButtonText, true );
  addItem( itemShowButtonText, QStringLiteral( "showButtonText" ) );
}

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

