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

#include "settings.h"

#include <klocalizedstring.h>

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

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

  return s_globalSettings()->q;
}

Settings::Settings( )
  : KConfigSkeleton( QStringLiteral( "maildispatcheragentrc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  mOutboxItem = new KConfigSkeleton::ItemLongLong( currentGroup(), QStringLiteral( "Outbox" ), mOutbox, -1 );
  mOutboxItem->setLabel( i18n("Outbox collection id") );
  addItem( mOutboxItem, QStringLiteral( "Outbox" ) );
  mSentMailItem = new KConfigSkeleton::ItemLongLong( currentGroup(), QStringLiteral( "SentMail" ), mSentMail, -1 );
  mSentMailItem->setLabel( i18n("Sent Mail collection id") );
  addItem( mSentMailItem, QStringLiteral( "SentMail" ) );
}

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

