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

#include "dolphin_generalsettings.h"

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

class GeneralSettingsHelper
{
  public:
    GeneralSettingsHelper() noexcept : q(nullptr) {}
    ~GeneralSettingsHelper() noexcept { delete q; q = nullptr; }
    GeneralSettingsHelper(const GeneralSettingsHelper&) = delete;
    GeneralSettingsHelper& operator=(const GeneralSettingsHelper&) = delete;
    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" ) )
{
  Q_ASSERT(!s_globalGeneralSettings()->q);
  s_globalGeneralSettings()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&GeneralSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemString  *itemDoubleClickViewAction;
  itemDoubleClickViewAction = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "DoubleClickViewAction" ), mDoubleClickViewAction, QStringLiteral( "edit_select_all" ) );
  addItem( itemDoubleClickViewAction, QStringLiteral( "DoubleClickViewAction" ) );
  KConfigSkeleton::ItemString  *itemDoubleClickViewCustomAction;
  itemDoubleClickViewCustomAction = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "DoubleClickViewCustomAction" ), mDoubleClickViewCustomAction );
  addItem( itemDoubleClickViewCustomAction, QStringLiteral( "DoubleClickViewCustomAction" ) );
  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::CompletionPopupAuto );
  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::ItemBool  *itemOpenExternallyCalledFolderInNewTab;
  itemOpenExternallyCalledFolderInNewTab = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "OpenExternallyCalledFolderInNewTab" ), mOpenExternallyCalledFolderInNewTab, false );
  addItem( itemOpenExternallyCalledFolderInNewTab, QStringLiteral( "OpenExternallyCalledFolderInNewTab" ) );
  KConfigCompilerSignallingItem  *itemAlwaysShowTabBar;
  KConfigSkeleton::ItemBool  *innerItemAlwaysShowTabBar;
  innerItemAlwaysShowTabBar = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AlwaysShowTabBar" ), mAlwaysShowTabBar, false );
  itemAlwaysShowTabBar = new KConfigCompilerSignallingItem(innerItemAlwaysShowTabBar, this, notifyFunction, signalTabBarChanged);
  addItem( itemAlwaysShowTabBar, QStringLiteral( "AlwaysShowTabBar" ) );
  KConfigCompilerSignallingItem  *itemShowCloseButtonOnTabs;
  KConfigSkeleton::ItemBool  *innerItemShowCloseButtonOnTabs;
  innerItemShowCloseButtonOnTabs = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowCloseButtonOnTabs" ), mShowCloseButtonOnTabs, true );
  itemShowCloseButtonOnTabs = new KConfigCompilerSignallingItem(innerItemShowCloseButtonOnTabs, this, notifyFunction, signalTabBarChanged);
  addItem( itemShowCloseButtonOnTabs, QStringLiteral( "ShowCloseButtonOnTabs" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesTabStyle;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("AutoSize");
    valuesTabStyle.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("FullWidth");
    valuesTabStyle.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("FixedSize");
    valuesTabStyle.append( choice );
  }
  KConfigCompilerSignallingItem  *itemTabStyle;
  KConfigSkeleton::ItemEnum  *innerItemTabStyle;
  innerItemTabStyle = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "TabStyle" ), mTabStyle, valuesTabStyle, EnumTabStyle::AutoSize );
  itemTabStyle = new KConfigCompilerSignallingItem(innerItemTabStyle, this, notifyFunction, signalTabBarChanged);
  addItem( itemTabStyle, QStringLiteral( "TabStyle" ) );
  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  *itemRememberOpenedTabs;
  itemRememberOpenedTabs = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RememberOpenedTabs" ), mRememberOpenedTabs, true );
  addItem( itemRememberOpenedTabs, QStringLiteral( "RememberOpenedTabs" ) );
  KConfigCompilerSignallingItem  *itemSplitView;
  KConfigSkeleton::ItemBool  *innerItemSplitView;
  innerItemSplitView = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SplitView" ), mSplitView, false );
  itemSplitView = new KConfigCompilerSignallingItem(innerItemSplitView, this, notifyFunction, signalSplitViewChanged);
  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, true );
  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  *itemConfirmClosingTerminalRunningProgram;
  itemConfirmClosingTerminalRunningProgram = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ConfirmClosingTerminalRunningProgram" ), mConfirmClosingTerminalRunningProgram, true );
  addItem( itemConfirmClosingTerminalRunningProgram, QStringLiteral( "ConfirmClosingTerminalRunningProgram" ) );
  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  *itemShowPasteBarAfterCopying;
  itemShowPasteBarAfterCopying = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowPasteBarAfterCopying" ), mShowPasteBarAfterCopying, true );
  addItem( itemShowPasteBarAfterCopying, QStringLiteral( "ShowPasteBarAfterCopying" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesCloseSplitViewChoice;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("ActiveView");
    valuesCloseSplitViewChoice.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("InactiveView");
    valuesCloseSplitViewChoice.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("RightView");
    valuesCloseSplitViewChoice.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemCloseSplitViewChoice;
  itemCloseSplitViewChoice = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "CloseSplitViewChoice" ), mCloseSplitViewChoice, valuesCloseSplitViewChoice, EnumCloseSplitViewChoice::ActiveView );
  addItem( itemCloseSplitViewChoice, QStringLiteral( "CloseSplitViewChoice" ) );
  KConfigSkeleton::ItemBool  *itemOpenNewTabAfterLastTab;
  itemOpenNewTabAfterLastTab = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "OpenNewTabAfterLastTab" ), mOpenNewTabAfterLastTab, false );
  addItem( itemOpenNewTabAfterLastTab, QStringLiteral( "OpenNewTabAfterLastTab" ) );
  KConfigSkeleton::ItemBool  *itemShowToolTips;
  itemShowToolTips = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowToolTips" ), mShowToolTips, false );
  addItem( itemShowToolTips, QStringLiteral( "ShowToolTips" ) );
  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" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesShowStatusBar;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Small");
    valuesShowStatusBar.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("FullWidth");
    valuesShowStatusBar.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Disabled");
    valuesShowStatusBar.append( choice );
  }
  KConfigCompilerSignallingItem  *itemShowStatusBar;
  KConfigSkeleton::ItemEnum  *innerItemShowStatusBar;
  innerItemShowStatusBar = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "ShowStatusBar" ), mShowStatusBar, valuesShowStatusBar, 0 );
  itemShowStatusBar = new KConfigCompilerSignallingItem(innerItemShowStatusBar, this, notifyFunction, signalShowStatusBarChanged);
  addItem( itemShowStatusBar, QStringLiteral( "ShowStatusBar" ) );
  KConfigSkeleton::ItemBool  *itemShowZoomSlider;
  itemShowZoomSlider = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowZoomSlider" ), mShowZoomSlider, false );
  addItem( itemShowZoomSlider, QStringLiteral( "ShowZoomSlider" ) );
  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;
  KConfigSkeleton::ItemEnum  *innerItemSortingChoice;
  innerItemSortingChoice = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "SortingChoice" ), mSortingChoice, valuesSortingChoice, 0 );
  itemSortingChoice = new KConfigCompilerSignallingItem(innerItemSortingChoice, this, notifyFunction, signalSortingChoiceChanged);
  addItem( itemSortingChoice, QStringLiteral( "SortingChoice" ) );
  KConfigSkeleton::ItemBool  *itemHideXTrashFile;
  itemHideXTrashFile = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "HideXTrashFile" ), mHideXTrashFile, false );
  addItem( itemHideXTrashFile, QStringLiteral( "HideXTrashFile" ) );
  KConfigSkeleton::ItemBool  *itemDynamicView;
  itemDynamicView = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DynamicView" ), mDynamicView, false );
  addItem( itemDynamicView, QStringLiteral( "DynamicView" ) );

  setCurrentGroup( QStringLiteral( "Notification Messages" ) );

  KConfigSkeleton::ItemBool  *itemConfirmOpenManyFolders;
  itemConfirmOpenManyFolders = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ConfirmOpenManyFolders" ), mConfirmOpenManyFolders, true );
  addItem( itemConfirmOpenManyFolders, QStringLiteral( "ConfirmOpenManyFolders" ) );
  KConfigSkeleton::ItemBool  *itemConfirmOpenManyTerminals;
  itemConfirmOpenManyTerminals = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ConfirmOpenManyTerminals" ), mConfirmOpenManyTerminals, true );
  addItem( itemConfirmOpenManyTerminals, QStringLiteral( "ConfirmOpenManyTerminals" ) );
  KConfigSkeleton::ItemBool  *itemConfirmRenameFileType;
  itemConfirmRenameFileType = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ConfirmRenameFileType" ), mConfirmRenameFileType, true );
  addItem( itemConfirmRenameFileType, QStringLiteral( "ConfirmRenameFileType" ) );
}

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

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

  if (mSettingsChanged.contains(signalTabBarChanged))
    Q_EMIT tabBarChanged();
  if (mSettingsChanged.contains(signalSortingChoiceChanged))
    Q_EMIT sortingChoiceChanged();
  if (mSettingsChanged.contains(signalSplitViewChanged))
    Q_EMIT splitViewChanged();
  if (mSettingsChanged.contains(signalShowStatusBarChanged))
    Q_EMIT showStatusBarChanged(mShowStatusBar);
  mSettingsChanged.clear();
  return true;
}

void GeneralSettings::itemChanged(quint64 signalFlag) {
  mSettingsChanged.insert(signalFlag);

}
