digiKam
albummanager_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 : 2004-06-15
7  * Description : Albums manager interface - private containers.
8  *
9  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11  * Copyright (C) 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_ALBUM_MANAGER_P_H
27 #define DIGIKAM_ALBUM_MANAGER_P_H
28 
29 #include "albummanager.h"
30 
31 // C ANSI includes
32 
33 extern "C"
34 {
35 #ifndef Q_CC_MSVC
36 # include <unistd.h>
37 #endif
38 #include <sys/types.h>
39 #include <sys/stat.h>
40 }
41 
42 // C++ includes
43 
44 #include <cerrno>
45 #include <clocale>
46 #include <cstdio>
47 #include <cstdlib>
48 
49 // Qt includes
50 
51 #include <QApplication>
52 #include <QByteArray>
53 #include <QDir>
54 #include <QFile>
55 #include <QGroupBox>
56 #include <QHash>
57 #include <QLabel>
58 #include <QList>
59 #include <QMultiHash>
60 #include <QRadioButton>
61 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
62 #include <QTextCodec>
63 #endif
64 #include <QTimer>
65 #include <QComboBox>
66 #include <QIcon>
67 #include <QPointer>
68 #include <QDialog>
69 #include <QDialogButtonBox>
70 #include <QVBoxLayout>
71 #include <QMessageBox>
72 #include <QCheckBox>
73 #include <QSet>
74 
75 // KDE includes
76 
77 #include <klocalizedstring.h>
78 
79 // Local includes
80 
81 #include "digikam_debug.h"
82 #include "coredb.h"
83 #include "album.h"
84 #include "albumpointer.h"
85 #include "applicationsettings.h"
86 #include "metaenginesettings.h"
87 #include "metadatasynchronizer.h"
88 #include "albumwatch.h"
89 #include "itemattributeswatch.h"
90 #include "collectionlocation.h"
91 #include "collectionmanager.h"
92 #include "digikam_config.h"
93 #include "coredbaccess.h"
94 #include "coredboperationgroup.h"
96 #include "dbengineparameters.h"
97 #include "dbsettingswidget.h"
98 #include "databaseserverstarter.h"
100 #include "coredburl.h"
101 #include "coredbsearchxml.h"
102 #include "coredbwatch.h"
103 #include "dio.h"
104 #include "facetags.h"
105 #include "facetagseditor.h"
106 #include "itemlister.h"
107 #include "scancontroller.h"
108 #include "setupcollections.h"
109 #include "setup.h"
110 #include "tagscache.h"
111 #include "thumbsdbaccess.h"
112 #include "thumbnailloadthread.h"
113 #include "dnotificationwrapper.h"
114 #include "dbjobinfo.h"
115 #include "dbjobsmanager.h"
116 #include "dbjobsthread.h"
117 #include "similaritydb.h"
118 #include "similaritydbaccess.h"
119 
120 namespace Digikam
121 {
122 
123 class Q_DECL_HIDDEN PAlbumPath
124 {
125 public:
126 
127  PAlbumPath();
128  PAlbumPath(int albumRootId, const QString& albumPath);
129  explicit PAlbumPath(PAlbum* const album);
130 
131  bool operator==(const PAlbumPath& other) const;
132 
133 public:
134 
136  QString albumPath;
137 };
138 
139 // -----------------------------------------------------------------------------------
140 
141 inline uint qHash(const PAlbumPath& id)
142 {
143  return (::qHash(id.albumRootId) ^ ::qHash(id.albumPath));
144 }
145 
146 // -----------------------------------------------------------------------------------
147 
148 class Q_DECL_HIDDEN AlbumManager::Private
149 {
150 public:
151 
152  explicit Private();
153 
154  bool changed;
156 
158 
160 
163 
168 
169 
171 
176 
177  QHash<int, Album*> allAlbumsIdHash;
178  QHash<PAlbumPath, PAlbum*> albumPathHash;
179  QHash<int, PAlbum*> albumRootAlbumHash;
181 
182  QMultiHash<Album*, Album**> guardedPointers;
183 
188 
197  QSet<int> changedPAlbums;
198 
199  QMap<int, int> pAlbumsCount;
200  QMap<int, int> tAlbumsCount;
201  QMap<YearMonth, int> dAlbumsCount;
202  QMap<int, int> fAlbumsCount;
204  QMap<int, int> uAlbumsCount;
206 
207 public:
208 
209  QString labelForAlbumRootAlbum(const CollectionLocation& location);
210 };
211 
212 // -----------------------------------------------------------------------------------
213 
214 class Q_DECL_HIDDEN ChangingDB
215 {
216 public:
217 
218  explicit ChangingDB(AlbumManager::Private* const dd);
219  ~ChangingDB();
220 
222 };
223 
224 // -----------------------------------------------------------------------------------
225 
226 class Q_DECL_HIDDEN AlbumManagerCreator
227 {
228 public:
229 
231 };
232 
233 } // namespace Digikam
234 
235 #endif // DIGIKAM_ALBUM_MANAGER_P_H
Definition: albummanager_p.h:227
AlbumManager object
Definition: albummanager_p.h:230
Definition: albummanager_p.h:149
AlbumWatch * albumWatch
Definition: albummanager_p.h:170
QMap< YearMonth, int > dAlbumsCount
Definition: albummanager_p.h:201
QTimer * tagItemCountTimer
Definition: albummanager_p.h:196
QTimer * scanPAlbumsTimer
Definition: albummanager_p.h:190
bool hasPriorizedDbPath
Definition: albummanager_p.h:155
int longTimeMessageBoxResult
Definition: albummanager_p.h:161
bool changed
Definition: albummanager_p.h:154
QTimer * scanSAlbumsTimer
Definition: albummanager_p.h:192
SAlbum * rootSAlbum
Definition: albummanager_p.h:175
TagsDBJobsThread * personListJob
Definition: albummanager_p.h:167
bool dbFakeConnection
Definition: albummanager_p.h:157
AlbumsDBJobsThread * albumListJob
Definition: albummanager_p.h:164
QHash< int, Album * > allAlbumsIdHash
Definition: albummanager_p.h:177
QSet< int > changedPAlbums
Definition: albummanager_p.h:197
QHash< PAlbumPath, PAlbum * > albumPathHash
Definition: albummanager_p.h:178
QTimer * scanDAlbumsTimer
Definition: albummanager_p.h:193
QMap< int, int > uAlbumsCount
Unconfirmed face counts.
Definition: albummanager_p.h:204
QMap< int, int > fAlbumsCount
Definition: albummanager_p.h:202
QMultiHash< Album *, Album ** > guardedPointers
Definition: albummanager_p.h:182
QHash< int, PAlbum * > albumRootAlbumHash
Definition: albummanager_p.h:179
QMap< int, int > tAlbumsCount
Definition: albummanager_p.h:200
Album * currentlyMovingAlbum
Definition: albummanager_p.h:180
QTimer * updatePAlbumsTimer
Definition: albummanager_p.h:194
TagsDBJobsThread * tagListJob
Definition: albummanager_p.h:166
DatesDBJobsThread * dateListJob
Definition: albummanager_p.h:165
QMap< int, int > pAlbumsCount
Definition: albummanager_p.h:199
int askMergeMessageBoxResult
Definition: albummanager_p.h:162
TAlbum * rootTAlbum
Definition: albummanager_p.h:173
QList< Album * > currentAlbums
Definition: albummanager_p.h:187
QTimer * albumItemCountTimer
Definition: albummanager_p.h:195
bool changingDB
Definition: albummanager_p.h:189
QList< int > toUpdatedFaces
Definition: albummanager_p.h:205
bool showOnlyAvailableAlbums
Definition: albummanager_p.h:159
QTimer * scanTAlbumsTimer
Definition: albummanager_p.h:191
PAlbum * rootPAlbum
Definition: albummanager_p.h:172
DAlbum * rootDAlbum
Definition: albummanager_p.h:174
Definition: albummanager.h:73
Definition: albumwatch.h:43
Abstract base class for all album types.
Definition: album.h:67
Definition: dbjobsthread.h:92
Definition: albummanager_p.h:215
AlbumManager::Private *const d
Definition: albummanager_p.h:221
Definition: collectionlocation.h:41
Definition: album.h:460
Definition: dbjobsthread.h:138
Definition: albummanager_p.h:124
int albumRootId
Definition: albummanager_p.h:135
QString albumPath
Definition: albummanager_p.h:136
Definition: album.h:357
Definition: album.h:493
Definition: album.h:420
Definition: dbjobsthread.h:115
std::vector< T > location(const std::vector< T > &shape, unsigned long idx)
Definition: shapepredictor.h:109
Definition: datefolderview.cpp:43
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition: searchtextbar.cpp:49
uint qHash(const PAlbumPath &id)
Definition: albummanager_p.h:141