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

#include "settings.h"

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

class LuaSettingsHelper
{
  public:
    LuaSettingsHelper() : q(nullptr) {}
    ~LuaSettingsHelper() { delete q; }
    LuaSettings *q;
};
Q_GLOBAL_STATIC(LuaSettingsHelper, s_globalLuaSettings)
LuaSettings *LuaSettings::self()
{
  if (!s_globalLuaSettings()->q) {
    new LuaSettings;
    s_globalLuaSettings()->q->read();
  }

  return s_globalLuaSettings()->q;
}

LuaSettings::LuaSettings(  )
  : KConfigSkeleton( QStringLiteral( "cantorrc" ) )
{
  Q_ASSERT(!s_globalLuaSettings()->q);
  s_globalLuaSettings()->q = this;
  setCurrentGroup( QStringLiteral( "LuaBackend" ) );

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

LuaSettings::~LuaSettings()
{
  s_globalLuaSettings()->q = nullptr;
}

