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

#include "settings.h"

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

class SageSettingsHelper
{
  public:
    SageSettingsHelper() : q(nullptr) {}
    ~SageSettingsHelper() { delete q; }
    SageSettings *q;
};
Q_GLOBAL_STATIC(SageSettingsHelper, s_globalSageSettings)
SageSettings *SageSettings::self()
{
  if (!s_globalSageSettings()->q) {
    new SageSettings;
    s_globalSageSettings()->q->read();
  }

  return s_globalSageSettings()->q;
}

SageSettings::SageSettings(  )
  : KConfigSkeleton( QStringLiteral( "cantorrc" ) )
{
  Q_ASSERT(!s_globalSageSettings()->q);
  s_globalSageSettings()->q = this;
  setCurrentGroup( QStringLiteral( "SageBackend" ) );

  KConfigSkeleton::ItemUrl  *itemPath;
  itemPath = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "Path" ), mPath, QUrl::fromLocalFile(QStandardPaths::findExecutable( QLatin1String("sage") )) );
  addItem( itemPath, QStringLiteral( "Path" ) );
  KConfigSkeleton::ItemStringList  *itemAutorunScripts;
  itemAutorunScripts = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "autorunScripts" ), mAutorunScripts );
  addItem( itemAutorunScripts, QStringLiteral( "autorunScripts" ) );
}

SageSettings::~SageSettings()
{
  s_globalSageSettings()->q = nullptr;
}

