void ConfirmationsSettingsPage::applySettings() { KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::NoGlobals); KConfigGroup confirmationGroup(kioConfig, "Confirmations"); confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked()); confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked()); confirmationGroup.sync(); GeneralSettings* settings = GeneralSettings::self(); settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked()); settings->writeConfig(); }
void ConfirmationsSettingsPage::applySettings() { KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::NoGlobals); KConfigGroup confirmationGroup(kioConfig, "Confirmations"); confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked()); confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked()); confirmationGroup.sync(); if (m_confirmScriptExecution->isChecked()) { KConfigGroup scriptExecutionGroup(kioConfig, "Executable scripts"); scriptExecutionGroup.writeEntry("behaviourOnLaunch", "alwaysAsk"); scriptExecutionGroup.sync(); } GeneralSettings* settings = GeneralSettings::self(); settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked()); settings->save(); }
void BehaviorSettingsPage::applySettings() { ViewProperties props(m_url); // read current view properties const bool useGlobalProps = m_globalProps->isChecked(); GeneralSettings* settings = DolphinSettings::instance().generalSettings(); settings->setGlobalViewProps(useGlobalProps); if (useGlobalProps) { // Remember the global view properties by applying the current view properties. // It is important that GeneralSettings::globalViewProps() is set before // the class ViewProperties is used, as ViewProperties uses this setting // to find the destination folder for storing the view properties. ViewProperties globalProps(m_url); globalProps.setDirProperties(props); } KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::NoGlobals); KConfigGroup confirmationGroup(kioConfig, "Confirmations"); confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked()); confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked()); confirmationGroup.sync(); settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked()); settings->setRenameInline(m_renameInline->isChecked()); settings->setShowToolTips(m_showToolTips->isChecked()); settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); settings->writeConfig(); const bool naturalSorting = m_naturalSorting->isChecked(); if (KGlobalSettings::naturalSorting() != naturalSorting) { KConfigGroup group(KGlobal::config(), "KDE"); group.writeEntry("NaturalSorting", naturalSorting, KConfig::Persistent | KConfig::Global); KGlobalSettings::emitChange(KGlobalSettings::NaturalSortingChanged); } }