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

#include "ipfilterpluginsettings.h"

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

using namespace kt;

namespace kt {

class IPBlockingPluginSettingsHelper
{
  public:
    IPBlockingPluginSettingsHelper() : q(0) {}
    ~IPBlockingPluginSettingsHelper() { delete q; }
    IPBlockingPluginSettings *q;
};
}

K_GLOBAL_STATIC(IPBlockingPluginSettingsHelper, s_globalIPBlockingPluginSettings)
IPBlockingPluginSettings *IPBlockingPluginSettings::self()
{
  if (!s_globalIPBlockingPluginSettings->q) {
    new IPBlockingPluginSettings;
    s_globalIPBlockingPluginSettings->q->readConfig();
  }

  return s_globalIPBlockingPluginSettings->q;
}

IPBlockingPluginSettings::IPBlockingPluginSettings(  )
  : KConfigSkeleton( QLatin1String( "ktipfilterpluginrc" ) )
{
  Q_ASSERT(!s_globalIPBlockingPluginSettings->q);
  s_globalIPBlockingPluginSettings->q = this;
  setCurrentGroup( QLatin1String( "general" ) );

  KConfigSkeleton::ItemUrl  *itemFilterURL;
  itemFilterURL = new KConfigSkeleton::ItemUrl( currentGroup(), QLatin1String( "filterURL" ), mFilterURL, KUrl("http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz") );
  addItem( itemFilterURL, QLatin1String( "filterURL" ) );
  KConfigSkeleton::ItemBool  *itemUseLevel1;
  itemUseLevel1 = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "useLevel1" ), mUseLevel1, false );
  addItem( itemUseLevel1, QLatin1String( "useLevel1" ) );
  KConfigSkeleton::ItemBool  *itemAutoUpdate;
  itemAutoUpdate = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "autoUpdate" ), mAutoUpdate, false );
  addItem( itemAutoUpdate, QLatin1String( "autoUpdate" ) );
  KConfigSkeleton::ItemInt  *itemAutoUpdateInterval;
  itemAutoUpdateInterval = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "autoUpdateInterval" ), mAutoUpdateInterval, 7 );
  itemAutoUpdateInterval->setMinValue(1);
  itemAutoUpdateInterval->setMaxValue(1000);
  addItem( itemAutoUpdateInterval, QLatin1String( "autoUpdateInterval" ) );
}

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

