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

#include "mediaplayerpluginsettings.h"

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

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

  return s_globalMediaPlayerPluginSettings()->q;
}

MediaPlayerPluginSettings::MediaPlayerPluginSettings( )
  : KConfigSkeleton( QStringLiteral( "ktorrent_mediaplayerrc" ) )
{
  Q_ASSERT(!s_globalMediaPlayerPluginSettings()->q);
  s_globalMediaPlayerPluginSettings()->q = this;
  setCurrentGroup( QStringLiteral( "general" ) );

  KConfigSkeleton::ItemBool  *itemSkipVideos;
  itemSkipVideos = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "skipVideos" ), mSkipVideos, true );
  addItem( itemSkipVideos, QStringLiteral( "skipVideos" ) );
  KConfigSkeleton::ItemBool  *itemSkipIncomplete;
  itemSkipIncomplete = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "skipIncomplete" ), mSkipIncomplete, true );
  addItem( itemSkipIncomplete, QStringLiteral( "skipIncomplete" ) );
}

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

