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

#include "globalsettings.h"

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

using namespace Heaptrack;

namespace Heaptrack {

class GlobalSettingsHelper
{
  public:
    GlobalSettingsHelper() noexcept : q(nullptr) {}
    ~GlobalSettingsHelper() noexcept { 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( "Heaptrack" ) );

  KConfigSkeleton::ItemPath  *itemHeaptrackExecutable;
  itemHeaptrackExecutable = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "heaptrackExecutable" ), mHeaptrackExecutable, findExecutable(QStringLiteral("heaptrack")) );
  addItem( itemHeaptrackExecutable, QStringLiteral( "heaptrackExecutable" ) );
  KConfigSkeleton::ItemPath  *itemHeaptrackGuiExecutable;
  itemHeaptrackGuiExecutable = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "heaptrackGuiExecutable" ), mHeaptrackGuiExecutable, findExecutable(QStringLiteral("heaptrack_gui")) );
  addItem( itemHeaptrackGuiExecutable, QStringLiteral( "heaptrackGuiExecutable" ) );
}

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

