Diffusion KIO a497d47c45a5

[SlaveBase] Use QMap instead of KConfig to store ioslave config

Authored by meven on Oct 15 2019, 7:13 AM.

Description

[SlaveBase] Use QMap instead of KConfig to store ioslave config

Summary:
Inspired by https://github.com/blue-systems/plasma-5.16/issues/139#issuecomment-441704579
After some review, it seems to me using KConfig is not necessary here.
Removing its use should improve IO throughput since rebuildConfig is called in finished().
So mark the old config() function as deprecated.

TODO

  • port ioslaves in kio and kio-extras to use mapConfig() instead of config()
  • Clean up this description

Test Plan: ctest

Reviewers: davidedmundson, dfaure, Frameworks

Reviewed By: dfaure

Subscribers: broulik, kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D23523

Details

Committed
mevenOct 15 2019, 7:14 AM
Reviewer
dfaure
Differential Revision
D23523: [SlaveBase] Use QMap instead of KConfig to store ioslave config
Parents
R241:77fce361d9ba: Port KSslErrorUiData to QSslError
Branches
Unknown
Tags
Unknown
vkrause added inline comments.
/src/core/slavebase.cpp
197

This ends up crashing here, in unit tests and in regular use. Initializing the deleted members to null seems to help.

diff --git a/src/core/slavebase.cpp b/src/core/slavebase.cpp
index f39fe2d7..5f71795d 100644
--- a/src/core/slavebase.cpp
+++ b/src/core/slavebase.cpp
@@ -121,8 +121,8 @@ public:
     bool inOpenLoop: 1;
     bool exit_loop: 1;
     MetaData configData;
-    KConfig *config;
-    KConfigGroup *configGroup;
+    KConfig *config = nullptr;
+    KConfigGroup *configGroup = nullptr;
     QMap<QString, QVariant> mapConfig;
     QUrl onHoldUrl;