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

#include "searchpluginsettings.h"

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

using namespace kt;

namespace kt {

class SearchPluginSettingsHelper
{
  public:
    SearchPluginSettingsHelper() : q(0) {}
    ~SearchPluginSettingsHelper() { delete q; }
    SearchPluginSettings *q;
};
}

K_GLOBAL_STATIC(SearchPluginSettingsHelper, s_globalSearchPluginSettings)
SearchPluginSettings *SearchPluginSettings::self()
{
  if (!s_globalSearchPluginSettings->q) {
    new SearchPluginSettings;
    s_globalSearchPluginSettings->q->readConfig();
  }

  return s_globalSearchPluginSettings->q;
}

SearchPluginSettings::SearchPluginSettings(  )
  : KConfigSkeleton( QLatin1String( "ktsearchpluginrc" ) )
{
  Q_ASSERT(!s_globalSearchPluginSettings->q);
  s_globalSearchPluginSettings->q = this;
  setCurrentGroup( QLatin1String( "general" ) );

  KConfigSkeleton::ItemInt  *itemSearchEngine;
  itemSearchEngine = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "searchEngine" ), mSearchEngine, 0 );
  addItem( itemSearchEngine, QLatin1String( "searchEngine" ) );
  KConfigSkeleton::ItemBool  *itemUseDefaultBrowser;
  itemUseDefaultBrowser = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "useDefaultBrowser" ), mUseDefaultBrowser, true );
  addItem( itemUseDefaultBrowser, QLatin1String( "useDefaultBrowser" ) );
  KConfigSkeleton::ItemBool  *itemUseCustomBrowser;
  itemUseCustomBrowser = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "useCustomBrowser" ), mUseCustomBrowser, false );
  addItem( itemUseCustomBrowser, QLatin1String( "useCustomBrowser" ) );
  KConfigSkeleton::ItemString  *itemCustomBrowser;
  itemCustomBrowser = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "customBrowser" ), mCustomBrowser, QLatin1String( "/usr/bin/firefox" ) );
  addItem( itemCustomBrowser, QLatin1String( "customBrowser" ) );
  KConfigSkeleton::ItemBool  *itemOpenInExternal;
  itemOpenInExternal = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "openInExternal" ), mOpenInExternal, false );
  addItem( itemOpenInExternal, QLatin1String( "openInExternal" ) );
  KConfigSkeleton::ItemBool  *itemRestorePreviousSession;
  itemRestorePreviousSession = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "restorePreviousSession" ), mRestorePreviousSession, false );
  addItem( itemRestorePreviousSession, QLatin1String( "restorePreviousSession" ) );
}

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

