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

#include "qmakebuilderconfig.h"

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

#include <QDebug>

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

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

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

QMakeBuilderSettings::QMakeBuilderSettings(  KSharedConfig::Ptr config  )
  : KDevelop::ProjectConfigSkeleton( config )
{
  Q_ASSERT(!s_globalQMakeBuilderSettings()->q);
  s_globalQMakeBuilderSettings()->q = this;
}

QMakeBuilderSettings::~QMakeBuilderSettings()
{
  s_globalQMakeBuilderSettings()->q = nullptr;
}

