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

# Cppcheck report - digiKam-nl-search-more-criteria-rev-e2466e0973: ../../core/utilities/facemanagement/items/faceitem.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
    /* ============================================================
     *
     * This file is a part of digiKam project
     * https://www.digikam.org
     *
     * Date        : 2010-09-17
     * Description : Face tag region item
     *
     * SPDX-FileCopyrightText: 2010      by Aditya Bhatt <adityabhatt1991 at gmail dot com>
     * SPDX-FileCopyrightText: 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
     *
     * SPDX-License-Identifier: GPL-2.0-or-later
     *
     * ============================================================ */

    #include "faceitem.h"

    // Local includes

    #include "digikam_debug.h"
    #include "assignnamewidgetstates.h"

    namespace Digikam
    {

    FaceItem::FaceItem(QGraphicsItem* const parent)
        : RegionFrameItem(parent)
    {
    }

    void FaceItem::setFace(const FaceTagsIface& face)<--- Shadow argument
    {
        m_face = face;
        updateCurrentTag();
        setEditable(!(m_face.isIgnoredName()  ||
                      m_face.isConfirmedName()));
    }

    FaceTagsIface FaceItem::face() const
    {
        return m_face;
    }

    void FaceItem::setHudWidget(AssignNameWidget* const widget)<--- Shadow argument
    {
        m_widget = widget;
        updateCurrentTag();
        RegionFrameItem::setHudWidget(widget);

        // Ensure that all HUD widgets are stacked before the frame items.

        hudWidget()->setZValue(1);
    }

    AssignNameWidget* FaceItem::widget() const
    {
        return m_widget;
    }

    void FaceItem::switchMode(AssignNameWidget::Mode mode)
    {
        if (!m_widget || (m_widget->mode() == mode))
        {
            return;
        }

        if (!m_changer)
        {
            m_changer = new AssignNameWidgetStates(this);
        }

        m_changer->changeValue(mode);
    }

    void FaceItem::setEditable(bool allowEdit)
    {
        changeFlags(ShowResizeHandles | MoveByDrag, allowEdit);
    }

    void FaceItem::updateCurrentTag()
    {
        if (m_widget)
        {
            m_widget->setCurrentFace(m_face);
        }
    }

    } // namespace Digikam

    #include "moc_faceitem.cpp"