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

#include "settings.h"

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

using namespace ktouchpadenabler;

namespace ktouchpadenabler {

class SettingsHelper
{
  public:
    SettingsHelper() : q(0) {}
    ~SettingsHelper() { delete q; }
    Settings *q;
};
}

K_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings->q) {
    new Settings;
    s_globalSettings->q->readConfig();
  }

  return s_globalSettings->q;
}

Settings::Settings(  )
  : KConfigSkeleton( QLatin1String( "ktouchpadenablerrc" ) )
{
  Q_ASSERT(!s_globalSettings->q);
  s_globalSettings->q = this;
  setCurrentGroup( QLatin1String( "general" ) );

  KConfigSkeleton::ItemBool  *itemTouchpadEnabled;
  itemTouchpadEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "touchpadEnabled" ), mTouchpadEnabled, true );
  addItem( itemTouchpadEnabled, QLatin1String( "touchpadEnabled" ) );
}

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

