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

#include "webinterfacepluginsettings.h"

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

using namespace kt;

namespace kt {

class WebInterfacePluginSettingsHelper
{
  public:
    WebInterfacePluginSettingsHelper() : q(0) {}
    ~WebInterfacePluginSettingsHelper() { delete q; }
    WebInterfacePluginSettings *q;
};
}

K_GLOBAL_STATIC(WebInterfacePluginSettingsHelper, s_globalWebInterfacePluginSettings)
WebInterfacePluginSettings *WebInterfacePluginSettings::self()
{
  if (!s_globalWebInterfacePluginSettings->q) {
    new WebInterfacePluginSettings;
    s_globalWebInterfacePluginSettings->q->readConfig();
  }

  return s_globalWebInterfacePluginSettings->q;
}

WebInterfacePluginSettings::WebInterfacePluginSettings(  )
  : KConfigSkeleton( QLatin1String( "ktwebinterfacepluginrc" ) )
{
  Q_ASSERT(!s_globalWebInterfacePluginSettings->q);
  s_globalWebInterfacePluginSettings->q = this;
  setCurrentGroup( QLatin1String( "general" ) );

  KConfigSkeleton::ItemInt  *itemPort;
  itemPort = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "port" ), mPort, 8080 );
  addItem( itemPort, QLatin1String( "port" ) );
  KConfigSkeleton::ItemBool  *itemForward;
  itemForward = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "forward" ), mForward, false );
  addItem( itemForward, QLatin1String( "forward" ) );
  KConfigSkeleton::ItemInt  *itemSessionTTL;
  itemSessionTTL = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "sessionTTL" ), mSessionTTL, 3600 );
  itemSessionTTL->setMinValue(1);
  itemSessionTTL->setMaxValue(100000);
  addItem( itemSessionTTL, QLatin1String( "sessionTTL" ) );
  KConfigSkeleton::ItemInt  *itemSkin;
  itemSkin = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "skin" ), mSkin, 1 );
  addItem( itemSkin, QLatin1String( "skin" ) );
  KConfigSkeleton::ItemBool  *itemAuthentication;
  itemAuthentication = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "authentication" ), mAuthentication, true );
  addItem( itemAuthentication, QLatin1String( "authentication" ) );
  KConfigSkeleton::ItemString  *itemUsername;
  itemUsername = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "username" ), mUsername, QLatin1String( "ktorrent" ) );
  addItem( itemUsername, QLatin1String( "username" ) );
  KConfigSkeleton::ItemString  *itemPassword;
  itemPassword = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "password" ), mPassword, QLatin1String( "ktorrent" ) );
  addItem( itemPassword, QLatin1String( "password" ) );
  KConfigSkeleton::ItemBool  *itemAutomaticRefresh;
  itemAutomaticRefresh = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "automaticRefresh" ), mAutomaticRefresh, true );
  addItem( itemAutomaticRefresh, QLatin1String( "automaticRefresh" ) );
}

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

