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

#include "slidingpopupsconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

class SlidingPopupsConfigHelper
{
  public:
    SlidingPopupsConfigHelper() : q(nullptr) {}
    ~SlidingPopupsConfigHelper() { delete q; }
    SlidingPopupsConfigHelper(const SlidingPopupsConfigHelper&) = delete;
    SlidingPopupsConfigHelper& operator=(const SlidingPopupsConfigHelper&) = delete;
    SlidingPopupsConfig *q;
};
}

Q_GLOBAL_STATIC(SlidingPopupsConfigHelper, s_globalSlidingPopupsConfig)
SlidingPopupsConfig *SlidingPopupsConfig::self()
{
  if (!s_globalSlidingPopupsConfig()->q)
     qFatal("you need to call SlidingPopupsConfig::instance before using");
  return s_globalSlidingPopupsConfig()->q;
}

void SlidingPopupsConfig::instance(const QString& cfgfilename)
{
  if (s_globalSlidingPopupsConfig()->q) {
     qDebug() << "SlidingPopupsConfig::instance called after the first use - ignoring";
     return;
  }
  new SlidingPopupsConfig(KSharedConfig::openConfig(cfgfilename));
  s_globalSlidingPopupsConfig()->q->read();
}

void SlidingPopupsConfig::instance(KSharedConfig::Ptr config)
{
  if (s_globalSlidingPopupsConfig()->q) {
     qDebug() << "SlidingPopupsConfig::instance called after the first use - ignoring";
     return;
  }
  new SlidingPopupsConfig(std::move(config));
  s_globalSlidingPopupsConfig()->q->read();
}

SlidingPopupsConfig::SlidingPopupsConfig( KSharedConfig::Ptr config )
  : KConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalSlidingPopupsConfig()->q);
  s_globalSlidingPopupsConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-SlidingPopups" ) );

  KConfigSkeleton::ItemInt  *itemSlideInTime;
  itemSlideInTime = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SlideInTime" ), mSlideInTime, 0 );
  addItem( itemSlideInTime, QStringLiteral( "SlideInTime" ) );
  KConfigSkeleton::ItemInt  *itemSlideOutTime;
  itemSlideOutTime = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "SlideOutTime" ), mSlideOutTime, 0 );
  addItem( itemSlideOutTime, QStringLiteral( "SlideOutTime" ) );
}

SlidingPopupsConfig::~SlidingPopupsConfig()
{
  s_globalSlidingPopupsConfig()->q = nullptr;
}

