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

#include "bgconfig.h"

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

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

  return s_globalBGSettings()->q;
}

BGSettings::BGSettings( )
  : KDevelop::SessionConfigSkeleton( QStringLiteral( "kdeveloprc" ) )
{
  Q_ASSERT(!s_globalBGSettings()->q);
  s_globalBGSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Background Parser" ) );

  mEnableItem = new KDevelop::SessionConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Enabled" ), mEnable, true );
  mEnableItem->setLabel( QCoreApplication::translate("BGSettings", "Enabled") );
  addItem( mEnableItem, QStringLiteral( "enable" ) );
  mDelayItem = new KDevelop::SessionConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Delay" ), mDelay, 500 );
  mDelayItem->setLabel( QCoreApplication::translate("BGSettings", "Delay") );
  addItem( mDelayItem, QStringLiteral( "delay" ) );
  mThreadsItem = new KDevelop::SessionConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Number of Threads" ), mThreads, 2 );
  mThreadsItem->setLabel( QCoreApplication::translate("BGSettings", "Number of Threads") );
  addItem( mThreadsItem, QStringLiteral( "threads" ) );
}

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

