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

#include "discoversettings.h"

DiscoverSettings::DiscoverSettings( KSharedConfig::Ptr config )
  : KConfigSkeleton( std::move( config ) )
{
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&DiscoverSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "DiscoverUI" ) );

  KConfigCompilerSignallingItem  *itemAppsListPageSorting;
  KConfigSkeleton::ItemInt  *innerItemAppsListPageSorting;
  innerItemAppsListPageSorting = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "appsListPageSorting" ), mAppsListPageSorting, ResourcesProxyModel::RatingCountRole );
  itemAppsListPageSorting = new KConfigCompilerSignallingItem(innerItemAppsListPageSorting, this, notifyFunction, signalAppsListPageSortingChanged);
  addItem( itemAppsListPageSorting, QStringLiteral( "appsListPageSorting" ) );
  KConfigCompilerSignallingItem  *itemInstalledPageSorting;
  KConfigSkeleton::ItemInt  *innerItemInstalledPageSorting;
  innerItemInstalledPageSorting = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "installedPageSorting" ), mInstalledPageSorting, ResourcesProxyModel::NameRole );
  itemInstalledPageSorting = new KConfigCompilerSignallingItem(innerItemInstalledPageSorting, this, notifyFunction, signalInstalledPageSortingChanged);
  addItem( itemInstalledPageSorting, QStringLiteral( "installedPageSorting" ) );
  KConfigCompilerSignallingItem  *itemInstalledPageCategorize;
  KConfigSkeleton::ItemBool  *innerItemInstalledPageCategorize;
  innerItemInstalledPageCategorize = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "installedPageCategorize" ), mInstalledPageCategorize, true );
  itemInstalledPageCategorize = new KConfigCompilerSignallingItem(innerItemInstalledPageCategorize, this, notifyFunction, signalInstalledPageCategorizeChanged);
  addItem( itemInstalledPageCategorize, QStringLiteral( "installedPageCategorize" ) );
}

DiscoverSettings::~DiscoverSettings()
{
}


void DiscoverSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalAppsListPageSortingChanged:
    Q_EMIT appsListPageSortingChanged();
    break;
  case signalInstalledPageSortingChanged:
    Q_EMIT installedPageSortingChanged();
    break;
  case signalInstalledPageCategorizeChanged:
    Q_EMIT installedPageCategorizeChanged();
    break;
  }
}
