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

#include "mirrorsearchsettings.h"

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

class MirrorSearchSettingsHelper
{
  public:
    MirrorSearchSettingsHelper() : q(0) {}
    ~MirrorSearchSettingsHelper() { delete q; }
    MirrorSearchSettings *q;
};
K_GLOBAL_STATIC(MirrorSearchSettingsHelper, s_globalMirrorSearchSettings)
MirrorSearchSettings *MirrorSearchSettings::self()
{
  if (!s_globalMirrorSearchSettings->q) {
    new MirrorSearchSettings;
    s_globalMirrorSearchSettings->q->readConfig();
  }

  return s_globalMirrorSearchSettings->q;
}

MirrorSearchSettings::MirrorSearchSettings(  )
  : KConfigSkeleton( QLatin1String( "kget_mirrorsearchfactory.rc" ) )
{
  Q_ASSERT(!s_globalMirrorSearchSettings->q);
  s_globalMirrorSearchSettings->q = this;
  setCurrentGroup( QLatin1String( "SearchEngines" ) );

  KConfigSkeleton::ItemBool  *itemUseSearchEngines;
  itemUseSearchEngines = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "UseSearchEngines" ), mUseSearchEngines, false );
  addItem( itemUseSearchEngines, QLatin1String( "UseSearchEngines" ) );
  QStringList defaultSearchEnginesNameList;
  defaultSearchEnginesNameList.append( QString::fromUtf8( "FindFiles.com" ) );
  defaultSearchEnginesNameList.append( QString::fromUtf8( "FileWatcher.com" ) );

  KConfigSkeleton::ItemStringList  *itemSearchEnginesNameList;
  itemSearchEnginesNameList = new KConfigSkeleton::ItemStringList( currentGroup(), QLatin1String( "NameItems" ), mSearchEnginesNameList, defaultSearchEnginesNameList );
  addItem( itemSearchEnginesNameList, QLatin1String( "SearchEnginesNameList" ) );
  QStringList defaultSearchEnginesUrlList;
  defaultSearchEnginesUrlList.append( QString::fromUtf8( "http://www.findfiles.com/list.php?db=Mirrors&string=${filename}" ) );
  defaultSearchEnginesUrlList.append( QString::fromUtf8( "http://www.filewatcher.com/_/?q=+${filename}" ) );

  KConfigSkeleton::ItemStringList  *itemSearchEnginesUrlList;
  itemSearchEnginesUrlList = new KConfigSkeleton::ItemStringList( currentGroup(), QLatin1String( "UrlItems" ), mSearchEnginesUrlList, defaultSearchEnginesUrlList );
  addItem( itemSearchEnginesUrlList, QLatin1String( "SearchEnginesUrlList" ) );
}

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

