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

#include "searchpluginsettings.h"

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

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

  return s_globalSearchPluginSettings()->q;
}

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

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

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

