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

#include "settings.h"

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

class ArkSettingsHelper
{
  public:
    ArkSettingsHelper() : q(nullptr) {}
    ~ArkSettingsHelper() { delete q; }
    ArkSettings *q;
};
Q_GLOBAL_STATIC(ArkSettingsHelper, s_globalArkSettings)
ArkSettings *ArkSettings::self()
{
  if (!s_globalArkSettings()->q) {
    new ArkSettings;
    s_globalArkSettings()->q->read();
  }

  return s_globalArkSettings()->q;
}

ArkSettings::ArkSettings(  )
  : KConfigSkeleton( QStringLiteral( "arkrc" ) )
{
  Q_ASSERT(!s_globalArkSettings()->q);
  s_globalArkSettings()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&ArkSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigCompilerSignallingItem  *itemShowEncryptionWarning;
  itemShowEncryptionWarning = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showEncryptionWarning" ), mShowEncryptionWarning, true ), this, notifyFunction, signalShowEncryptionWarningChanged);
  itemShowEncryptionWarning->setLabel( QCoreApplication::translate("ArkSettings", "Whether to show a warning when creating zip archives with AES encryption.") );
  addItem( itemShowEncryptionWarning, QStringLiteral( "showEncryptionWarning" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesdefaultOpenAction;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Preview");
    valuesdefaultOpenAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Open");
    valuesdefaultOpenAction.append( choice );
  }
  KConfigCompilerSignallingItem  *itemDefaultOpenAction;
  itemDefaultOpenAction = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "defaultOpenAction" ), mDefaultOpenAction, valuesdefaultOpenAction, EnumDefaultOpenAction::Preview ), this, notifyFunction, signalDefaultOpenActionChanged);
  itemDefaultOpenAction->setLabel( QCoreApplication::translate("ArkSettings", "Default action when opening archive entries.") );
  addItem( itemDefaultOpenAction, QStringLiteral( "defaultOpenAction" ) );

  setCurrentGroup( QStringLiteral( "Extraction" ) );

  KConfigCompilerSignallingItem  *itemOpenDestinationFolderAfterExtraction;
  itemOpenDestinationFolderAfterExtraction = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "openDestinationFolderAfterExtraction" ), mOpenDestinationFolderAfterExtraction, false ), this, notifyFunction, signalOpenDestinationFolderAfterExtractionChanged);
  itemOpenDestinationFolderAfterExtraction->setLabel( QCoreApplication::translate("ArkSettings", "Open destination folder after extraction.") );
  addItem( itemOpenDestinationFolderAfterExtraction, QStringLiteral( "openDestinationFolderAfterExtraction" ) );
  KConfigCompilerSignallingItem  *itemCloseAfterExtraction;
  itemCloseAfterExtraction = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "closeAfterExtraction" ), mCloseAfterExtraction, false ), this, notifyFunction, signalCloseAfterExtractionChanged);
  itemCloseAfterExtraction->setLabel( QCoreApplication::translate("ArkSettings", "Close Ark after extraction.") );
  addItem( itemCloseAfterExtraction, QStringLiteral( "closeAfterExtraction" ) );
  KConfigCompilerSignallingItem  *itemPreservePaths;
  itemPreservePaths = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "preservePaths" ), mPreservePaths, true ), this, notifyFunction, signalPreservePathsChanged);
  itemPreservePaths->setLabel( QCoreApplication::translate("ArkSettings", "Preserve paths when extracting.") );
  addItem( itemPreservePaths, QStringLiteral( "preservePaths" ) );
  KConfigCompilerSignallingItem  *itemExtractToSubfolder;
  itemExtractToSubfolder = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "extractToSubfolder" ), mExtractToSubfolder, true ), this, notifyFunction, signalExtractToSubfolderChanged);
  itemExtractToSubfolder->setLabel( QCoreApplication::translate("ArkSettings", "Extract to a subfolder if the archive has more than one top-level entry.") );
  addItem( itemExtractToSubfolder, QStringLiteral( "extractToSubfolder" ) );

  setCurrentGroup( QStringLiteral( "MainWindow" ) );

  QList<int> defaultsplitterSizes;
  defaultsplitterSizes.append( 200 );
  defaultsplitterSizes.append( 100 );

  KConfigCompilerSignallingItem  *itemSplitterSizes;
  itemSplitterSizes = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "splitterSizes" ), mSplitterSizes, defaultsplitterSizes ), this, notifyFunction, signalSplitterSizesChanged);
  itemSplitterSizes->setLabel( QCoreApplication::translate("ArkSettings", "How the main window is divided.") );
  addItem( itemSplitterSizes, QStringLiteral( "splitterSizes" ) );
  KConfigCompilerSignallingItem  *itemShowInfoPanel;
  itemShowInfoPanel = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "showInfoPanel" ), mShowInfoPanel, true ), this, notifyFunction, signalShowInfoPanelChanged);
  itemShowInfoPanel->setLabel( QCoreApplication::translate("ArkSettings", "Whether to show the information panel.") );
  addItem( itemShowInfoPanel, QStringLiteral( "showInfoPanel" ) );

  setCurrentGroup( QStringLiteral( "Plugins" ) );

  KConfigCompilerSignallingItem  *itemDisabledPlugins;
  itemDisabledPlugins = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "disabledPlugins" ), mDisabledPlugins ), this, notifyFunction, signalDisabledPluginsChanged);
  itemDisabledPlugins->setLabel( QCoreApplication::translate("ArkSettings", "disabledPlugins") );
  addItem( itemDisabledPlugins, QStringLiteral( "disabledPlugins" ) );

  setCurrentGroup( QStringLiteral( "Preview" ) );

  KConfigCompilerSignallingItem  *itemLimitPreviewFileSize;
  itemLimitPreviewFileSize = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "limitPreviewFileSize" ), mLimitPreviewFileSize, true ), this, notifyFunction, signalLimitPreviewFileSizeChanged);
  itemLimitPreviewFileSize->setLabel( QCoreApplication::translate("ArkSettings", "Whether to limit the preview according to file size.") );
  addItem( itemLimitPreviewFileSize, QStringLiteral( "limitPreviewFileSize" ) );
  KConfigCompilerSignallingItem  *itemPreviewFileSizeLimit;
  itemPreviewFileSizeLimit = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "previewFileSizeLimit" ), mPreviewFileSizeLimit, 200 ), this, notifyFunction, signalPreviewFileSizeLimitChanged);
  itemPreviewFileSizeLimit->setLabel( QCoreApplication::translate("ArkSettings", "Preview file size limit in megabytes.") );
  addItem( itemPreviewFileSizeLimit, QStringLiteral( "previewFileSizeLimit" ) );
}

