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

Kai Uwe Broulik noreply at phabricator.kde.org
Sun Sep 1 17:33:38 BST 2019


broulik added inline comments.

INLINE COMMENTS

> slavebase.cpp:189
> +        }
> +        if (config != nullptr) {
> +            delete config;

`delete nullptr` is fine, no need to check first

> slavebase.cpp:281
>      d->needSendCanResume = false;
> -    d->config = new KConfig(QString(), KConfig::SimpleConfig);
> -    // The KConfigGroup needs the KConfig to exist during its whole lifetime.
> -    d->configGroup = new KConfigGroup(d->config, QString());
> +    d->mapConfig = QMap<QString, QString>();
>      d->onHold = false;

This is initialized automatically like this

> slavebase.cpp:290
>  {
> -    delete d->configGroup;
> -    delete d->config;

Don't you still want this?

> slavebase.cpp:417
>  {
> +    if (d->config == nullptr) {
> +        d->config = new KConfig(QString(), KConfig::SimpleConfig);

Just check `if (!d->config)`

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D23523

To: meven, davidedmundson, dfaure, #frameworks
Cc: broulik, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190901/26d6571f/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list