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

#include "calligraplanworksettings.h"

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

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

  return s_globalPlanWorkSettings()->q;
}

PlanWorkSettings::PlanWorkSettings( )
  : KConfigSkeleton( QStringLiteral( "calligraplanworkrc" ) )
{
  Q_ASSERT(!s_globalPlanWorkSettings()->q);
  s_globalPlanWorkSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Views" ) );

  KConfigSkeleton::ItemInt  *itemCurrentView;
  itemCurrentView = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "CurrentView" ), mCurrentView );
  addItem( itemCurrentView, QStringLiteral( "CurrentView" ) );
  KConfigSkeleton::ItemString  *itemTaskWorkPackageView;
  itemTaskWorkPackageView = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TaskWorkPackageView" ), mTaskWorkPackageView );
  addItem( itemTaskWorkPackageView, QStringLiteral( "TaskWorkPackageView" ) );
  KConfigSkeleton::ItemString  *itemTaskWPGanttView;
  itemTaskWPGanttView = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TaskWPGanttView" ), mTaskWPGanttView );
  addItem( itemTaskWPGanttView, QStringLiteral( "TaskWPGanttView" ) );
}

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

