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

#include "stateconfig.h"

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

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

  return s_globalStateConfig()->q;
}

StateConfig::StateConfig( QObject *parent )
  : KConfigSkeleton( KSharedConfig::openStateConfig(QStringLiteral( "keysmithstaterc") ) )
{
  setParent(parent);
  Q_ASSERT(!s_globalStateConfig()->q);
  s_globalStateConfig()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&StateConfig::itemChanged);

  setCurrentGroup( QStringLiteral( "Camera" ) );

  KConfigCompilerSignallingItem  *itemLastCameraId;
  KConfigSkeleton::ItemString  *innerItemLastCameraId;
  innerItemLastCameraId = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "LastCameraId" ), mLastCameraId );
  itemLastCameraId = new KConfigCompilerSignallingItem(innerItemLastCameraId, this, notifyFunction, signalLastCameraIdChanged);
  addItem( itemLastCameraId, QStringLiteral( "LastCameraId" ) );
}

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


void StateConfig::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalLastCameraIdChanged:
    Q_EMIT LastCameraIdChanged();
    break;
  }
}
