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

#include "projectconfig.h"

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

class ProjectSettingsHelper
{
  public:
    ProjectSettingsHelper() noexcept : q(nullptr) {}
    ~ProjectSettingsHelper() noexcept { delete q; q = nullptr; }
    ProjectSettingsHelper(const ProjectSettingsHelper&) = delete;
    ProjectSettingsHelper& operator=(const ProjectSettingsHelper&) = delete;
    ProjectSettings *q;
};
Q_GLOBAL_STATIC(ProjectSettingsHelper, s_globalProjectSettings)
ProjectSettings *ProjectSettings::self()
{
  if (!s_globalProjectSettings()->q) {
    new ProjectSettings;
    s_globalProjectSettings()->q->read();
  }

  return s_globalProjectSettings()->q;
}

ProjectSettings::ProjectSettings( )
  : KDevelop::SessionConfigSkeleton( QStringLiteral( "kdeveloprc" ) )
{
  Q_ASSERT(!s_globalProjectSettings()->q);
  s_globalProjectSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Project Manager" ) );

  mParseAllProjectSourcesItem = new KDevelop::SessionConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Parse All Project Sources" ), mParseAllProjectSources, true );
  mParseAllProjectSourcesItem->setLabel( QCoreApplication::translate("ProjectSettings", "Schedule all project source code to be parsed by the language support in the background") );
  mParseAllProjectSourcesItem->setWhatsThis( QCoreApplication::translate("ProjectSettings", "If this option is set, KDevelop will schedule all source code\n"
"        found by the current build system for parsing by the appropriate language\n"
"        support part.  This will enable more complete language support, but may\n"
"        be slower.") );
  addItem( mParseAllProjectSourcesItem, QStringLiteral( "parseAllProjectSources" ) );
  mProjectsBaseDirectoryItem = new KDevelop::SessionConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "Projects Base Directory" ), mProjectsBaseDirectory, QUrl::fromLocalFile(QDir::homePath()+QLatin1String("/projects")) );
  mProjectsBaseDirectoryItem->setLabel( QCoreApplication::translate("ProjectSettings", "Projects Base Directory") );
  mProjectsBaseDirectoryItem->setWhatsThis( QCoreApplication::translate("ProjectSettings", "Chooses the base directory where new projects are created.") );
  addItem( mProjectsBaseDirectoryItem, QStringLiteral( "projectsBaseDirectory" ) );
  mSaveDocumentsItem = new KDevelop::SessionConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Save All Documents Before Building" ), mSaveDocuments, true );
  mSaveDocumentsItem->setLabel( QCoreApplication::translate("ProjectSettings", "Save all open documents before building anything") );
  mSaveDocumentsItem->setWhatsThis( QCoreApplication::translate("ProjectSettings", "If this option is set all open documents will be automatically saved before any build is started.") );
  addItem( mSaveDocumentsItem, QStringLiteral( "saveDocuments" ) );
}

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

