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

#include "dolphin_searchsettings.h"

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

class SearchSettingsHelper
{
  public:
    SearchSettingsHelper() : q(nullptr) {}
    ~SearchSettingsHelper() { delete q; q = nullptr; }
    SearchSettingsHelper(const SearchSettingsHelper&) = delete;
    SearchSettingsHelper& operator=(const SearchSettingsHelper&) = delete;
    SearchSettings *q;
};
Q_GLOBAL_STATIC(SearchSettingsHelper, s_globalSearchSettings)
SearchSettings *SearchSettings::self()
{
  if (!s_globalSearchSettings()->q) {
    new SearchSettings;
    s_globalSearchSettings()->q->read();
  }

  return s_globalSearchSettings()->q;
}

SearchSettings::SearchSettings( )
  : KConfigSkeleton( QStringLiteral( "dolphinrc" ) )
{
  Q_ASSERT(!s_globalSearchSettings()->q);
  s_globalSearchSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Search" ) );

  KConfigSkeleton::ItemString  *itemLocation;
  itemLocation = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Location" ), mLocation, QStringLiteral( "FromHere" ) );
  addItem( itemLocation, QStringLiteral( "Location" ) );
  KConfigSkeleton::ItemString  *itemWhat;
  itemWhat = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "What" ), mWhat, QStringLiteral( "FileNames" ) );
  addItem( itemWhat, QStringLiteral( "What" ) );
  KConfigSkeleton::ItemString  *itemSearchTool;
  itemSearchTool = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "SearchTool" ), mSearchTool, QStringLiteral( "Filenamesearch" ) );
  addItem( itemSearchTool, QStringLiteral( "SearchTool" ) );
}

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

