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

#include "keepsecretconfig.h"

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

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

  return s_globalKeepsecretConfig()->q;
}

KeepsecretConfig *KeepsecretConfig::create(QQmlEngine *, QJSEngine *)
{
  QQmlEngine::setObjectOwnership(self(), QQmlEngine::CppOwnership);
  return self();
}

KeepsecretConfig::KeepsecretConfig( QObject *parent )
  : KConfigSkeleton()
{
  setParent(parent);
  Q_ASSERT(!s_globalKeepsecretConfig()->q);
  s_globalKeepsecretConfig()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&KeepsecretConfig::itemChanged);

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigCompilerSignallingItem  *itemSomeSetting;
  KConfigSkeleton::ItemBool  *innerItemSomeSetting;
  innerItemSomeSetting = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "someSetting" ), mSomeSetting, true );
  itemSomeSetting = new KConfigCompilerSignallingItem(innerItemSomeSetting, this, notifyFunction, signalSomeSettingChanged);
  addItem( itemSomeSetting, QStringLiteral( "someSetting" ) );
}

bool KeepsecretConfig::defaultSomeSettingValue_helper()
{

  return true;
}

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


void KeepsecretConfig::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalSomeSettingChanged:
    Q_EMIT someSettingChanged();
    break;
  }
}
