digiKam
scancontroller_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 : 2005-10-28
7  * Description : scan item controller - private containers.
8  *
9  * Copyright (C) 2005-2006 by Tom Albers <tomalbers at kde dot nl>
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2007-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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_SCAN_CONTROLLER_P_H
27 #define DIGIKAM_SCAN_CONTROLLER_P_H
28 
29 #include "scancontroller.h"
30 
31 // Qt includes
32 
33 #include <QStringList>
34 #include <QFileInfo>
35 #include <QPixmap>
36 #include <QIcon>
37 #include <QTime>
38 #include <QMutex>
39 #include <QMutexLocker>
40 #include <QWaitCondition>
41 #include <QTimer>
42 #include <QEventLoop>
43 #include <QApplication>
44 #include <QMessageBox>
45 
46 // KDE includes
47 
48 #include <klocalizedstring.h>
49 
50 // Local includes
51 
52 #include "digikam_debug.h"
53 #include "collectionscanner.h"
54 #include "coredbaccess.h"
55 #include "collectionmanager.h"
56 #include "collectionlocation.h"
57 #include "filereadwritelock.h"
58 #include "coredbwatch.h"
59 #include "dprogressdlg.h"
60 #include "dmetadata.h"
61 #include "coredb.h"
62 #include "albummanager.h"
63 #include "album.h"
64 #include "coredbschemaupdater.h"
65 #include "iteminfo.h"
66 
67 namespace Digikam
68 {
69 
70 /*
71  * This class is derived from the LoadingCacheFileWatch,
72  * which means it has the full functionality of the class
73  * and only extends it by listening to CollectionScanner information
74  */
76 {
77  Q_OBJECT
78 
79 public:
80 
82 
83 private Q_SLOTS:
84 
85  void slotImageChanged(const ImageChangeset& changeset);
86 
87 private:
88 
89  // Disable
90  explicit ScanControllerLoadingCacheFileWatch(QObject*) = delete;
91 };
92 
93 // ------------------------------------------------------------------------------
94 
96 {
97 public:
98 
99  explicit SimpleCollectionScannerObserver(bool* const var);
100 
101  bool continueQuery() override;
102 
103 public:
104 
105  bool* m_continue;
106 };
107 
108 // ------------------------------------------------------------------------------
109 
110 class Q_DECL_HIDDEN ScanController::Private
111 {
112 public:
113 
114  explicit Private();
115 
116 
117  QPixmap albumPixmap();
118  QPixmap rootPixmap();
119  QPixmap actionPixmap();
120  QPixmap errorPixmap();
121  QPixmap restartPixmap();
122 
123  void garbageCollectHints(bool setAccessTime);
124 
125 public:
126 
127  bool running;
131  bool idle;
132 
134 
135  QStringList scanTasks;
136 
140 
141  QMutex mutex;
142  QWaitCondition condVar;
143 
147 
149 
150  QEventLoop* eventLoop;
151 
152  QTimer* showTimer;
153  QTimer* relaxedTimer;
154  QTimer* externalTimer;
155 
156  QPixmap albumPix;
157  QPixmap rootPix;
158  QPixmap actionPix;
159  QPixmap errorPix;
160 
162 
163  QDateTime lastHintAdded;
164 
166 
168 
172 
174 };
175 
176 // ------------------------------------------------------------------------------
177 
178 class Q_DECL_HIDDEN ScanControllerCreator
179 {
180 public:
181 
183 };
184 
185 } // namespace Digikam
186 
187 #endif // DIGIKAM_SCAN_CONTROLLER_P_H
Definition: collectionscannerhints.h:56
Definition: collectionscannerobserver.h:41
Definition: dprogressdlg.h:40
Definition: coredbchangesets.h:48
Definition: loadingcache.h:84
Definition: scancontroller_p.h:179
ScanController object
Definition: scancontroller_p.h:182
Definition: scancontroller_p.h:76
Definition: scancontroller_p.h:111
CollectionScannerHintContainer * hints
Definition: scancontroller_p.h:161
QMutex mutex
Definition: scancontroller_p.h:141
QList< qlonglong > newIdsList
Definition: scancontroller_p.h:173
QTimer * relaxedTimer
Definition: scancontroller_p.h:153
QDateTime lastHintAdded
Definition: scancontroller_p.h:163
bool running
Definition: scancontroller_p.h:127
QPixmap errorPix
Definition: scancontroller_p.h:159
DProgressDlg * progressDialog
Definition: scancontroller_p.h:165
QEventLoop * eventLoop
Definition: scancontroller_p.h:150
ScanController::Advice advice
Definition: scancontroller_p.h:167
QTimer * externalTimer
Definition: scancontroller_p.h:154
QPixmap rootPix
Definition: scancontroller_p.h:157
bool needTotalFiles
Definition: scancontroller_p.h:169
QTimer * showTimer
Definition: scancontroller_p.h:152
int totalFilesToScan
Definition: scancontroller_p.h:171
bool fileWatchInstalled
Definition: scancontroller_p.h:148
bool performFastScan
Definition: scancontroller_p.h:170
bool needsUpdateUniqueHash
Definition: scancontroller_p.h:130
QStringList completeScanDeferredAlbums
Definition: scancontroller_p.h:137
QStringList scanTasks
Definition: scancontroller_p.h:135
QPixmap actionPix
Definition: scancontroller_p.h:158
bool continueScan
Definition: scancontroller_p.h:145
bool finishScanAllowed
Definition: scancontroller_p.h:139
bool needsInitialization
Definition: scancontroller_p.h:128
bool needsCompleteScan
Definition: scancontroller_p.h:129
QPixmap albumPix
Definition: scancontroller_p.h:156
bool idle
Definition: scancontroller_p.h:131
bool continuePartialScan
Definition: scancontroller_p.h:146
bool continueInitialization
Definition: scancontroller_p.h:144
QWaitCondition condVar
Definition: scancontroller_p.h:142
int scanSuspended
Definition: scancontroller_p.h:133
bool deferFileScanning
Definition: scancontroller_p.h:138
Definition: scancontroller.h:52
Advice
Definition: scancontroller.h:58
Definition: scancontroller_p.h:96
bool * m_continue
Definition: scancontroller_p.h:105
Definition: datefolderview.cpp:43