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

#include "settings.h"

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

class SettingsHelper
{
  public:
    SettingsHelper() : q(nullptr) {}
    ~SettingsHelper() { delete q; q = nullptr; }
    SettingsHelper(const SettingsHelper&) = delete;
    SettingsHelper& operator=(const SettingsHelper&) = delete;
    Settings *q;
};
Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings()->q) {
    new Settings;
    s_globalSettings()->q->read();
  }

  return s_globalSettings()->q;
}

Settings::Settings( )
  : KConfigSkeleton( QStringLiteral( "ktorrentrc" ) )
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "downloads" ) );

  KConfigSkeleton::ItemInt  *itemMaxDownloads;
  itemMaxDownloads = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "maxDownloads" ), mMaxDownloads, 5 );
  itemMaxDownloads->setMinValue(0);
  addItem( itemMaxDownloads, QStringLiteral( "maxDownloads" ) );
  KConfigSkeleton::ItemInt  *itemMaxSeeds;
  itemMaxSeeds = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "maxSeeds" ), mMaxSeeds, 10 );
  itemMaxSeeds->setMinValue(0);
  addItem( itemMaxSeeds, QStringLiteral( "maxSeeds" ) );
  KConfigSkeleton::ItemInt  *itemStartDownloadsOnLowDiskSpace;
  itemStartDownloadsOnLowDiskSpace = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "startDownloadsOnLowDiskSpace" ), mStartDownloadsOnLowDiskSpace, 0 );
  addItem( itemStartDownloadsOnLowDiskSpace, QStringLiteral( "startDownloadsOnLowDiskSpace" ) );
  KConfigSkeleton::ItemInt  *itemMaxConnections;
  itemMaxConnections = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "maxConnections" ), mMaxConnections, 120 );
  itemMaxConnections->setMinValue(0);
  addItem( itemMaxConnections, QStringLiteral( "maxConnections" ) );
  KConfigSkeleton::ItemInt  *itemMaxTotalConnections;
  itemMaxTotalConnections = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "maxTotalConnections" ), mMaxTotalConnections, 800 );
  itemMaxTotalConnections->setMinValue(0);
  addItem( itemMaxTotalConnections, QStringLiteral( "maxTotalConnections" ) );
  KConfigSkeleton::ItemInt  *itemMaxUploadRate;
  itemMaxUploadRate = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "maxUploadRate" ), mMaxUploadRate, 0 );
  itemMaxUploadRate->setMinValue(0);
  addItem( itemMaxUploadRate, QStringLiteral( "maxUploadRate" ) );
  KConfigSkeleton::ItemInt  *itemMaxDownloadRate;
  itemMaxDownloadRate = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "maxDownloadRate" ), mMaxDownloadRate, 0 );
  itemMaxDownloadRate->setMinValue(0);
  addItem( itemMaxDownloadRate, QStringLiteral( "maxDownloadRate" ) );
  KConfigSkeleton::ItemDouble  *itemMaxRatio;
  itemMaxRatio = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "maxRatio" ), mMaxRatio, 0 );
  itemMaxRatio->setMinValue(0);
  addItem( itemMaxRatio, QStringLiteral( "maxRatio" ) );
  KConfigSkeleton::ItemDouble  *itemGreenRatio;
  itemGreenRatio = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "greenRatio" ), mGreenRatio, 0.8 );
  itemGreenRatio->setMinValue(0);
  addItem( itemGreenRatio, QStringLiteral( "greenRatio" ) );
  KConfigSkeleton::ItemInt  *itemPort;
  itemPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "port" ), mPort, 6881 );
  itemPort->setMinValue(0);
  itemPort->setMaxValue(65535);
  addItem( itemPort, QStringLiteral( "port" ) );
  KConfigSkeleton::ItemInt  *itemUdpTrackerPort;
  itemUdpTrackerPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "udpTrackerPort" ), mUdpTrackerPort, 8881 );
  itemUdpTrackerPort->setMinValue(0);
  itemUdpTrackerPort->setMaxValue(65535);
  addItem( itemUdpTrackerPort, QStringLiteral( "udpTrackerPort" ) );
  KConfigSkeleton::ItemBool  *itemShowSystemTrayIcon;
  itemShowSystemTrayIcon = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showSystemTrayIcon" ), mShowSystemTrayIcon, true );
  addItem( itemShowSystemTrayIcon, QStringLiteral( "showSystemTrayIcon" ) );
  KConfigSkeleton::ItemBool  *itemShowTotalSpeedInTitle;
  itemShowTotalSpeedInTitle = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showTotalSpeedInTitle" ), mShowTotalSpeedInTitle, false );
  addItem( itemShowTotalSpeedInTitle, QStringLiteral( "showTotalSpeedInTitle" ) );
  KConfigSkeleton::ItemBool  *itemShowSpeedBarInTrayIcon;
  itemShowSpeedBarInTrayIcon = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showSpeedBarInTrayIcon" ), mShowSpeedBarInTrayIcon, false );
  addItem( itemShowSpeedBarInTrayIcon, QStringLiteral( "showSpeedBarInTrayIcon" ) );
  KConfigSkeleton::ItemInt  *itemDownloadBandwidth;
  itemDownloadBandwidth = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "downloadBandwidth" ), mDownloadBandwidth, 500 );
  itemDownloadBandwidth->setMinValue(0);
  itemDownloadBandwidth->setMaxValue(1000000);
  addItem( itemDownloadBandwidth, QStringLiteral( "downloadBandwidth" ) );
  KConfigSkeleton::ItemInt  *itemUploadBandwidth;
  itemUploadBandwidth = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "uploadBandwidth" ), mUploadBandwidth, 500 );
  itemUploadBandwidth->setMinValue(0);
  itemUploadBandwidth->setMaxValue(1000000);
  addItem( itemUploadBandwidth, QStringLiteral( "uploadBandwidth" ) );
  KConfigSkeleton::ItemBool  *itemAlwaysMinimizeToSystemTray;
  itemAlwaysMinimizeToSystemTray = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "alwaysMinimizeToSystemTray" ), mAlwaysMinimizeToSystemTray, false );
  addItem( itemAlwaysMinimizeToSystemTray, QStringLiteral( "alwaysMinimizeToSystemTray" ) );
  KConfigSkeleton::ItemBool  *itemShowPopups;
  itemShowPopups = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showPopups" ), mShowPopups, true );
  addItem( itemShowPopups, QStringLiteral( "showPopups" ) );
  KConfigSkeleton::ItemBool  *itemKeepSeeding;
  itemKeepSeeding = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "keepSeeding" ), mKeepSeeding, true );
  addItem( itemKeepSeeding, QStringLiteral( "keepSeeding" ) );
  KConfigSkeleton::ItemString  *itemTempDir;
  itemTempDir = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "tempDir" ), mTempDir );
  addItem( itemTempDir, QStringLiteral( "tempDir" ) );
  KConfigSkeleton::ItemBool  *itemUseSaveDir;
  itemUseSaveDir = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useSaveDir" ), mUseSaveDir, false );
  addItem( itemUseSaveDir, QStringLiteral( "useSaveDir" ) );
  KConfigSkeleton::ItemString  *itemSaveDir;
  itemSaveDir = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "saveDir" ), mSaveDir );
  addItem( itemSaveDir, QStringLiteral( "saveDir" ) );
  KConfigSkeleton::ItemBool  *itemUseTorrentCopyDir;
  itemUseTorrentCopyDir = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useTorrentCopyDir" ), mUseTorrentCopyDir, false );
  addItem( itemUseTorrentCopyDir, QStringLiteral( "useTorrentCopyDir" ) );
  KConfigSkeleton::ItemString  *itemTorrentCopyDir;
  itemTorrentCopyDir = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "torrentCopyDir" ), mTorrentCopyDir );
  addItem( itemTorrentCopyDir, QStringLiteral( "torrentCopyDir" ) );
  KConfigSkeleton::ItemBool  *itemUseCustomIP;
  itemUseCustomIP = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useCustomIP" ), mUseCustomIP, false );
  addItem( itemUseCustomIP, QStringLiteral( "useCustomIP" ) );
  KConfigSkeleton::ItemString  *itemLastSaveDir;
  itemLastSaveDir = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "lastSaveDir" ), mLastSaveDir, QString() );
  addItem( itemLastSaveDir, QStringLiteral( "lastSaveDir" ) );
  KConfigSkeleton::ItemString  *itemCustomIP;
  itemCustomIP = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "customIP" ), mCustomIP, QString() );
  addItem( itemCustomIP, QStringLiteral( "customIP" ) );
  KConfigSkeleton::ItemInt  *itemGuiUpdateInterval;
  itemGuiUpdateInterval = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "guiUpdateInterval" ), mGuiUpdateInterval, 1000 );
  itemGuiUpdateInterval->setMinValue(500);
  itemGuiUpdateInterval->setMaxValue(5000);
  addItem( itemGuiUpdateInterval, QStringLiteral( "guiUpdateInterval" ) );
  KConfigSkeleton::ItemBool  *itemDhtSupport;
  itemDhtSupport = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "dhtSupport" ), mDhtSupport, false );
  addItem( itemDhtSupport, QStringLiteral( "dhtSupport" ) );
  KConfigSkeleton::ItemInt  *itemDhtPort;
  itemDhtPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "dhtPort" ), mDhtPort, 7881 );
  itemDhtPort->setMinValue(1);
  itemDhtPort->setMaxValue(65535);
  addItem( itemDhtPort, QStringLiteral( "dhtPort" ) );
  KConfigSkeleton::ItemBool  *itemPexEnabled;
  itemPexEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "pexEnabled" ), mPexEnabled, true );
  addItem( itemPexEnabled, QStringLiteral( "pexEnabled" ) );
  KConfigSkeleton::ItemInt  *itemNumUploadSlots;
  itemNumUploadSlots = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "numUploadSlots" ), mNumUploadSlots, 2 );
  itemNumUploadSlots->setMinValue(2);
  itemNumUploadSlots->setMaxValue(100);
  addItem( itemNumUploadSlots, QStringLiteral( "numUploadSlots" ) );
  KConfigSkeleton::ItemBool  *itemUseEncryption;
  itemUseEncryption = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useEncryption" ), mUseEncryption, false );
  addItem( itemUseEncryption, QStringLiteral( "useEncryption" ) );
  KConfigSkeleton::ItemBool  *itemAllowUnencryptedConnections;
  itemAllowUnencryptedConnections = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "allowUnencryptedConnections" ), mAllowUnencryptedConnections, true );
  addItem( itemAllowUnencryptedConnections, QStringLiteral( "allowUnencryptedConnections" ) );
  KConfigSkeleton::ItemInt  *itemTypeOfService;
  itemTypeOfService = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "typeOfService" ), mTypeOfService, 8 );
  itemTypeOfService->setMinValue(0);
  itemTypeOfService->setMaxValue(255);
  addItem( itemTypeOfService, QStringLiteral( "typeOfService" ) );
  KConfigSkeleton::ItemInt  *itemDscp;
  itemDscp = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "dscp" ), mDscp, 0 );
  itemDscp->setMinValue(0);
  itemDscp->setMaxValue(63);
  addItem( itemDscp, QStringLiteral( "dscp" ) );
  KConfigSkeleton::ItemInt  *itemMaxConnectingSockets;
  itemMaxConnectingSockets = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "maxConnectingSockets" ), mMaxConnectingSockets, 50 );
  itemMaxConnectingSockets->setMinValue(10);
  itemMaxConnectingSockets->setMaxValue(500);
  addItem( itemMaxConnectingSockets, QStringLiteral( "maxConnectingSockets" ) );
  KConfigSkeleton::ItemBool  *itemCheckWhenFinished;
  itemCheckWhenFinished = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "checkWhenFinished" ), mCheckWhenFinished, false );
  addItem( itemCheckWhenFinished, QStringLiteral( "checkWhenFinished" ) );
  QList<int> defaultshownColumns;

  KConfigSkeleton::ItemIntList  *itemShownColumns;
  itemShownColumns = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "shownColumns" ), mShownColumns, defaultshownColumns );
  addItem( itemShownColumns, QStringLiteral( "shownColumns" ) );
  KConfigSkeleton::ItemBool  *itemUseKDEProxySettings;
  itemUseKDEProxySettings = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useKDEProxySettings" ), mUseKDEProxySettings, true );
  addItem( itemUseKDEProxySettings, QStringLiteral( "useKDEProxySettings" ) );
  KConfigSkeleton::ItemString  *itemHttpProxy;
  itemHttpProxy = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "httpProxy" ), mHttpProxy, QString() );
  addItem( itemHttpProxy, QStringLiteral( "httpProxy" ) );
  KConfigSkeleton::ItemInt  *itemHttpProxyPort;
  itemHttpProxyPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "httpProxyPort" ), mHttpProxyPort, 8080 );
  itemHttpProxyPort->setMinValue(1);
  itemHttpProxyPort->setMaxValue(65535);
  addItem( itemHttpProxyPort, QStringLiteral( "httpProxyPort" ) );
  KConfigSkeleton::ItemBool  *itemUseProxyForWebSeeds;
  itemUseProxyForWebSeeds = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useProxyForWebSeeds" ), mUseProxyForWebSeeds, true );
  addItem( itemUseProxyForWebSeeds, QStringLiteral( "useProxyForWebSeeds" ) );
  KConfigSkeleton::ItemBool  *itemUseProxyForTracker;
  itemUseProxyForTracker = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useProxyForTracker" ), mUseProxyForTracker, true );
  addItem( itemUseProxyForTracker, QStringLiteral( "useProxyForTracker" ) );
  KConfigSkeleton::ItemBool  *itemSocksEnabled;
  itemSocksEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "socksEnabled" ), mSocksEnabled, false );
  addItem( itemSocksEnabled, QStringLiteral( "socksEnabled" ) );
  KConfigSkeleton::ItemString  *itemSocksProxy;
  itemSocksProxy = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "socksProxy" ), mSocksProxy, QString() );
  addItem( itemSocksProxy, QStringLiteral( "socksProxy" ) );
  KConfigSkeleton::ItemInt  *itemSocksPort;
  itemSocksPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "socksPort" ), mSocksPort, 1080 );
  itemSocksPort->setMinValue(1);
  itemSocksPort->setMaxValue(65535);
  addItem( itemSocksPort, QStringLiteral( "socksPort" ) );
  KConfigSkeleton::ItemInt  *itemSocksVersion;
  itemSocksVersion = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "socksVersion" ), mSocksVersion, 5 );
  itemSocksVersion->setMinValue(4);
  itemSocksVersion->setMaxValue(5);
  addItem( itemSocksVersion, QStringLiteral( "socksVersion" ) );
  KConfigSkeleton::ItemBool  *itemSocksUsePassword;
  itemSocksUsePassword = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "socksUsePassword" ), mSocksUsePassword, false );
  addItem( itemSocksUsePassword, QStringLiteral( "socksUsePassword" ) );
  KConfigSkeleton::ItemString  *itemSocksUsername;
  itemSocksUsername = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "socksUsername" ), mSocksUsername, QString() );
  addItem( itemSocksUsername, QStringLiteral( "socksUsername" ) );
  KConfigSkeleton::ItemString  *itemSocksPassword;
  itemSocksPassword = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "socksPassword" ), mSocksPassword, QString() );
  addItem( itemSocksPassword, QStringLiteral( "socksPassword" ) );
  KConfigSkeleton::ItemBool  *itemDiskPrealloc;
  itemDiskPrealloc = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "diskPrealloc" ), mDiskPrealloc, true );
  addItem( itemDiskPrealloc, QStringLiteral( "diskPrealloc" ) );
  KConfigSkeleton::ItemBool  *itemFullDiskPrealloc;
  itemFullDiskPrealloc = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "fullDiskPrealloc" ), mFullDiskPrealloc, false );
  addItem( itemFullDiskPrealloc, QStringLiteral( "fullDiskPrealloc" ) );
  KConfigSkeleton::ItemInt  *itemMinDiskSpace;
  itemMinDiskSpace = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "minDiskSpace" ), mMinDiskSpace, 100 );
  itemMinDiskSpace->setMinValue(10);
  itemMinDiskSpace->setMaxValue(10000);
  addItem( itemMinDiskSpace, QStringLiteral( "minDiskSpace" ) );
  KConfigSkeleton::ItemInt  *itemCpuUsage;
  itemCpuUsage = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "cpuUsage" ), mCpuUsage, 50 );
  itemCpuUsage->setMinValue(1);
  itemCpuUsage->setMaxValue(250);
  addItem( itemCpuUsage, QStringLiteral( "cpuUsage" ) );
  KConfigSkeleton::ItemBool  *itemUseCompletedDir;
  itemUseCompletedDir = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useCompletedDir" ), mUseCompletedDir, false );
  addItem( itemUseCompletedDir, QStringLiteral( "useCompletedDir" ) );
  KConfigSkeleton::ItemString  *itemCompletedDir;
  itemCompletedDir = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "completedDir" ), mCompletedDir );
  addItem( itemCompletedDir, QStringLiteral( "completedDir" ) );
  KConfigSkeleton::ItemDouble  *itemMaxSeedTime;
  itemMaxSeedTime = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "maxSeedTime" ), mMaxSeedTime, 0 );
  itemMaxSeedTime->setMinValue(0);
  addItem( itemMaxSeedTime, QStringLiteral( "maxSeedTime" ) );
  KConfigSkeleton::ItemString  *itemNetworkInterface;
  itemNetworkInterface = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "networkInterface" ), mNetworkInterface );
  addItem( itemNetworkInterface, QStringLiteral( "networkInterface" ) );
  KConfigSkeleton::ItemBool  *itemOpenMultipleTorrentsSilently;
  itemOpenMultipleTorrentsSilently = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "openMultipleTorrentsSilently" ), mOpenMultipleTorrentsSilently, false );
  addItem( itemOpenMultipleTorrentsSilently, QStringLiteral( "openMultipleTorrentsSilently" ) );
  KConfigSkeleton::ItemBool  *itemOpenAllTorrentsSilently;
  itemOpenAllTorrentsSilently = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "openAllTorrentsSilently" ), mOpenAllTorrentsSilently, false );
  addItem( itemOpenAllTorrentsSilently, QStringLiteral( "openAllTorrentsSilently" ) );
  KConfigSkeleton::ItemBool  *itemDecreasePriorityOfStalledTorrents;
  itemDecreasePriorityOfStalledTorrents = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "decreasePriorityOfStalledTorrents" ), mDecreasePriorityOfStalledTorrents, false );
  addItem( itemDecreasePriorityOfStalledTorrents, QStringLiteral( "decreasePriorityOfStalledTorrents" ) );
  KConfigSkeleton::ItemInt  *itemStallTimer;
  itemStallTimer = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "stallTimer" ), mStallTimer, 15 );
  itemStallTimer->setMinValue(1);
  addItem( itemStallTimer, QStringLiteral( "stallTimer" ) );
  KConfigSkeleton::ItemColor  *itemOkTorrentColor;
  itemOkTorrentColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "okTorrentColor" ), mOkTorrentColor, QColor(40, 205, 40) );
  addItem( itemOkTorrentColor, QStringLiteral( "okTorrentColor" ) );
  KConfigSkeleton::ItemColor  *itemStalledTorrentColor;
  itemStalledTorrentColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "stalledTorrentColor" ), mStalledTorrentColor, QColor(255, 174, 0) );
  addItem( itemStalledTorrentColor, QStringLiteral( "stalledTorrentColor" ) );
  KConfigSkeleton::ItemColor  *itemErrorTorrentColor;
  itemErrorTorrentColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "errorTorrentColor" ), mErrorTorrentColor, QColor(Qt::red) );
  addItem( itemErrorTorrentColor, QStringLiteral( "errorTorrentColor" ) );
  KConfigSkeleton::ItemBool  *itemHighlightTorrentNameByTrackerStatus;
  itemHighlightTorrentNameByTrackerStatus = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "highlightTorrentNameByTrackerStatus" ), mHighlightTorrentNameByTrackerStatus, true );
  addItem( itemHighlightTorrentNameByTrackerStatus, QStringLiteral( "highlightTorrentNameByTrackerStatus" ) );
  KConfigSkeleton::ItemColor  *itemOkTrackerConnectionColor;
  itemOkTrackerConnectionColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "okTrackerConnectionColor" ), mOkTrackerConnectionColor, QColor(40, 205, 40) );
  addItem( itemOkTrackerConnectionColor, QStringLiteral( "okTrackerConnectionColor" ) );
  KConfigSkeleton::ItemColor  *itemWarningsTrackerConnectionColor;
  itemWarningsTrackerConnectionColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "warningsTrackerConnectionColor" ), mWarningsTrackerConnectionColor, QColor(255, 80, 0) );
  addItem( itemWarningsTrackerConnectionColor, QStringLiteral( "warningsTrackerConnectionColor" ) );
  KConfigSkeleton::ItemColor  *itemTimeoutTrackerConnectionColor;
  itemTimeoutTrackerConnectionColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "timeoutTrackerConnectionColor" ), mTimeoutTrackerConnectionColor, QColor(0, 170, 110) );
  addItem( itemTimeoutTrackerConnectionColor, QStringLiteral( "timeoutTrackerConnectionColor" ) );
  KConfigSkeleton::ItemColor  *itemNoTrackerConnectionColor;
  itemNoTrackerConnectionColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "noTrackerConnectionColor" ), mNoTrackerConnectionColor, QColor(Qt::red) );
  addItem( itemNoTrackerConnectionColor, QStringLiteral( "noTrackerConnectionColor" ) );
  KConfigSkeleton::ItemColor  *itemGoodShareRatioColor;
  itemGoodShareRatioColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "goodShareRatioColor" ), mGoodShareRatioColor, QColor(40, 205, 40) );
  addItem( itemGoodShareRatioColor, QStringLiteral( "goodShareRatioColor" ) );
  KConfigSkeleton::ItemColor  *itemLowShareRatioColor;
  itemLowShareRatioColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "lowShareRatioColor" ), mLowShareRatioColor, QColor(Qt::red) );
  addItem( itemLowShareRatioColor, QStringLiteral( "lowShareRatioColor" ) );
  KConfigSkeleton::ItemInt  *itemPreviewSizeAudio;
  itemPreviewSizeAudio = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "previewSizeAudio" ), mPreviewSizeAudio, 256 );
  itemPreviewSizeAudio->setMinValue(16);
  addItem( itemPreviewSizeAudio, QStringLiteral( "previewSizeAudio" ) );
  KConfigSkeleton::ItemInt  *itemPreviewSizeVideo;
  itemPreviewSizeVideo = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "previewSizeVideo" ), mPreviewSizeVideo, 2048 );
  itemPreviewSizeVideo->setMinValue(16);
  addItem( itemPreviewSizeVideo, QStringLiteral( "previewSizeVideo" ) );
  KConfigSkeleton::ItemString  *itemTrackerListUrl;
  itemTrackerListUrl = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "trackerListUrl" ), mTrackerListUrl, QStringLiteral( "https://newtrackon.com/api/stable" ) );
  addItem( itemTrackerListUrl, QStringLiteral( "trackerListUrl" ) );
  KConfigSkeleton::ItemBool  *itemSuppressSleep;
  itemSuppressSleep = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "suppressSleep" ), mSuppressSleep, true );
  addItem( itemSuppressSleep, QStringLiteral( "suppressSleep" ) );
  KConfigSkeleton::ItemBool  *itemManuallyControlTorrents;
  itemManuallyControlTorrents = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "manuallyControlTorrents" ), mManuallyControlTorrents, false );
  addItem( itemManuallyControlTorrents, QStringLiteral( "manuallyControlTorrents" ) );
  KConfigSkeleton::ItemBool  *itemWebseedsEnabled;
  itemWebseedsEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "webseedsEnabled" ), mWebseedsEnabled, true );
  addItem( itemWebseedsEnabled, QStringLiteral( "webseedsEnabled" ) );
  KConfigSkeleton::ItemBool  *itemLookUpHostnameOfPeers;
  itemLookUpHostnameOfPeers = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "lookUpHostnameOfPeers" ), mLookUpHostnameOfPeers, true );
  addItem( itemLookUpHostnameOfPeers, QStringLiteral( "lookUpHostnameOfPeers" ) );
  KConfigSkeleton::ItemBool  *itemUtpEnabled;
  itemUtpEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "utpEnabled" ), mUtpEnabled, false );
  addItem( itemUtpEnabled, QStringLiteral( "utpEnabled" ) );
  KConfigSkeleton::ItemBool  *itemOnlyUseUtp;
  itemOnlyUseUtp = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "onlyUseUtp" ), mOnlyUseUtp, false );
  addItem( itemOnlyUseUtp, QStringLiteral( "onlyUseUtp" ) );
  KConfigSkeleton::ItemInt  *itemPrimaryTransportProtocol;
  itemPrimaryTransportProtocol = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "primaryTransportProtocol" ), mPrimaryTransportProtocol, 0 );
  itemPrimaryTransportProtocol->setMinValue(0);
  itemPrimaryTransportProtocol->setMaxValue(1);
  addItem( itemPrimaryTransportProtocol, QStringLiteral( "primaryTransportProtocol" ) );
  KConfigSkeleton::ItemBool  *itemAutoRenameSingleFileTorrents;
  itemAutoRenameSingleFileTorrents = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "autoRenameSingleFileTorrents" ), mAutoRenameSingleFileTorrents, false );
  addItem( itemAutoRenameSingleFileTorrents, QStringLiteral( "autoRenameSingleFileTorrents" ) );
  KConfigSkeleton::ItemBool  *itemHighlightNewTorrents;
  itemHighlightNewTorrents = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "highlightNewTorrents" ), mHighlightNewTorrents, true );
  addItem( itemHighlightNewTorrents, QStringLiteral( "highlightNewTorrents" ) );
  KConfigSkeleton::ItemInt  *itemNumMagnetDownloadingSlots;
  itemNumMagnetDownloadingSlots = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "numMagnetDownloadingSlots" ), mNumMagnetDownloadingSlots, 5 );
  itemNumMagnetDownloadingSlots->setMinValue(1);
  itemNumMagnetDownloadingSlots->setMaxValue(100);
  addItem( itemNumMagnetDownloadingSlots, QStringLiteral( "numMagnetDownloadingSlots" ) );
  KConfigSkeleton::ItemBool  *itemRequeueMagnets;
  itemRequeueMagnets = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "requeueMagnets" ), mRequeueMagnets, true );
  addItem( itemRequeueMagnets, QStringLiteral( "requeueMagnets" ) );
  KConfigSkeleton::ItemInt  *itemRequeueMagnetsTime;
  itemRequeueMagnetsTime = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "requeueMagnetsTime" ), mRequeueMagnetsTime, 5 );
  itemRequeueMagnetsTime->setMinValue(1);
  itemRequeueMagnetsTime->setMaxValue(60);
  addItem( itemRequeueMagnetsTime, QStringLiteral( "requeueMagnetsTime" ) );
}

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

