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

#include "checksumsearchsettings.h"

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

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

  return s_globalChecksumSearchSettings()->q;
}

ChecksumSearchSettings::ChecksumSearchSettings( )
  : KConfigSkeleton( QStringLiteral( "kget_checksumsearchfactory.rc" ) )
{
  Q_ASSERT(!s_globalChecksumSearchSettings()->q);
  s_globalChecksumSearchSettings()->q = this;
  setCurrentGroup( QStringLiteral( "ChecksumSearch" ) );

  QStringList defaultSearchStrings;
  defaultSearchStrings.append( QString::fromUtf8( ".md5" ) );
  defaultSearchStrings.append( QString::fromUtf8( "MD5SUMS" ) );
  defaultSearchStrings.append( QString::fromUtf8( ".sha1" ) );
  defaultSearchStrings.append( QString::fromUtf8( "SHA1SUMS" ) );
  defaultSearchStrings.append( QString::fromUtf8( "-CHECKSUM" ) );

  KConfigSkeleton::ItemStringList  *itemSearchStrings;
  itemSearchStrings = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "SearchStrings" ), mSearchStrings, defaultSearchStrings );
  addItem( itemSearchStrings, QStringLiteral( "SearchStrings" ) );
  QList<int> defaultUrlChangeModeList;
  defaultUrlChangeModeList.append( 0 );
  defaultUrlChangeModeList.append( 1 );
  defaultUrlChangeModeList.append( 0 );
  defaultUrlChangeModeList.append( 1 );
  defaultUrlChangeModeList.append( 2 );

  KConfigSkeleton::ItemIntList  *itemUrlChangeModeList;
  itemUrlChangeModeList = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "UrlChangeModeList" ), mUrlChangeModeList, defaultUrlChangeModeList );
  addItem( itemUrlChangeModeList, QStringLiteral( "UrlChangeModeList" ) );
  QStringList defaultChecksumTypeList;
  defaultChecksumTypeList.append( QString::fromUtf8( "md5" ) );
  defaultChecksumTypeList.append( QString::fromUtf8( "md5" ) );
  defaultChecksumTypeList.append( QString::fromUtf8( "sha1" ) );
  defaultChecksumTypeList.append( QString::fromUtf8( "sha1" ) );
  defaultChecksumTypeList.append( QString::fromUtf8( "" ) );

  KConfigSkeleton::ItemStringList  *itemChecksumTypeList;
  itemChecksumTypeList = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "ChecksumTypeList" ), mChecksumTypeList, defaultChecksumTypeList );
  addItem( itemChecksumTypeList, QStringLiteral( "ChecksumTypeList" ) );
}

ChecksumSearchSettings::~ChecksumSearchSettings()
{
  s_globalChecksumSearchSettings()->q = nullptr;
}

