// 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() noexcept : q(nullptr) {}
    ~KeepSecretConfigHelper() noexcept { 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;
  }
}
