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

#include "customdefinesandincludes.h"

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

#include <QDebug>

class CustomDefinesAndIncludesHelper
{
  public:
    CustomDefinesAndIncludesHelper() : q(nullptr) {}
    ~CustomDefinesAndIncludesHelper() { delete q; q = nullptr; }
    CustomDefinesAndIncludesHelper(const CustomDefinesAndIncludesHelper&) = delete;
    CustomDefinesAndIncludesHelper& operator=(const CustomDefinesAndIncludesHelper&) = delete;
    CustomDefinesAndIncludes *q;
};
Q_GLOBAL_STATIC(CustomDefinesAndIncludesHelper, s_globalCustomDefinesAndIncludes)
CustomDefinesAndIncludes *CustomDefinesAndIncludes::self()
{
  if (!s_globalCustomDefinesAndIncludes()->q)
     qFatal("you need to call CustomDefinesAndIncludes::instance before using");
  return s_globalCustomDefinesAndIncludes()->q;
}

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

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

CustomDefinesAndIncludes::CustomDefinesAndIncludes( KSharedConfig::Ptr config )
  : KDevelop::ProjectConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalCustomDefinesAndIncludes()->q);
  s_globalCustomDefinesAndIncludes()->q = this;
  setCurrentGroup( QStringLiteral( "Defines And Includes" ) );

  KDevelop::ProjectConfigSkeleton::ItemBool  *itemReparse;
  itemReparse = new KDevelop::ProjectConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "reparse" ), mReparse, true );
  addItem( itemReparse, QStringLiteral( "reparse" ) );
}

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

