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

#include "mailmergeagentsettings.h"

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

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

  return s_globalMailMergeAgentSettings()->q;
}

MailMergeAgentSettings::MailMergeAgentSettings( )
  : KConfigSkeleton( QStringLiteral( "akonadi_mailmerge_agentrc" ) )
{
  Q_ASSERT(!s_globalMailMergeAgentSettings()->q);
  s_globalMailMergeAgentSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemBool  *itemEnabled;
  itemEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "enabled" ), mEnabled, true );
  addItem( itemEnabled, QStringLiteral( "enabled" ) );
}

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

