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

#include "settings.h"

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

#include <QDebug>

class SettingsHelper
{
  public:
    SettingsHelper() : q(nullptr) {}
    ~SettingsHelper() { delete q; }
    SettingsHelper(const SettingsHelper&) = delete;
    SettingsHelper& operator=(const SettingsHelper&) = delete;
    Settings *q;
};
Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings()->q)
     qFatal("you need to call Settings::instance before using");
  return s_globalSettings()->q;
}

void Settings::instance(const QString& cfgfilename)
{
  if (s_globalSettings()->q) {
     qDebug() << "Settings::instance called after the first use - ignoring";
     return;
  }
  new Settings(KSharedConfig::openConfig(cfgfilename));
  s_globalSettings()->q->read();
}

void Settings::instance(KSharedConfig::Ptr config)
{
  if (s_globalSettings()->q) {
     qDebug() << "Settings::instance called after the first use - ignoring";
     return;
  }
  new Settings(std::move(config));
  s_globalSettings()->q->read();
}

Settings::Settings( KSharedConfig::Ptr config )
  : KConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "reminders" ) );

  KConfigSkeleton::ItemBool  *itemAttendingReminders;
  itemAttendingReminders = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AttendingReminders" ), mAttendingReminders, true );
  addItem( itemAttendingReminders, QStringLiteral( "AttendingReminders" ) );
  KConfigSkeleton::ItemBool  *itemMaybeAttendingReminders;
  itemMaybeAttendingReminders = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "MaybeAttendingReminders" ), mMaybeAttendingReminders, true );
  addItem( itemMaybeAttendingReminders, QStringLiteral( "MaybeAttendingReminders" ) );
  KConfigSkeleton::ItemBool  *itemNotAttendingReminders;
  itemNotAttendingReminders = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "NotAttendingReminders" ), mNotAttendingReminders, true );
  addItem( itemNotAttendingReminders, QStringLiteral( "NotAttendingReminders" ) );
  KConfigSkeleton::ItemBool  *itemNotRespondedToReminders;
  itemNotRespondedToReminders = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "NotRespondedToReminders" ), mNotRespondedToReminders, true );
  addItem( itemNotRespondedToReminders, QStringLiteral( "NotRespondedToReminders" ) );
  KConfigSkeleton::ItemBool  *itemBirthdayReminders;
  itemBirthdayReminders = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "BirthdayReminders" ), mBirthdayReminders, true );
  addItem( itemBirthdayReminders, QStringLiteral( "BirthdayReminders" ) );
  KConfigSkeleton::ItemInt  *itemEventReminderHours;
  itemEventReminderHours = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "EventReminderHours" ), mEventReminderHours, 1 );
  addItem( itemEventReminderHours, QStringLiteral( "EventReminderHours" ) );
  KConfigSkeleton::ItemInt  *itemBirthdayReminderDays;
  itemBirthdayReminderDays = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "BirthdayReminderDays" ), mBirthdayReminderDays, 0 );
  addItem( itemBirthdayReminderDays, QStringLiteral( "BirthdayReminderDays" ) );
}

Settings::~Settings()
{
  s_globalSettings()->q = nullptr;
}

