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

#include "mailconfig.h"

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

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

  return s_globalConfig()->q;
}

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

Config::Config( QObject *parent )
  : KConfigSkeleton( QStringLiteral( "kalendarmailrc" ) )
{
  setParent(parent);
  Q_ASSERT(!s_globalConfig()->q);
  s_globalConfig()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&Config::itemChanged);

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigCompilerSignallingItem  *itemShowMenubar;
  KConfigSkeleton::ItemBool  *innerItemShowMenubar;
  innerItemShowMenubar = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showMenubar" ), mShowMenubar, true );
  itemShowMenubar = new KConfigCompilerSignallingItem(innerItemShowMenubar, this, notifyFunction, signalShowMenubarChanged);
  addItem( itemShowMenubar, QStringLiteral( "showMenubar" ) );
}

bool Config::defaultShowMenubarValue_helper()
{

  return true;
}

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


void Config::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalShowMenubarChanged:
    Q_EMIT showMenubarChanged();
    break;
  }
}
