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

#include "KJotsSettings.h"

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

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

  return s_globalKJotsSettings()->q;
}

KJotsSettings::KJotsSettings( )
  : KConfigSkeleton( QStringLiteral( "kjotsrc" ) )
{
  Q_ASSERT(!s_globalKJotsSettings()->q);
  s_globalKJotsSettings()->q = this;
  setCurrentGroup( QStringLiteral( "kjots" ) );

  KConfigSkeleton::ItemBool  *itemAutoSave;
  itemAutoSave = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AutoSave" ), mAutoSave, true );
  addItem( itemAutoSave, QStringLiteral( "AutoSave" ) );
  KConfigSkeleton::ItemInt  *itemAutoSaveInterval;
  itemAutoSaveInterval = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "AutoSaveInterval" ), mAutoSaveInterval, 5 );
  addItem( itemAutoSaveInterval, QStringLiteral( "AutoSaveInterval" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesViewMode;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TwoColumn");
    valuesViewMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("ThreeColumn");
    valuesViewMode.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemViewMode;
  itemViewMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "ViewMode" ), mViewMode, valuesViewMode, 2 );
  addItem( itemViewMode, QStringLiteral( "ViewMode" ) );
}

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

