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

#include "preferences.h"

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

class PreferencesHelper
{
  public:
    PreferencesHelper() : q(nullptr) {}
    ~PreferencesHelper() { delete q; q = nullptr; }
    PreferencesHelper(const PreferencesHelper&) = delete;
    PreferencesHelper& operator=(const PreferencesHelper&) = delete;
    Preferences *q;
};
Q_GLOBAL_STATIC(PreferencesHelper, s_globalPreferences)
Preferences *Preferences::self()
{
  if (!s_globalPreferences()->q) {
    new Preferences;
    s_globalPreferences()->q->read();
  }

  return s_globalPreferences()->q;
}

Preferences::Preferences( )
  : KConfigSkeleton( QStringLiteral( "audexrc" ) )
{
  Q_ASSERT(!s_globalPreferences()->q);
  s_globalPreferences()->q = this;
  setCurrentGroup( QStringLiteral( "general" ) );

  KConfigSkeleton::ItemBool  *itemFirstStart;
  itemFirstStart = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "firstStart" ), mFirstStart, true );
  addItem( itemFirstStart, QStringLiteral( "firstStart" ) );
  KConfigSkeleton::ItemBool  *itemOverwriteExistingFiles;
  itemOverwriteExistingFiles = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "overwriteExistingFiles" ), mOverwriteExistingFiles, false );
  addItem( itemOverwriteExistingFiles, QStringLiteral( "overwriteExistingFiles" ) );
  KConfigSkeleton::ItemBool  *itemDeletePartialFiles;
  itemDeletePartialFiles = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "deletePartialFiles" ), mDeletePartialFiles, true );
  addItem( itemDeletePartialFiles, QStringLiteral( "deletePartialFiles" ) );
  KConfigSkeleton::ItemBool  *itemEjectCDTray;
  itemEjectCDTray = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ejectCDTray" ), mEjectCDTray, false );
  addItem( itemEjectCDTray, QStringLiteral( "ejectCDTray" ) );
  KConfigSkeleton::ItemBool  *itemCddbLookupAuto;
  itemCddbLookupAuto = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "cddbLookupAuto" ), mCddbLookupAuto, true );
  addItem( itemCddbLookupAuto, QStringLiteral( "cddbLookupAuto" ) );
  KConfigSkeleton::ItemBool  *itemCoverLookupAuto;
  itemCoverLookupAuto = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "coverLookupAuto" ), mCoverLookupAuto, true );
  addItem( itemCoverLookupAuto, QStringLiteral( "coverLookupAuto" ) );
  KConfigSkeleton::ItemInt  *itemFetchCount;
  itemFetchCount = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "fetchCount" ), mFetchCount, 8 );
  itemFetchCount->setMinValue(1);
  itemFetchCount->setMaxValue(99);
  addItem( itemFetchCount, QStringLiteral( "fetchCount" ) );
  KConfigSkeleton::ItemBool  *itemFullParanoiaMode;
  itemFullParanoiaMode = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "fullParanoiaMode" ), mFullParanoiaMode, true );
  addItem( itemFullParanoiaMode, QStringLiteral( "fullParanoiaMode" ) );
  KConfigSkeleton::ItemBool  *itemSkipReadErrors;
  itemSkipReadErrors = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "skipReadErrors" ), mSkipReadErrors, false );
  addItem( itemSkipReadErrors, QStringLiteral( "skipReadErrors" ) );
  KConfigSkeleton::ItemInt  *itemRetriesOnReadError;
  itemRetriesOnReadError = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "retriesOnReadError" ), mRetriesOnReadError, 20 );
  itemRetriesOnReadError->setMinValue(0);
  itemRetriesOnReadError->setMaxValue(200);
  addItem( itemRetriesOnReadError, QStringLiteral( "retriesOnReadError" ) );
  KConfigSkeleton::ItemInt  *itemSampleShift;
  itemSampleShift = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "sampleShift" ), mSampleShift, 0 );
  itemSampleShift->setMinValue(-10000);
  itemSampleShift->setMaxValue(10000);
  addItem( itemSampleShift, QStringLiteral( "sampleShift" ) );
  KConfigSkeleton::ItemPath  *itemBasePath;
  itemBasePath = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "basePath" ), mBasePath, QStandardPaths::writableLocation(QStandardPaths::MusicLocation) );
  addItem( itemBasePath, QStringLiteral( "basePath" ) );
  KConfigSkeleton::ItemBool  *itemUpload;
  itemUpload = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "upload" ), mUpload, false );
  addItem( itemUpload, QStringLiteral( "upload" ) );
  KConfigSkeleton::ItemUrl  *itemUrl;
  itemUrl = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "url" ), mUrl );
  addItem( itemUrl, QStringLiteral( "url" ) );
}

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

