digiKam
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
* Copyright (C) 2015 by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com>
10
*
11
* This program is free software; you can redistribute it
12
* and/or modify it under the terms of the GNU General
13
* Public License as published by the Free Software Foundation;
14
* either version 2, or (at your option)
15
* any later version.
16
*
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
21
*
22
* ============================================================ */
23
24
#ifndef DIGIKAM_DISJOINT_METADATA_P_H
25
#define DIGIKAM_DISJOINT_METADATA_P_H
26
27
#include "
disjointmetadata.h
"
28
29
// Qt includes
30
31
#include <QMutexLocker>
32
#include <QtAlgorithms>
33
34
// Local includes
35
36
#include "
templatemanager.h
"
37
#include "
tagscache.h
"
38
#include "
coredbaccess.h
"
39
#include "
itemcomments.h
"
40
#include "
iteminfo.h
"
41
#include "
coredbwatch.h
"
42
#include "
metadatahub.h
"
43
44
namespace
Digikam
45
{
46
47
class
Q_DECL_HIDDEN
DisjointMetadata
::
Private
:
public
DisjointMetadataDataFields
48
{
49
public
:
50
51
explicit
Private
();
52
53
// use the automatic copy constructor
54
55
explicit
Private
(
const
DisjointMetadataDataFields
& other);
56
explicit
Private
(
const
Private
& other);
57
58
public
:
59
60
void
makeConnections(
DisjointMetadata
*
const
q);
61
62
template
<
class
T>
63
void
loadSingleValue
(
const
T
& data,
64
T
& storage,
65
DisjointMetadataDataFields::Status
& status)
66
{
67
switch
(status)
68
{
69
case
DisjointMetadataDataFields::MetadataInvalid
:
70
{
71
storage = data;
72
status =
DisjointMetadataDataFields::MetadataAvailable
;
73
break
;
74
}
75
76
case
DisjointMetadataDataFields::MetadataAvailable
:
77
{
78
// we have two values. If they are equal, status is unchanged
79
80
if
(data == storage)
81
{
82
break
;
83
}
84
85
// they are not equal. We need to enter the disjoint state.
86
87
status =
DisjointMetadataDataFields::MetadataDisjoint
;
88
break
;
89
}
90
91
case
DisjointMetadataDataFields::MetadataDisjoint
:
92
{
93
break
;
94
}
95
}
96
};
97
98
public
:
99
100
QMutex
mutex
;
101
};
102
103
}
// namespace Digikam
104
105
#endif
// DIGIKAM_DISJOINT_METADATA_P_H
Digikam::DisjointMetadataDataFields
Definition:
disjointmetadatadatafields.h:49
Digikam::DisjointMetadataDataFields::Status
Status
Definition:
disjointmetadatadatafields.h:59
Digikam::DisjointMetadataDataFields::MetadataDisjoint
@ MetadataDisjoint
No common value is available. For rating and dates, the interval is available.
Definition:
disjointmetadatadatafields.h:62
Digikam::DisjointMetadataDataFields::MetadataInvalid
@ MetadataInvalid
Not yet filled with any value.
Definition:
disjointmetadatadatafields.h:60
Digikam::DisjointMetadataDataFields::MetadataAvailable
@ MetadataAvailable
Only one data set has been added, or a common value is available.
Definition:
disjointmetadatadatafields.h:61
Digikam::DisjointMetadata::Private
Definition:
disjointmetadata_p.h:48
Digikam::DisjointMetadata::Private::mutex
QMutex mutex
Definition:
disjointmetadata_p.h:96
Digikam::DisjointMetadata::Private::loadSingleValue
void loadSingleValue(const T &data, T &storage, DisjointMetadataDataFields::Status &status)
Definition:
disjointmetadata_p.h:63
Digikam::DisjointMetadata
Definition:
disjointmetadata.h:47
coredbaccess.h
coredbwatch.h
disjointmetadata.h
itemcomments.h
iteminfo.h
metadatahub.h
T
#define T
Digikam
Definition:
datefolderview.cpp:43
tagscache.h
templatemanager.h
core
libs
properties
captions
disjointmetadata_p.h
Generated by
1.9.1