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

#include "cantor_libs_settings.h"

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

class CantorLibsSettingsHelper
{
  public:
    CantorLibsSettingsHelper() noexcept : q(nullptr) {}
    ~CantorLibsSettingsHelper() noexcept { delete q; q = nullptr; }
    CantorLibsSettingsHelper(const CantorLibsSettingsHelper&) = delete;
    CantorLibsSettingsHelper& operator=(const CantorLibsSettingsHelper&) = delete;
    CantorLibsSettings *q;
};
Q_GLOBAL_STATIC(CantorLibsSettingsHelper, s_globalCantorLibsSettings)
CantorLibsSettings *CantorLibsSettings::self()
{
  if (!s_globalCantorLibsSettings()->q) {
    new CantorLibsSettings;
    s_globalCantorLibsSettings()->q->read();
  }

  return s_globalCantorLibsSettings()->q;
}

CantorLibsSettings::CantorLibsSettings( )
  : KConfigSkeleton()
{
  Q_ASSERT(!s_globalCantorLibsSettings()->q);
  s_globalCantorLibsSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Cantor" ) );

  KConfigSkeleton::ItemString  *itemLatexCommand;
  itemLatexCommand = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "latexCommand" ), mLatexCommand, QStandardPaths::findExecutable( QLatin1String("latex") ) );
  addItem( itemLatexCommand, QStringLiteral( "latexCommand" ) );
  KConfigSkeleton::ItemString  *itemDvipsCommand;
  itemDvipsCommand = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "dvipsCommand" ), mDvipsCommand, QStandardPaths::findExecutable( QLatin1String("dvips") ) );
  addItem( itemDvipsCommand, QStringLiteral( "dvipsCommand" ) );
}

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

