Cppcheck - HTML report - digiKam-nl-search-more-criteria-rev-e2466e0973

# Cppcheck report - digiKam-nl-search-more-criteria-rev-e2466e0973: ../../core/dplugins/generic/webservices/piwigo/piwigosession.cpp

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    /* ============================================================
     *
     * This file is a part of digiKam project
     * https://www.digikam.org
     *
     * Date        : 2014-09-30
     * Description : a tool to export items to Piwigo web service
     *
     * SPDX-FileCopyrightText: 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
     * SPDX-FileCopyrightText: 2006      by Colin Guthrie <kde at colin dot guthr dot ie>
     * SPDX-FileCopyrightText: 2006-2026 by Gilles Caulier <caulier dot gilles at gmail dot com>
     * SPDX-FileCopyrightText: 2008      by Andrea Diamantini <adjam7 at gmail dot com>
     * SPDX-FileCopyrightText: 2010-2014 by Frederic Coiffier <frederic dot coiffier at free dot com>
     *
     * SPDX-License-Identifier: GPL-2.0-or-later
     *
     * ============================================================ */

    #include "piwigosession.h"

    // Qt includes

    #include <QApplication>

    // KDE includes

    #include <ksharedconfig.h>
    #include <kconfiggroup.h>

    // Local includes

    #include "digikam_debug.h"

    namespace DigikamGenericPiwigoPlugin
    {

    class Q_DECL_HIDDEN PiwigoSession::Private
    {
    public:

        Private() = default;

        QString url;
        QString username;
        QString password;
    };

    PiwigoSession::PiwigoSession()
        : d(new Private)
    {
        load();
    }

    PiwigoSession::~PiwigoSession()
    {
        delete d;
    }

    QString PiwigoSession::url() const
    {
        return d->url;
    }

    QString PiwigoSession::username() const
    {
        return d->username;
    }

    QString PiwigoSession::password() const
    {
        return d->password;
    }

    void PiwigoSession::setUrl(const QString& url)<--- Shadow argument
    {
        d->url = url;
    }

    void PiwigoSession::setUsername(const QString& username)<--- Shadow argument
    {
        d->username = username;
    }

    void PiwigoSession::setPassword(const QString& password)<--- Shadow argument
    {
        d->password = password;
    }

    void PiwigoSession::load()
    {
        KSharedConfigPtr config = KSharedConfig::openConfig();
        KConfigGroup group      = config->group(QLatin1String("Piwigo Settings"));

        d->url                  = group.readEntry("URL",      QString());
        d->username             = group.readEntry("Username", QString());
        d->password             = group.readEntry("Password", QString());
    }

    void PiwigoSession::save()
    {
        KSharedConfigPtr config = KSharedConfig::openConfig();
        KConfigGroup group      = config->group(QLatin1String("Piwigo Settings"));

        group.writeEntry(QString::fromUtf8("URL"),      url());
        group.writeEntry(QString::fromUtf8("Username"), username());
        group.writeEntry(QString::fromUtf8("Password"), password());

        config->sync();
    }

    } // namespace DigikamGenericPiwigoPlugin