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

#include "metalinksettings.h"

#include <kglobal.h>
#include <QtCore/QFile>

class MetalinkSettingsHelper
{
  public:
    MetalinkSettingsHelper() : q(0) {}
    ~MetalinkSettingsHelper() { delete q; }
    MetalinkSettings *q;
};
K_GLOBAL_STATIC(MetalinkSettingsHelper, s_globalMetalinkSettings)
MetalinkSettings *MetalinkSettings::self()
{
  if (!s_globalMetalinkSettings->q) {
    new MetalinkSettings;
    s_globalMetalinkSettings->q->readConfig();
  }

  return s_globalMetalinkSettings->q;
}

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

  KConfigSkeleton::ItemInt  *itemSimultanousFiles;
  itemSimultanousFiles = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "SimultanousFiles" ), mSimultanousFiles, 2 );
  itemSimultanousFiles->setMinValue(1);
  itemSimultanousFiles->setMaxValue(10);
  addItem( itemSimultanousFiles, QLatin1String( "SimultanousFiles" ) );
  KConfigSkeleton::ItemInt  *itemMirrorsPerFile;
  itemMirrorsPerFile = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "MirrorsPerFile" ), mMirrorsPerFile, 3 );
  itemMirrorsPerFile->setMinValue(1);
  itemMirrorsPerFile->setMaxValue(10);
  addItem( itemMirrorsPerFile, QLatin1String( "MirrorsPerFile" ) );
  KConfigSkeleton::ItemInt  *itemConnectionsPerUrl;
  itemConnectionsPerUrl = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "ConnectionsPerUrl" ), mConnectionsPerUrl, 2 );
  itemConnectionsPerUrl->setMinValue(1);
  itemConnectionsPerUrl->setMaxValue(10);
  addItem( itemConnectionsPerUrl, QLatin1String( "ConnectionsPerUrl" ) );
}

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

