digiKam
Loading...
Searching...
No Matches
disjointmetadata_p.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2015-08-17
7 * Description : Helper class for Image Description Editor Tab
8 *
9 * SPDX-FileCopyrightText: 2015 by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17#include "disjointmetadata.h"
18
19// Qt includes
20
21#include <QMutexLocker>
22#include <QtAlgorithms>
23
24// Local includes
25
26#include "templatemanager.h"
27#include "facetagseditor.h"
28#include "tagscache.h"
29#include "coredbaccess.h"
30#include "itemcomments.h"
31#include "iteminfo.h"
32#include "coredbwatch.h"
33#include "metadatahub.h"
34
35namespace Digikam
36{
37
39{
40public:
41
42 Private();
43
44 // use the automatic copy constructor
45
46 explicit Private(const DisjointMetadataDataFields& other);
47 explicit Private(const Private& other);
48
49public:
50
51 void makeConnections(DisjointMetadata* const q);
52
53 template <class T>
54 void loadSingleValue(const T& data,
55 T& storage,
57 {
58 switch (status)
59 {
60 case DisjointMetadataDataFields::MetadataInvalid:
61 {
62 storage = data;
63 status = DisjointMetadataDataFields::MetadataAvailable;
64
65 break;
66 }
67
68 case DisjointMetadataDataFields::MetadataAvailable:
69 {
70 // we have two values. If they are equal, status is unchanged
71
72 if (data == storage)
73 {
74 break;
75 }
76
77 // they are not equal. We need to enter the disjoint state.
78
79 status = DisjointMetadataDataFields::MetadataDisjoint;
80
81 break;
82 }
83
84 case DisjointMetadataDataFields::MetadataDisjoint:
85 {
86 break;
87 }
88 }
89 };
90
91public:
92
93 QMutex mutex;
94};
95
96} // namespace Digikam
Definition disjointmetadatadatafields.h:39
Status
Definition disjointmetadatadatafields.h:49
Definition disjointmetadata_p.h:39
QMutex mutex
Definition disjointmetadata_p.h:93
void loadSingleValue(const T &data, T &storage, DisjointMetadataDataFields::Status &status)
Definition disjointmetadata_p.h:54
Definition disjointmetadata.h:38
#define T
Definition datefolderview.cpp:34