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

#include "dolphin_generalsettings.h"

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

class GeneralSettingsHelper
{
  public:
    GeneralSettingsHelper() : q(nullptr) {}
    ~GeneralSettingsHelper() { delete q; }
    GeneralSettings *q;
};
Q_GLOBAL_STATIC(GeneralSettingsHelper, s_globalGeneralSettings)
GeneralSettings *GeneralSettings::self()
{
  if (!s_globalGeneralSettings()->q) {
    new GeneralSettings;
    s_globalGeneralSettings()->q->read();
  }

  return s_globalGeneralSettings()->q;
}

GeneralSettings::GeneralSettings(  )
  : KConfigSkeleton( QStringLiteral( "dolphinrc" ) )
  , mSettingsChanged(0)
{
  Q_ASSERT(!s_globalGeneralSettings()->q);
  s_globalGeneralSettings()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&GeneralSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemBool  *itemEditableUrl;
  itemEditableUrl = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "EditableUrl" ), mEditableUrl, false );
  addItem( itemEditableUrl, QStringLiteral( "EditableUrl" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesUrlCompletionMode;
  KConfigSkeleton::ItemEnum  *itemUrlCompletionMode;
  itemUrlCompletionMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "UrlCompletionMode" ), mUrlCompletionMode, valuesUrlCompletionMode, KCompletion::CompletionPopup );
  addItem( itemUrlCompletionMode, QStringLiteral( "UrlCompletionMode" ) );
  KConfigSkeleton::ItemBool  *itemShowFullPath;
  itemShowFullPath = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowFullPath" ), mShowFullPath, false );
  addItem( itemShowFullPath, QStringLiteral( "ShowFullPath" ) );
  KConfigSkeleton::ItemBool  *itemShowFullPathInTitlebar;
  itemShowFullPathInTitlebar = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowFullPathInTitlebar" ), mShowFullPathInTitlebar, false );
  addItem( itemShowFullPathInTitlebar, QStringLiteral( "ShowFullPathInTitlebar" ) );
  KConfigSkeleton::ItemInt  *itemVersion;
  itemVersion = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Version" ), mVersion, 0 );
  addItem( itemVersion, QStringLiteral( "Version" ) );
  KConfigSkeleton::ItemBool  *itemModifiedStartupSettings;
  itemModifiedStartupSettings = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ModifiedStartupSettings" ), mModifiedStartupSettings, false );
  addItem( itemModifiedStartupSettings, QStringLiteral( "ModifiedStartupSettings" ) );
  KConfigSkeleton::ItemString  *itemHomeUrl;
  itemHomeUrl = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "HomeUrl" ), mHomeUrl, QUrl::fromLocalFile(QDir::homePath()).toDisplayString(QUrl::PreferLocalFile) );
  addItem( itemHomeUrl, QStringLiteral( "HomeUrl" ) );
  KConfigSkeleton::ItemBool  *itemSplitView;
  itemSplitView = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SplitView" ), mSplitView, false );
  addItem( itemSplitView, QStringLiteral( "SplitView" ) );
  KConfigSkeleton::ItemBool  *itemFilterBar;
  itemFilterBar = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FilterBar" ), mFilterBar, false );
  addItem( itemFilterBar, QStringLiteral( "FilterBar" ) );
  KConfigSkeleton::ItemBool  *itemGlobalViewProps;
  itemGlobalViewProps = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "GlobalViewProps" ), mGlobalViewProps, false );
  addItem( itemGlobalViewProps, QStringLiteral( "GlobalViewProps" ) );
  KConfigSkeleton::ItemBool  *itemBrowseThroughArchives;
  itemBrowseThroughArchives = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "BrowseThroughArchives" ), mBrowseThroughArchives, false );
  addItem( itemBrowseThroughArchives, QStringLiteral( "BrowseThroughArchives" ) );
  KConfigSkeleton::ItemBool  *itemConfirmClosingMultipleTabs;
  itemConfirmClosingMultipleTabs = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ConfirmClosingMultipleTabs" ), mConfirmClosingMultipleTabs, true );
  addItem( itemConfirmClosingMultipleTabs, QStringLiteral( "ConfirmClosingMultipleTabs" ) );
  KConfigSkeleton::ItemBool  *itemRenameInline;
  itemRenameInline = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RenameInline" ), mRenameInline, true );
  addItem( itemRenameInline, QStringLiteral( "RenameInline" ) );
  KConfigSkeleton::ItemBool  *itemShowSelectionToggle;
  itemShowSelectionToggle = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowSelectionToggle" ), mShowSelectionToggle, true );
  addItem( itemShowSelectionToggle, QStringLiteral( "ShowSelectionToggle" ) );
  KConfigSkeleton::ItemBool  *itemUseTabForSwitchingSplitView;
  itemUseTabForSwitchingSplitView = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseTabForSwitchingSplitView" ), mUseTabForSwitchingSplitView, false );
  addItem( itemUseTabForSwitchingSplitView, QStringLiteral( "UseTabForSwitchingSplitView" ) );
  KConfigSkeleton::ItemBool  *itemShowToolTips;
  itemShowToolTips = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowToolTips" ), mShowToolTips, false );
  addItem( itemShowToolTips, QStringLiteral( "ShowToolTips" ) );
  KConfigSkeleton::ItemBool  *itemShowCopyMoveMenu;
  itemShowCopyMoveMenu = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowCopyMoveMenu" ), mShowCopyMoveMenu, false );
  addItem( itemShowCopyMoveMenu, QStringLiteral( "ShowCopyMoveMenu" ) );
  KConfigSkeleton::ItemDateTime  *itemViewPropsTimestamp;
  itemViewPropsTimestamp = new KConfigSkeleton::ItemDateTime( currentGroup(), QStringLiteral( "ViewPropsTimestamp" ), mViewPropsTimestamp );
  addItem( itemViewPropsTimestamp, QStringLiteral( "ViewPropsTimestamp" ) );
  KConfigSkeleton::ItemBool  *itemAutoExpandFolders;
  itemAutoExpandFolders = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AutoExpandFolders" ), mAutoExpandFolders, false );
  addItem( itemAutoExpandFolders, QStringLiteral( "AutoExpandFolders" ) );
  KConfigSkeleton::ItemBool  *itemShowZoomSlider;
  itemShowZoomSlider = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowZoomSlider" ), mShowZoomSlider, true );
  addItem( itemShowZoomSlider, QStringLiteral( "ShowZoomSlider" ) );
  KConfigSkeleton::ItemBool  *itemShowSpaceInfo;
  itemShowSpaceInfo = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowSpaceInfo" ), mShowSpaceInfo, true );
  addItem( itemShowSpaceInfo, QStringLiteral( "ShowSpaceInfo" ) );
  KConfigSkeleton::ItemBool  *itemLockPanels;
  itemLockPanels = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "LockPanels" ), mLockPanels, true );
  addItem( itemLockPanels, QStringLiteral( "LockPanels" ) );
  KConfigSkeleton::ItemBool  *itemEnlargeSmallPreviews;
  itemEnlargeSmallPreviews = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "EnlargeSmallPreviews" ), mEnlargeSmallPreviews, true );
  addItem( itemEnlargeSmallPreviews, QStringLiteral( "EnlargeSmallPreviews" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesSortingChoice;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("NaturalSorting");
    valuesSortingChoice.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("CaseInsensitiveSorting");
    valuesSortingChoice.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("CaseSensitiveSorting");
    valuesSortingChoice.append( choice );
  }
  KConfigCompilerSignallingItem  *itemSortingChoice;
  itemSortingChoice = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "SortingChoice" ), mSortingChoice, valuesSortingChoice, 0 ), this, notifyFunction, signalSortingChoiceChanged);
  addItem( itemSortingChoice, QStringLiteral( "SortingChoice" ) );
}

GeneralSettings::~GeneralSettings()
{
  s_globalGeneralSettings()->q = nullptr;
}

bool GeneralSettings::usrSave()
{
  const bool res = KConfigSkeleton::usrSave();
  if (!res) return false;

  if ( mSettingsChanged & signalSortingChoiceChanged )
    Q_EMIT sortingChoiceChanged();
  mSettingsChanged = 0;
  return true;
}

void GeneralSettings::itemChanged(quint64 flags) {
  mSettingsChanged |= flags;

}

#include "dolphin_generalsettings.moc"

