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

#include "mirrorsearchsettings.h"

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

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

  return s_globalMirrorSearchSettings()->q;
}

MirrorSearchSettings::MirrorSearchSettings( )
  : KConfigSkeleton( QStringLiteral( "kget_mirrorsearchfactory.rc" ) )
{
  Q_ASSERT(!s_globalMirrorSearchSettings()->q);
  s_globalMirrorSearchSettings()->q = this;
  setCurrentGroup( QStringLiteral( "SearchEngines" ) );

  KConfigSkeleton::ItemBool  *itemUseSearchEngines;
  itemUseSearchEngines = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseSearchEngines" ), mUseSearchEngines, false );
  addItem( itemUseSearchEngines, QStringLiteral( "UseSearchEngines" ) );
  KConfigSkeleton::ItemStringList  *itemSearchEnginesNameList;
  itemSearchEnginesNameList = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "NameItems" ), mSearchEnginesNameList );
  addItem( itemSearchEnginesNameList, QStringLiteral( "SearchEnginesNameList" ) );
  KConfigSkeleton::ItemStringList  *itemSearchEnginesUrlList;
  itemSearchEnginesUrlList = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "UrlItems" ), mSearchEnginesUrlList );
  addItem( itemSearchEnginesUrlList, QStringLiteral( "SearchEnginesUrlList" ) );
}

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

