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

#include "settings.h"

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

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

  return s_globalRServerSettings()->q;
}

RServerSettings::RServerSettings( )
  : KConfigSkeleton( QStringLiteral( "cantorrc" ) )
{
  Q_ASSERT(!s_globalRServerSettings()->q);
  s_globalRServerSettings()->q = this;
  setCurrentGroup( QStringLiteral( "RBackend" ) );

  KConfigSkeleton::ItemUrl  *itemLocalDoc;
  itemLocalDoc = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "localDoc" ), mLocalDoc );
  addItem( itemLocalDoc, QStringLiteral( "localDoc" ) );
  KConfigSkeleton::ItemBool  *itemIntegratePlots;
  itemIntegratePlots = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "integratePlots" ), mIntegratePlots, true );
  addItem( itemIntegratePlots, QStringLiteral( "integratePlots" ) );
  KConfigSkeleton::ItemBool  *itemVariableManagement;
  itemVariableManagement = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "variableManagement" ), mVariableManagement, true );
  addItem( itemVariableManagement, QStringLiteral( "variableManagement" ) );
  KConfigSkeleton::ItemStringList  *itemAutorunScripts;
  itemAutorunScripts = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "autorunScripts" ), mAutorunScripts );
  addItem( itemAutorunScripts, QStringLiteral( "autorunScripts" ) );
}

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

