File indexing completed on 2025-01-19 03:53:38

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2007-05-01
0007  * Description : ItemInfo common data
0008  *
0009  * SPDX-FileCopyrightText: 2007-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0010  * SPDX-FileCopyrightText: 2013-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  * SPDX-FileCopyrightText: 2013      by Michael G. Hansen <mike at mghansen dot de>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #include "iteminfodata.h"
0018 
0019 // Qt includes
0020 
0021 #include <QHash>
0022 
0023 // Local includes
0024 
0025 #include "digikam_globals.h"
0026 
0027 namespace Digikam
0028 {
0029 
0030 ItemInfoStatic* ItemInfoStatic::m_instance = nullptr;
0031 
0032 void ItemInfoStatic::create()
0033 {
0034     if (!m_instance)
0035     {
0036         m_instance = new ItemInfoStatic;
0037     }
0038 }
0039 
0040 void ItemInfoStatic::destroy()
0041 {
0042     delete m_instance;
0043     m_instance = nullptr;
0044 }
0045 
0046 ItemInfoCache* ItemInfoStatic::cache()
0047 {
0048     return &m_instance->m_cache;
0049 }
0050 
0051 // ---------------------------------------------------------------
0052 
0053 ItemInfoData::ItemInfoData()
0054     : id                        (-1),
0055       currentReferenceImage     (-1),
0056       albumId                   (-1),
0057       albumRootId               (-1),
0058 
0059       pickLabel                 (NoPickLabel),
0060       colorLabel                (NoColorLabel),
0061       rating                    (-1),
0062       category                  (DatabaseItem::UndefinedCategory),
0063       orientation               (0),
0064       fileSize                  (0),
0065       manualOrder               (0),
0066       faceCount                 (0),
0067       unconfirmedFaceCount      (0),
0068 
0069       longitude                 (0),
0070       latitude                  (0),
0071       altitude                  (0),
0072       currentSimilarity         (0.0),
0073 
0074       groupImage                (-1),
0075 
0076       hasCoordinates            (false),
0077       hasAltitude               (false),
0078 
0079       defaultTitleCached        (false),
0080       defaultCommentCached      (false),
0081       pickLabelCached           (false),
0082       colorLabelCached          (false),
0083       ratingCached              (false),
0084       categoryCached            (false),
0085       formatCached              (false),
0086       creationDateCached        (false),
0087       modificationDateCached    (false),
0088       orientationCached         (false),
0089       fileSizeCached            (false),
0090       manualOrderCached         (false),
0091       uniqueHashCached          (false),
0092       imageSizeCached           (false),
0093       tagIdsCached              (false),
0094       positionsCached           (false),
0095       groupImageCached          (false),
0096       unconfirmedFaceCountCached(false),
0097       faceSuggestionsCached     (false),
0098       faceCountCached           (false),
0099 
0100       invalid                   (false),
0101 
0102       hasVideoMetadata          (true),
0103       hasImageMetadata          (true),
0104       videoMetadataCached       (DatabaseFields::VideoMetadataNone),
0105       imageMetadataCached       (DatabaseFields::ImageMetadataNone)
0106 {
0107 }
0108 
0109 ItemInfoData::~ItemInfoData()
0110 {
0111 }
0112 
0113 } // namespace Digikam