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

#include "prefs.h"

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

class PrefsHelper
{
  public:
    PrefsHelper() noexcept : q(nullptr) {}
    ~PrefsHelper() noexcept { delete q; q = nullptr; }
    PrefsHelper(const PrefsHelper&) = delete;
    PrefsHelper& operator=(const PrefsHelper&) = delete;
    Prefs *q;
};
Q_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
Prefs *Prefs::self()
{
  if (!s_globalPrefs()->q) {
    new Prefs;
    s_globalPrefs()->q->read();
  }

  return s_globalPrefs()->q;
}

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

  KConfigSkeleton::ItemBool  *itemShowMissingDocs;
  itemShowMissingDocs = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowMissingDocs" ), mShowMissingDocs, false );
  addItem( itemShowMissingDocs, QStringLiteral( "ShowMissingDocs" ) );
  KConfigSkeleton::ItemPath  *itemAppsRoot;
  itemAppsRoot = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "AppsRoot" ), mAppsRoot );
  addItem( itemAppsRoot, QStringLiteral( "AppsRoot" ) );
  KConfigSkeleton::ItemBool  *itemUseKonqSettings;
  itemUseKonqSettings = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseKonqSettings" ), mUseKonqSettings, true );
  addItem( itemUseKonqSettings, QStringLiteral( "UseKonqSettings" ) );
  KConfigSkeleton::ItemInt  *itemFontzoomfactor;
  itemFontzoomfactor = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Font zoom factor" ), mFontzoomfactor, 100 );
  addItem( itemFontzoomfactor, QStringLiteral( "Fontzoomfactor" ) );
  KConfigSkeleton::ItemPathList  *itemMetaInfoDirs;
  itemMetaInfoDirs = new KConfigSkeleton::ItemPathList( currentGroup(), QStringLiteral( "MetaInfoDirs" ), mMetaInfoDirs );
  addItem( itemMetaInfoDirs, QStringLiteral( "MetaInfoDirs" ) );

  setCurrentGroup( QStringLiteral( "Search" ) );

  KConfigSkeleton::ItemPath  *itemIndexDirectory;
  itemIndexDirectory = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "IndexDirectory" ), mIndexDirectory, QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/index/") );
  addItem( itemIndexDirectory, QStringLiteral( "IndexDirectory" ) );
  KConfigSkeleton::ItemInt  *itemMethod;
  itemMethod = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Method" ), mMethod, 0 );
  addItem( itemMethod, QStringLiteral( "Method" ) );
  KConfigSkeleton::ItemInt  *itemMaxCount;
  itemMaxCount = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MaxCount" ), mMaxCount, 1 );
  addItem( itemMaxCount, QStringLiteral( "MaxCount" ) );

  setCurrentGroup( QStringLiteral( "Layout" ) );

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

  setCurrentGroup( QStringLiteral( "Glossary" ) );

  KConfigSkeleton::ItemPath  *itemCachedGlossary;
  itemCachedGlossary = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "CachedGlossary" ), mCachedGlossary );
  addItem( itemCachedGlossary, QStringLiteral( "CachedGlossary" ) );
  KConfigSkeleton::ItemInt  *itemCachedGlossaryTimestamp;
  itemCachedGlossaryTimestamp = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "CachedGlossaryTimestamp" ), mCachedGlossaryTimestamp, 0 );
  addItem( itemCachedGlossaryTimestamp, QStringLiteral( "CachedGlossaryTimestamp" ) );

  setCurrentGroup( QStringLiteral( "ScrollKeeper" ) );

  KConfigSkeleton::ItemBool  *itemShowEmptyDirs;
  itemShowEmptyDirs = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowEmptyDirs" ), mShowEmptyDirs, false );
  addItem( itemShowEmptyDirs, QStringLiteral( "ShowEmptyDirs" ) );

  setCurrentGroup( QStringLiteral( "Info pages" ) );

  QStringList defaultSearchpaths;
  defaultSearchpaths.append( QString::fromUtf8( "/usr/share/info" ) );
  defaultSearchpaths.append( QString::fromUtf8( "/usr/info" ) );
  defaultSearchpaths.append( QString::fromUtf8( "/usr/lib/info" ) );
  defaultSearchpaths.append( QString::fromUtf8( "/usr/local/info" ) );
  defaultSearchpaths.append( QString::fromUtf8( "/usr/local/lib/info" ) );
  defaultSearchpaths.append( QString::fromUtf8( "/usr/X11R6/info" ) );
  defaultSearchpaths.append( QString::fromUtf8( "/usr/X11R6/lib/info" ) );
  defaultSearchpaths.append( QString::fromUtf8( "/usr/X11R6/lib/xemacs/info" ) );

  KConfigSkeleton::ItemPathList  *itemSearchpaths;
  itemSearchpaths = new KConfigSkeleton::ItemPathList( currentGroup(), QStringLiteral( "Search paths" ), mSearchpaths, defaultSearchpaths );
  addItem( itemSearchpaths, QStringLiteral( "Searchpaths" ) );

  setCurrentGroup( QStringLiteral( "MainWindowState" ) );

  QList<int> defaultSplitter;

  KConfigSkeleton::ItemIntList  *itemSplitter;
  itemSplitter = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "Splitter" ), mSplitter, defaultSplitter );
  addItem( itemSplitter, QStringLiteral( "Splitter" ) );
}

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

