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

#include "prefs.h"

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

class PrefsHelper
{
  public:
    PrefsHelper() : q(0) {}
    ~PrefsHelper() { delete q; }
    Prefs *q;
};
K_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
Prefs *Prefs::self()
{
  if (!s_globalPrefs->q) {
    new Prefs;
    s_globalPrefs->q->readConfig();
  }

  return s_globalPrefs->q;
}

Prefs::Prefs(  )
  : KConfigSkeleton( QLatin1String( "khelpcenterrc" ) )
{
  Q_ASSERT(!s_globalPrefs->q);
  s_globalPrefs->q = this;
  setCurrentGroup( QLatin1String( "Search" ) );

  KConfigSkeleton::ItemPath  *itemIndexDirectory;
  itemIndexDirectory = new KConfigSkeleton::ItemPath( currentGroup(), QLatin1String( "IndexDirectory" ), mIndexDirectory, KGlobal::dirs()->saveLocation("data", "khelpcenter/index/") );
  addItem( itemIndexDirectory, QLatin1String( "IndexDirectory" ) );
  KConfigSkeleton::ItemInt  *itemMethod;
  itemMethod = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Method" ), mMethod, 0 );
  addItem( itemMethod, QLatin1String( "Method" ) );
  KConfigSkeleton::ItemInt  *itemMaxCount;
  itemMaxCount = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "MaxCount" ), mMaxCount, 0 );
  addItem( itemMaxCount, QLatin1String( "MaxCount" ) );

  setCurrentGroup( QLatin1String( "Layout" ) );

  QList<KConfigSkeleton::ItemEnum::Choice2> valuesCurrentTab;
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("Content");
    valuesCurrentTab.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("Search");
    valuesCurrentTab.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("Glossary");
    valuesCurrentTab.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemCurrentTab;
  itemCurrentTab = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "CurrentTab" ), mCurrentTab, valuesCurrentTab, Content );
  addItem( itemCurrentTab, QLatin1String( "CurrentTab" ) );
}

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

