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

#include "audiocd_flac_encoder.h"

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

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

  return s_globalSettings()->q;
}

Settings::Settings( )
  : KConfigSkeleton( QStringLiteral( "kcmaudiocd_encoder_flac_rc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Flac" ) );

  KConfigSkeleton::ItemUInt  *itemFlac_compression_level;
  itemFlac_compression_level = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "flac_compression_level" ), mFlac_compression_level, 5 );
  itemFlac_compression_level->setMinValue(0);
  itemFlac_compression_level->setMaxValue(8);
  addItem( itemFlac_compression_level, QStringLiteral( "flac_compression_level" ) );
}

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

