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

#include "makebuilderconfig.h"

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

#include <QDebug>

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

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

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

MakeBuilderSettings::MakeBuilderSettings( KSharedConfig::Ptr config )
  : KDevelop::ProjectConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalMakeBuilderSettings()->q);
  s_globalMakeBuilderSettings()->q = this;
  setCurrentGroup( QStringLiteral( "MakeBuilder" ) );

  KDevelop::ProjectConfigSkeleton::ItemBool  *itemDisplayOnly;
  itemDisplayOnly = new KDevelop::ProjectConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Display Only" ), mDisplayOnly, false );
  addItem( itemDisplayOnly, QStringLiteral( "displayOnly" ) );
  KDevelop::ProjectConfigSkeleton::ItemBool  *itemAbortOnFirstError;
  itemAbortOnFirstError = new KDevelop::ProjectConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Abort on First Error" ), mAbortOnFirstError, true );
  addItem( itemAbortOnFirstError, QStringLiteral( "abortOnFirstError" ) );
  KDevelop::ProjectConfigSkeleton::ItemBool  *itemInstallAsRoot;
  itemInstallAsRoot = new KDevelop::ProjectConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Install As Root" ), mInstallAsRoot, false );
  addItem( itemInstallAsRoot, QStringLiteral( "installAsRoot" ) );
  KDevelop::ProjectConfigSkeleton::ItemString  *itemSuCommand;
  itemSuCommand = new KDevelop::ProjectConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Su Command" ), mSuCommand, QStringLiteral( "kdesu -t" ) );
  addItem( itemSuCommand, QStringLiteral( "suCommand" ) );
  KDevelop::ProjectConfigSkeleton::ItemBool  *itemOverrideNumberOfJobs;
  itemOverrideNumberOfJobs = new KDevelop::ProjectConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Override Number Of Jobs" ), mOverrideNumberOfJobs, false );
  addItem( itemOverrideNumberOfJobs, QStringLiteral( "overrideNumberOfJobs" ) );
  KDevelop::ProjectConfigSkeleton::ItemUInt  *itemNumberOfJobs;
  itemNumberOfJobs = new KDevelop::ProjectConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "Number Of Jobs" ), mNumberOfJobs, 1 );
  addItem( itemNumberOfJobs, QStringLiteral( "numberOfJobs" ) );
  KDevelop::ProjectConfigSkeleton::ItemString  *itemMakeExecutable;
  itemMakeExecutable = new KDevelop::ProjectConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Make Binary" ), mMakeExecutable, MakeBuilderPreferences::standardMakeExecutable() );
  addItem( itemMakeExecutable, QStringLiteral( "makeExecutable" ) );
  KDevelop::ProjectConfigSkeleton::ItemString  *itemDefaultTarget;
  itemDefaultTarget = new KDevelop::ProjectConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Default Target" ), mDefaultTarget );
  addItem( itemDefaultTarget, QStringLiteral( "defaultTarget" ) );
  KDevelop::ProjectConfigSkeleton::ItemString  *itemAdditionalOptions;
  itemAdditionalOptions = new KDevelop::ProjectConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Additional Options" ), mAdditionalOptions );
  addItem( itemAdditionalOptions, QStringLiteral( "additionalOptions" ) );
  KDevelop::ProjectConfigSkeleton::ItemString  *itemEnvironmentProfile;
  itemEnvironmentProfile = new KDevelop::ProjectConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Default Make Environment Profile" ), mEnvironmentProfile, QStringLiteral( "default" ) );
  addItem( itemEnvironmentProfile, QStringLiteral( "environmentProfile" ) );
}

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

