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

#include "metalinksettings.h"

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

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

  return s_globalMetalinkSettings()->q;
}

MetalinkSettings::MetalinkSettings( )
  : KConfigSkeleton( QStringLiteral( "kget_metalinkfactory.rc" ) )
{
  Q_ASSERT(!s_globalMetalinkSettings()->q);
  s_globalMetalinkSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Files" ) );

  KConfigSkeleton::ItemInt  *itemSimultaneousFiles;
  itemSimultaneousFiles = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SimultaneousFiles" ), mSimultaneousFiles, 2 );
  itemSimultaneousFiles->setMinValue(1);
  itemSimultaneousFiles->setMaxValue(10);
  addItem( itemSimultaneousFiles, QStringLiteral( "SimultaneousFiles" ) );
  KConfigSkeleton::ItemInt  *itemMirrorsPerFile;
  itemMirrorsPerFile = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MirrorsPerFile" ), mMirrorsPerFile, 3 );
  itemMirrorsPerFile->setMinValue(1);
  itemMirrorsPerFile->setMaxValue(10);
  addItem( itemMirrorsPerFile, QStringLiteral( "MirrorsPerFile" ) );
  KConfigSkeleton::ItemInt  *itemConnectionsPerUrl;
  itemConnectionsPerUrl = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ConnectionsPerUrl" ), mConnectionsPerUrl, 2 );
  itemConnectionsPerUrl->setMinValue(1);
  itemConnectionsPerUrl->setMaxValue(10);
  addItem( itemConnectionsPerUrl, QStringLiteral( "ConnectionsPerUrl" ) );
}

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

