// This file is generated by kconfig_compiler_kf6 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() noexcept : q(nullptr) {}
    ~RServerSettingsHelper() noexcept { 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" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesinlinePlotFormat;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("pdf");
    valuesinlinePlotFormat.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("svg");
    valuesinlinePlotFormat.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("png");
    valuesinlinePlotFormat.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemInlinePlotFormat;
  itemInlinePlotFormat = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "inlinePlotFormat" ), mInlinePlotFormat, valuesinlinePlotFormat, 2 );
  addItem( itemInlinePlotFormat, QStringLiteral( "inlinePlotFormat" ) );
  KConfigSkeleton::ItemDouble  *itemPlotWidth;
  itemPlotWidth = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "plotWidth" ), mPlotWidth, 12.0 );
  addItem( itemPlotWidth, QStringLiteral( "plotWidth" ) );
  KConfigSkeleton::ItemDouble  *itemPlotHeight;
  itemPlotHeight = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "plotHeight" ), mPlotHeight, 8.0 );
  addItem( itemPlotHeight, QStringLiteral( "plotHeight" ) );
}

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