ArkSettings::~ArkSettings()
{
  s_globalArkSettings()->q = nullptr;
}


void ArkSettings::itemChanged(quint64 flags) {

  if ( flags & signalShowEncryptionWarningChanged ) {
    Q_EMIT showEncryptionWarningChanged();
  }
  if ( flags & signalDefaultOpenActionChanged ) {
    Q_EMIT defaultOpenActionChanged();
  }
  if ( flags & signalOpenDestinationFolderAfterExtractionChanged ) {
    Q_EMIT openDestinationFolderAfterExtractionChanged();
  }
  if ( flags & signalCloseAfterExtractionChanged ) {
    Q_EMIT closeAfterExtractionChanged();
  }
  if ( flags & signalPreservePathsChanged ) {
    Q_EMIT preservePathsChanged();
  }
  if ( flags & signalExtractToSubfolderChanged ) {
    Q_EMIT extractToSubfolderChanged();
  }
  if ( flags & signalSplitterSizesChanged ) {
    Q_EMIT splitterSizesChanged();
  }
  if ( flags & signalShowInfoPanelChanged ) {
    Q_EMIT showInfoPanelChanged();
  }
  if ( flags & signalDisabledPluginsChanged ) {
    Q_EMIT disabledPluginsChanged();
  }
  if ( flags & signalLimitPreviewFileSizeChanged ) {
    Q_EMIT limitPreviewFileSizeChanged();
  }
  if ( flags & signalPreviewFileSizeLimitChanged ) {
    Q_EMIT previewFileSizeLimitChanged();
  }
}

#include "settings.moc"

