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

#include "kruler.h"

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

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

  return s_globalRulerSettings()->q;
}

RulerSettings::RulerSettings( )
  : KConfigSkeleton( QStringLiteral( "krulerrc" ) )
{
  Q_ASSERT(!s_globalRulerSettings()->q);
  s_globalRulerSettings()->q = this;
  setCurrentGroup( QStringLiteral( "StoredSettings" ) );

  KConfigSkeleton::ItemColor  *itemBgColor;
  itemBgColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "BgColor" ), mBgColor, QColor(255, 200, 80) );
  addItem( itemBgColor, QStringLiteral( "BgColor" ) );
  KConfigSkeleton::ItemInt  *itemLength;
  itemLength = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Length" ), mLength, 600 );
  addItem( itemLength, QStringLiteral( "Length" ) );
  KConfigSkeleton::ItemFont  *itemScaleFont;
  itemScaleFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "ScaleFont" ), mScaleFont, QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont) );
  addItem( itemScaleFont, QStringLiteral( "ScaleFont" ) );
  KConfigSkeleton::ItemBool  *itemHorizontal;
  itemHorizontal = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Horizontal" ), mHorizontal, true );
  addItem( itemHorizontal, QStringLiteral( "Horizontal" ) );
  KConfigSkeleton::ItemBool  *itemLeftToRight;
  itemLeftToRight = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "LeftToRight" ), mLeftToRight, true );
  addItem( itemLeftToRight, QStringLiteral( "LeftToRight" ) );
  KConfigSkeleton::ItemInt  *itemOffset;
  itemOffset = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Offset" ), mOffset, 0 );
  addItem( itemOffset, QStringLiteral( "Offset" ) );
  KConfigSkeleton::ItemBool  *itemRelativeScale;
  itemRelativeScale = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RelativeScale" ), mRelativeScale, false );
  addItem( itemRelativeScale, QStringLiteral( "RelativeScale" ) );
  KConfigSkeleton::ItemBool  *itemTrayIcon;
  itemTrayIcon = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TrayIcon" ), mTrayIcon, false );
  addItem( itemTrayIcon, QStringLiteral( "TrayIcon" ) );
  KConfigSkeleton::ItemInt  *itemOpacity;
  itemOpacity = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Opacity" ), mOpacity, 255 );
  addItem( itemOpacity, QStringLiteral( "Opacity" ) );
  KConfigSkeleton::ItemBool  *itemAlwaysOnTop;
  itemAlwaysOnTop = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AlwaysOnTop" ), mAlwaysOnTop, true );
  addItem( itemAlwaysOnTop, QStringLiteral( "AlwaysOnTop" ) );
}

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

