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

#include "globalsettings.h"

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

using namespace cppcheck;

namespace cppcheck {

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

}
Q_GLOBAL_STATIC(GlobalSettingsHelper, s_globalGlobalSettings)
GlobalSettings *GlobalSettings::self()
{
  if (!s_globalGlobalSettings()->q) {
    new GlobalSettings;
    s_globalGlobalSettings()->q->read();
  }

  return s_globalGlobalSettings()->q;
}

GlobalSettings::GlobalSettings( )
  : KConfigSkeleton()
{
  Q_ASSERT(!s_globalGlobalSettings()->q);
  s_globalGlobalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Cppcheck" ) );

  KConfigSkeleton::ItemPath  *itemExecutablePath;
  itemExecutablePath = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "executablePath" ), mExecutablePath, QStandardPaths::findExecutable(QStringLiteral("cppcheck")) );
  addItem( itemExecutablePath, QStringLiteral( "executablePath" ) );
  KConfigSkeleton::ItemBool  *itemHideOutputView;
  itemHideOutputView = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "hideOutputView" ), mHideOutputView, defaults::hideOutputView );
  addItem( itemHideOutputView, QStringLiteral( "hideOutputView" ) );
  KConfigSkeleton::ItemBool  *itemShowXmlOutput;
  itemShowXmlOutput = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showXmlOutput" ), mShowXmlOutput, defaults::showXmlOutput );
  addItem( itemShowXmlOutput, QStringLiteral( "showXmlOutput" ) );
}

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

