
//TODO:remove this class alltogether
//sorry guys I couldn't use kconfig XT

#include "settings.h"

#include <kstaticdeleter.h>

Settings *Settings::mSelf = 0;
static KStaticDeleter<Settings> staticSettingsDeleter;

Settings *Settings::self()
{
  if ( !mSelf ) {
    staticSettingsDeleter.setObject( mSelf, new Settings() );
    mSelf->readConfig();
  }

  return mSelf;
}

Settings::Settings(  )
  : KConfigSkeleton( QString::fromLatin1( "kclucene_index_settings_rc" ) )
{
  mSelf = this;
  KConfigSkeleton::ItemString  *itemindexLocation;

  itemindexLocation = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "indexLocation" ), mIndexLocation );
  addItem( itemindexLocation, QString::fromLatin1( "indexLocation" ) );
}

Settings::~Settings()
{
  if ( mSelf == this )
    staticSettingsDeleter.setObject( mSelf, 0, false );
}

