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

#include "kokostateconfig.h"

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

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

  return s_globalState()->q;
}

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

State::State( )
  : KConfigSkeleton( KSharedConfig::openStateConfig(QStringLiteral( "") ) )
{
  Q_ASSERT(!s_globalState()->q);
  s_globalState()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&State::itemChanged);

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigCompilerSignallingItem  *itemZoom;
  KConfigSkeleton::ItemDouble  *innerItemZoom;
  innerItemZoom = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "Zoom" ), mZoom, 0 );
  itemZoom = new KConfigCompilerSignallingItem(innerItemZoom, this, notifyFunction, signalZoomChanged);
  addItem( itemZoom, QStringLiteral( "Zoom" ) );
}

double State::defaultZoomValue_helper()
{

  return 0;
}

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


void State::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalZoomChanged:
    Q_EMIT ZoomChanged();
    break;
  }
}
