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

#include "icalendarsettings.h"

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

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

  return s_globalICalendarSettings()->q;
}

ICalendarSettings::ICalendarSettings( )
  : KConfigSkeleton( QStringLiteral( "kmymoney/icalendarexporterrc" ) )
{
  Q_ASSERT(!s_globalICalendarSettings()->q);
  s_globalICalendarSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemBool  *itemCreateAlarm;
  itemCreateAlarm = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "createAlarm" ), mCreateAlarm, true );
  addItem( itemCreateAlarm, QStringLiteral( "createAlarm" ) );
  KConfigSkeleton::ItemInt  *itemBeforeAfter;
  itemBeforeAfter = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "beforeAfter" ), mBeforeAfter, 0 );
  addItem( itemBeforeAfter, QStringLiteral( "beforeAfter" ) );
  KConfigSkeleton::ItemInt  *itemTimeUnits;
  itemTimeUnits = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "timeUnits" ), mTimeUnits, 1 );
  addItem( itemTimeUnits, QStringLiteral( "timeUnits" ) );
  KConfigSkeleton::ItemInt  *itemTimeUnitInSeconds;
  itemTimeUnitInSeconds = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "timeUnitInSeconds" ), mTimeUnitInSeconds, 2 );
  addItem( itemTimeUnitInSeconds, QStringLiteral( "timeUnitInSeconds" ) );
  KConfigSkeleton::ItemBool  *itemRepeatingReminders;
  itemRepeatingReminders = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "repeatingReminders" ), mRepeatingReminders, true );
  addItem( itemRepeatingReminders, QStringLiteral( "repeatingReminders" ) );
  KConfigSkeleton::ItemInt  *itemIntervalBetweenRemindersTimeUnits;
  itemIntervalBetweenRemindersTimeUnits = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "intervalBetweenRemindersTimeUnits" ), mIntervalBetweenRemindersTimeUnits, 60 );
  addItem( itemIntervalBetweenRemindersTimeUnits, QStringLiteral( "intervalBetweenRemindersTimeUnits" ) );
  KConfigSkeleton::ItemInt  *itemIntervalBetweenRemindersTimeUnitInSeconds;
  itemIntervalBetweenRemindersTimeUnitInSeconds = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "intervalBetweenRemindersTimeUnitInSeconds" ), mIntervalBetweenRemindersTimeUnitInSeconds, 0 );
  addItem( itemIntervalBetweenRemindersTimeUnitInSeconds, QStringLiteral( "intervalBetweenRemindersTimeUnitInSeconds" ) );
  KConfigSkeleton::ItemInt  *itemNumberOfReminders;
  itemNumberOfReminders = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "numberOfReminders" ), mNumberOfReminders, 1 );
  addItem( itemNumberOfReminders, QStringLiteral( "numberOfReminders" ) );
  KConfigSkeleton::ItemString  *itemIcalendarFile;
  itemIcalendarFile = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "icalendarFile" ), mIcalendarFile );
  addItem( itemIcalendarFile, QStringLiteral( "icalendarFile" ) );
  KConfigSkeleton::ItemBool  *itemWriteEventsVsTodos;
  itemWriteEventsVsTodos = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "writeEventsVsTodos" ), mWriteEventsVsTodos, false );
  addItem( itemWriteEventsVsTodos, QStringLiteral( "writeEventsVsTodos" ) );
}

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

