digiKam
camerahistoryupdater.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 : 2009-10-16
7  * Description : history updater thread for importui
8  *
9  * Copyright (C) 2009-2011 by Andi Clemens <andi dot clemens at gmail dot com>
10  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_CAMERA_HISTORY_UPDATER_H
26 #define DIGIKAM_CAMERA_HISTORY_UPDATER_H
27 
28 // Qt includes
29 
30 #include <QDateTime>
31 #include <QMultiMap>
32 #include <QPair>
33 #include <QThread>
34 
35 // Local includes
36 
37 #include "camiteminfo.h"
38 
39 class QWidget;
40 
41 namespace Digikam
42 {
43 
44 typedef QMultiMap<QDateTime, CamItemInfo> CHUpdateItemMap;
45 typedef QPair<QByteArray, CHUpdateItemMap> CHUpdateItem;
46 
47 class CameraHistoryUpdater : public QThread
48 {
49  Q_OBJECT
50 
51 public:
52 
53  explicit CameraHistoryUpdater(QWidget* const parent);
55 
56  void addItems(const QByteArray& id, CHUpdateItemMap& map);
57 
58 Q_SIGNALS:
59 
60  void signalBusy(bool val);
62 
63 public Q_SLOTS:
64 
65  void slotCancel();
66 
67 protected:
68 
69  void run();
70 
71 private:
72 
73  void proccessMap(const QByteArray& id, CHUpdateItemMap& map);
74  void sendBusy(bool val);
75 
76 private:
77 
78  class Private;
79  Private* const d;
80 };
81 
82 } // namespace Digikam
83 
84 #endif // DIGIKAM_CAMERA_HISTORY_UPDATER_H
Definition: camerahistoryupdater.h:48
void slotCancel()
Definition: camerahistoryupdater.cpp:93
void run()
Definition: camerahistoryupdater.cpp:100
CameraHistoryUpdater(QWidget *const parent)
Definition: camerahistoryupdater.cpp:68
~CameraHistoryUpdater()
Definition: camerahistoryupdater.cpp:75
void addItems(const QByteArray &id, CHUpdateItemMap &map)
Definition: camerahistoryupdater.cpp:130
void signalHistoryMap(const CHUpdateItemMap &)
Definition: datefolderview.cpp:43
QMultiMap< QDateTime, CamItemInfo > CHUpdateItemMap
Definition: camerahistoryupdater.h:44
QPair< QByteArray, CHUpdateItemMap > CHUpdateItem
Definition: camerahistoryupdater.h:45