// This file is generated by kconfig_compiler_kf6 from palapeli.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( "palapelirc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Puzzling" ) );

  KConfigSkeleton::ItemInt  *itemSnappingPrecision;
  itemSnappingPrecision = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SnappingPrecision" ), mSnappingPrecision, 20 );
  addItem( itemSnappingPrecision, QStringLiteral( "SnappingPrecision" ) );

  setCurrentGroup( QStringLiteral( "Appearance" ) );

  KConfigSkeleton::ItemString  *itemViewBackground;
  itemViewBackground = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "ViewBackground" ), mViewBackground, QStringLiteral( "background.svg" ) );
  addItem( itemViewBackground, QStringLiteral( "ViewBackground" ) );
  KConfigSkeleton::ItemColor  *itemViewBackgroundColor;
  itemViewBackgroundColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "ViewBackgroundColor" ), mViewBackgroundColor, QColor( "#fff7eb" ) );
  addItem( itemViewBackgroundColor, QStringLiteral( "ViewBackgroundColor" ) );
  KConfigSkeleton::ItemColor  *itemViewHighlightColor;
  itemViewHighlightColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "ViewHighlightColor" ), mViewHighlightColor, QColor( "#6effff" ) );
  addItem( itemViewHighlightColor, QStringLiteral( "ViewHighlightColor" ) );
  KConfigSkeleton::ItemInt  *itemSolutionArea;
  itemSolutionArea = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SolutionArea" ), mSolutionArea, 0 );
  addItem( itemSolutionArea, QStringLiteral( "SolutionArea" ) );
  KConfigSkeleton::ItemInt  *itemPieceSpacing;
  itemPieceSpacing = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "PieceSpacing" ), mPieceSpacing, 6 );
  addItem( itemPieceSpacing, QStringLiteral( "PieceSpacing" ) );
  KConfigSkeleton::ItemBool  *itemShowStatusBar;
  itemShowStatusBar = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowStatusBar" ), mShowStatusBar, true );
  addItem( itemShowStatusBar, QStringLiteral( "ShowStatusBar" ) );
  KConfigSkeleton::ItemBool  *itemPieceShadowsEnabled;
  itemPieceShadowsEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PieceShadowsEnabled" ), mPieceShadowsEnabled, false );
  addItem( itemPieceShadowsEnabled, QStringLiteral( "PieceShadowsEnabled" ) );
  KConfigSkeleton::ItemBool  *itemPieceBevelsEnabled;
  itemPieceBevelsEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PieceBevelsEnabled" ), mPieceBevelsEnabled, false );
  addItem( itemPieceBevelsEnabled, QStringLiteral( "PieceBevelsEnabled" ) );

  setCurrentGroup( QStringLiteral( "PuzzlePreview" ) );

  KConfigSkeleton::ItemBool  *itemPuzzlePreviewVisible;
  itemPuzzlePreviewVisible = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PuzzlePreviewVisible" ), mPuzzlePreviewVisible, true );
  addItem( itemPuzzlePreviewVisible, QStringLiteral( "PuzzlePreviewVisible" ) );
  KConfigSkeleton::ItemRect  *itemPuzzlePreviewGeometry;
  itemPuzzlePreviewGeometry = new KConfigSkeleton::ItemRect( currentGroup(), QStringLiteral( "PuzzlePreviewGeometry" ), mPuzzlePreviewGeometry, QRect(-1, -1, 320, 240) );
  addItem( itemPuzzlePreviewGeometry, QStringLiteral( "PuzzlePreviewGeometry" ) );
}

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

