mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
Adapt to KConfigGroup name officially being a QString type
GIT_SILENT
This commit is contained in:
parent
5d20c2f0e1
commit
91a4d5da94
|
@ -357,7 +357,7 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties
|
|||
addSeparator();
|
||||
|
||||
// Insert 'Move to Trash' and/or 'Delete'
|
||||
const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) || !properties.isLocal());
|
||||
const bool showDeleteAction = (KSharedConfig::openConfig()->group(QStringLiteral("KDE")).readEntry("ShowDeleteCommand", false) || !properties.isLocal());
|
||||
const bool showMoveToTrashAction = (properties.isLocal() && properties.supportsMoving());
|
||||
|
||||
if (showDeleteAction && showMoveToTrashAction) {
|
||||
|
|
|
@ -388,7 +388,8 @@ void DolphinPart::slotOpenContextMenu(const QPoint &pos, const KFileItem &_item,
|
|||
const bool supportsMoving = capabilities.supportsMoving();
|
||||
|
||||
if (capabilities.supportsDeleting()) {
|
||||
const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) || !item.isLocalFile());
|
||||
const bool showDeleteAction =
|
||||
(KSharedConfig::openConfig()->group(QStringLiteral("KDE")).readEntry("ShowDeleteCommand", false) || !item.isLocalFile());
|
||||
const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving;
|
||||
|
||||
if (showDeleteAction && showMoveToTrashAction) {
|
||||
|
@ -460,7 +461,7 @@ void DolphinPart::openSelectionDialog(const QString &title, const QString &text,
|
|||
dialog->setWindowTitle(title);
|
||||
dialog->setLabelText(text);
|
||||
|
||||
const KConfigGroup group = KSharedConfig::openConfig("dolphinpartrc")->group("Select Dialog");
|
||||
const KConfigGroup group = KSharedConfig::openConfig("dolphinpartrc")->group(QStringLiteral("Select Dialog"));
|
||||
dialog->setComboBoxEditable(true);
|
||||
dialog->setComboBoxItems(group.readEntry("History", QStringList()));
|
||||
|
||||
|
@ -475,7 +476,7 @@ void DolphinPart::openSelectionDialog(const QString &title, const QString &text,
|
|||
|
||||
// Need to evaluate this again here, because the captured value is const
|
||||
// (even if the const were removed from 'const KConfigGroup group =' above).
|
||||
KConfigGroup group = KSharedConfig::openConfig("dolphinpartrc")->group("Select Dialog");
|
||||
KConfigGroup group = KSharedConfig::openConfig("dolphinpartrc")->group(QStringLiteral("Select Dialog"));
|
||||
// Limit the size of the saved history.
|
||||
group.writeEntry("History", items.mid(0, 10));
|
||||
group.sync();
|
||||
|
|
|
@ -727,7 +727,7 @@ void DolphinViewContainer::slotfileMiddleClickActivated(const KFileItem &item)
|
|||
auto mimeType = item.currentMimeType();
|
||||
if (item.isLocalFile() && mimeType.inherits(QStringLiteral("application/x-executable")) && mimeType.inherits(QStringLiteral("text/plain"))
|
||||
&& QFileInfo(item.localPath()).isExecutable()) {
|
||||
KConfigGroup cfgGroup(KSharedConfig::openConfig(QStringLiteral("kiorc")), "Executable scripts");
|
||||
KConfigGroup cfgGroup(KSharedConfig::openConfig(QStringLiteral("kiorc")), QStringLiteral("Executable scripts"));
|
||||
const QString value = cfgGroup.readEntry("behaviourOnLaunch", "alwaysAsk");
|
||||
|
||||
// in case KIO::WidgetsOpenOrExecuteFileHandler::promptUserOpenOrExecute would not open the file
|
||||
|
|
|
@ -92,7 +92,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel *model, QO
|
|||
{
|
||||
Q_ASSERT(model);
|
||||
|
||||
const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
|
||||
const KConfigGroup globalConfig(KSharedConfig::openConfig(), QStringLiteral("PreviewSettings"));
|
||||
m_enabledPlugins = globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins());
|
||||
m_localFileSizePreviewLimit = static_cast<qulonglong>(globalConfig.readEntry("MaximumSize", 0));
|
||||
|
||||
|
|
|
@ -276,7 +276,7 @@ void KItemListWidget::setHovered(bool hovered)
|
|||
|
||||
hoverSequenceStarted();
|
||||
|
||||
const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
|
||||
const KConfigGroup globalConfig(KSharedConfig::openConfig(), QStringLiteral("PreviewSettings"));
|
||||
const int interval = globalConfig.readEntry("HoverSequenceInterval", 700);
|
||||
|
||||
m_hoverSequenceTimer.start(interval);
|
||||
|
|
|
@ -75,7 +75,7 @@ void TreeViewContextMenu::open(const QPoint &pos)
|
|||
|
||||
// insert 'Move to Trash' and (optionally) 'Delete'
|
||||
KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::IncludeGlobals);
|
||||
KConfigGroup configGroup(globalConfig, "KDE");
|
||||
KConfigGroup configGroup(globalConfig, QStringLiteral("KDE"));
|
||||
bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false);
|
||||
|
||||
const QUrl url = m_fileItem.url();
|
||||
|
|
|
@ -166,7 +166,7 @@ void ContextMenuSettingsPage::applySettings()
|
|||
}
|
||||
|
||||
KConfig config(QStringLiteral("kservicemenurc"), KConfig::NoGlobals);
|
||||
KConfigGroup showGroup = config.group("Show");
|
||||
KConfigGroup showGroup = config.group(QStringLiteral("Show"));
|
||||
|
||||
QStringList enabledPlugins;
|
||||
|
||||
|
@ -181,7 +181,7 @@ void ContextMenuSettingsPage::applySettings()
|
|||
}
|
||||
} else if (service == QLatin1String(DeleteService)) {
|
||||
KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::NoGlobals);
|
||||
KConfigGroup configGroup(globalConfig, "KDE");
|
||||
KConfigGroup configGroup(globalConfig, QStringLiteral("KDE"));
|
||||
configGroup.writeEntry("ShowDeleteCommand", checked);
|
||||
configGroup.sync();
|
||||
} else if (service == QLatin1String(CopyToMoveToService)) {
|
||||
|
@ -241,7 +241,7 @@ void ContextMenuSettingsPage::showEvent(QShowEvent *event)
|
|||
|
||||
// Add "Show 'Delete' command" as service
|
||||
KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::IncludeGlobals);
|
||||
KConfigGroup configGroup(globalConfig, "KDE");
|
||||
KConfigGroup configGroup(globalConfig, QStringLiteral("KDE"));
|
||||
addRow(QStringLiteral("edit-delete"), i18nc("@option:check", "Delete"), DeleteService, configGroup.readEntry("ShowDeleteCommand", ShowDeleteDefault));
|
||||
|
||||
// Add "Show 'Copy To' and 'Move To' commands" as service
|
||||
|
@ -270,7 +270,7 @@ void ContextMenuSettingsPage::showEvent(QShowEvent *event)
|
|||
void ContextMenuSettingsPage::loadServices()
|
||||
{
|
||||
const KConfig config(QStringLiteral("kservicemenurc"), KConfig::NoGlobals);
|
||||
const KConfigGroup showGroup = config.group("Show");
|
||||
const KConfigGroup showGroup = config.group(QStringLiteral("Show"));
|
||||
|
||||
// Load generic services
|
||||
const auto locations = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kio/servicemenus"), QStandardPaths::LocateDirectory);
|
||||
|
|
|
@ -112,13 +112,13 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl &url, QWidget *parent, K
|
|||
}
|
||||
#endif
|
||||
|
||||
const KConfigGroup dialogConfig(KSharedConfig::openStateConfig(), "SettingsDialog");
|
||||
const KConfigGroup dialogConfig(KSharedConfig::openStateConfig(), QStringLiteral("SettingsDialog"));
|
||||
KWindowConfig::restoreWindowSize(windowHandle(), dialogConfig);
|
||||
}
|
||||
|
||||
DolphinSettingsDialog::~DolphinSettingsDialog()
|
||||
{
|
||||
KConfigGroup dialogConfig(KSharedConfig::openStateConfig(), "SettingsDialog");
|
||||
KConfigGroup dialogConfig(KSharedConfig::openStateConfig(), QStringLiteral("SettingsDialog"));
|
||||
KWindowConfig::saveWindowSize(windowHandle(), dialogConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -114,12 +114,12 @@ ConfirmationsSettingsPage::~ConfirmationsSettingsPage()
|
|||
void ConfirmationsSettingsPage::applySettings()
|
||||
{
|
||||
KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::NoGlobals);
|
||||
KConfigGroup confirmationGroup(kioConfig, "Confirmations");
|
||||
KConfigGroup confirmationGroup(kioConfig, QStringLiteral("Confirmations"));
|
||||
confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked());
|
||||
confirmationGroup.writeEntry("ConfirmEmptyTrash", m_confirmEmptyTrash->isChecked());
|
||||
confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked());
|
||||
|
||||
KConfigGroup scriptExecutionGroup(kioConfig, "Executable scripts");
|
||||
KConfigGroup scriptExecutionGroup(kioConfig, QStringLiteral("Executable scripts"));
|
||||
const int index = m_confirmScriptExecution->currentIndex();
|
||||
switch (index) {
|
||||
case ScriptExecution::AlwaysAsk:
|
||||
|
@ -162,12 +162,12 @@ void ConfirmationsSettingsPage::restoreDefaults()
|
|||
void ConfirmationsSettingsPage::loadSettings()
|
||||
{
|
||||
KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::IncludeGlobals);
|
||||
const KConfigGroup confirmationGroup(kioConfig, "Confirmations");
|
||||
const KConfigGroup confirmationGroup(kioConfig, QStringLiteral("Confirmations"));
|
||||
m_confirmMoveToTrash->setChecked(confirmationGroup.readEntry("ConfirmTrash", ConfirmTrash));
|
||||
m_confirmEmptyTrash->setChecked(confirmationGroup.readEntry("ConfirmEmptyTrash", ConfirmEmptyTrash));
|
||||
m_confirmDelete->setChecked(confirmationGroup.readEntry("ConfirmDelete", ConfirmDelete));
|
||||
|
||||
const KConfigGroup scriptExecutionGroup(KSharedConfig::openConfig(QStringLiteral("kiorc")), "Executable scripts");
|
||||
const KConfigGroup scriptExecutionGroup(KSharedConfig::openConfig(QStringLiteral("kiorc")), QStringLiteral("Executable scripts"));
|
||||
const QString value = scriptExecutionGroup.readEntry("behaviourOnLaunch", "alwaysAsk");
|
||||
if (value == QLatin1String("alwaysAsk")) {
|
||||
m_confirmScriptExecution->setCurrentIndex(ScriptExecution::AlwaysAsk);
|
||||
|
|
|
@ -174,7 +174,7 @@ void FoldersTabsSettingsPage::applySettings()
|
|||
|
||||
// Remove saved state if "remember open tabs" has been turned off
|
||||
if (!m_rememberOpenedTabsRadioButton->isChecked()) {
|
||||
KConfigGroup windowState{KSharedConfig::openConfig(QStringLiteral("dolphinrc")), "WindowState"};
|
||||
KConfigGroup windowState{KSharedConfig::openConfig(QStringLiteral("dolphinrc")), QStringLiteral("WindowState")};
|
||||
if (windowState.exists()) {
|
||||
windowState.deleteGroup();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ ViewModeSettings::ViewModeSettings()
|
|||
KSharedConfig::Ptr config = KSharedConfig::openConfig();
|
||||
// Migrate old config entries
|
||||
if (GeneralSettings::version() < 202) {
|
||||
for (const char *groupName : {"CompactMode", "DetailsMode", "IconsMode"}) {
|
||||
for (const QString &groupName : {QStringLiteral("CompactMode"), QStringLiteral("DetailsMode"), QStringLiteral("IconsMode")}) {
|
||||
KConfigGroup group = config->group(groupName);
|
||||
const QString family = group.readEntry("FontFamily", QString{});
|
||||
if (family.isEmpty()) {
|
||||
|
|
|
@ -209,7 +209,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView *dolphinView)
|
|||
applyButton->setEnabled(isDirty);
|
||||
});
|
||||
|
||||
const KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), "ViewPropertiesDialog");
|
||||
const KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), QStringLiteral("ViewPropertiesDialog"));
|
||||
KWindowConfig::restoreWindowSize(windowHandle(), dialogConfig);
|
||||
|
||||
loadSettings();
|
||||
|
@ -221,7 +221,7 @@ ViewPropertiesDialog::~ViewPropertiesDialog()
|
|||
delete m_viewProps;
|
||||
m_viewProps = nullptr;
|
||||
|
||||
KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), "ViewPropertiesDialog");
|
||||
KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), QStringLiteral("ViewPropertiesDialog"));
|
||||
KWindowConfig::saveWindowSize(windowHandle(), dialogConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ void Trash::empty(QWidget *window)
|
|||
bool Trash::isEmpty()
|
||||
{
|
||||
KConfig trashConfig(QStringLiteral("trashrc"), KConfig::SimpleConfig);
|
||||
return (trashConfig.group("Status").readEntry("Empty", true));
|
||||
return (trashConfig.group(QStringLiteral("Status")).readEntry("Empty", true));
|
||||
}
|
||||
|
||||
#include "moc_dolphintrash.cpp"
|
||||
|
|
|
@ -93,7 +93,7 @@ void DolphinItemListView::readSettings()
|
|||
updateFont();
|
||||
updateGridSize();
|
||||
|
||||
const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
|
||||
const KConfigGroup globalConfig(KSharedConfig::openConfig(), QStringLiteral("PreviewSettings"));
|
||||
setEnabledPlugins(globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins()));
|
||||
setLocalFileSizePreviewLimit(globalConfig.readEntry("MaximumSize", 0));
|
||||
endTransaction();
|
||||
|
|
|
@ -198,8 +198,8 @@ void DolphinRemoteEncoding::slotDefault()
|
|||
qCDebug(DolphinDebug) << "Domain to remove: " << *it;
|
||||
if (config.hasGroup(*it)) {
|
||||
config.deleteGroup(*it);
|
||||
} else if (config.group("").hasKey(*it)) {
|
||||
config.group("").deleteEntry(*it); //don't know what group name is supposed to be XXX
|
||||
} else if (config.group(QString()).hasKey(*it)) {
|
||||
config.group(QString()).deleteEntry(*it); // don't know what group name is supposed to be XXX
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user