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

#include "magnetgeneratorpluginsettings.h"

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

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

  return s_globalMagnetGeneratorPluginSettings()->q;
}

MagnetGeneratorPluginSettings::MagnetGeneratorPluginSettings( )
  : KConfigSkeleton( QStringLiteral( "ktorrent_magnetgeneratorrc" ) )
{
  Q_ASSERT(!s_globalMagnetGeneratorPluginSettings()->q);
  s_globalMagnetGeneratorPluginSettings()->q = this;
  setCurrentGroup( QStringLiteral( "general" ) );

  KConfigSkeleton::ItemBool  *itemTorrenttracker;
  itemTorrenttracker = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "torrenttracker" ), mTorrenttracker, true );
  addItem( itemTorrenttracker, QStringLiteral( "torrenttracker" ) );
  KConfigSkeleton::ItemBool  *itemCustomtracker;
  itemCustomtracker = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "customtracker" ), mCustomtracker, false );
  addItem( itemCustomtracker, QStringLiteral( "customtracker" ) );
  KConfigSkeleton::ItemString  *itemTr;
  itemTr = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "tr" ), mTr, QStringLiteral( "http://tracker.openbittorrent.com/announce" ) );
  addItem( itemTr, QStringLiteral( "tr" ) );
  KConfigSkeleton::ItemBool  *itemDn;
  itemDn = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "dn" ), mDn, true );
  addItem( itemDn, QStringLiteral( "dn" ) );
  KConfigSkeleton::ItemBool  *itemPopup;
  itemPopup = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "popup" ), mPopup, true );
  addItem( itemPopup, QStringLiteral( "popup" ) );
  KConfigSkeleton::ItemBool  *itemOnlypublic;
  itemOnlypublic = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "onlypublic" ), mOnlypublic, true );
  addItem( itemOnlypublic, QStringLiteral( "onlypublic" ) );
}

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

